From 0cf027f4771203b3ec3064fd89717ca33fd9ba97 Mon Sep 17 00:00:00 2001 From: UnicornsOnLSD <44349936+UnicornsOnLSD@users.noreply.github.com> Date: Sun, 11 Jul 2021 02:16:40 +0100 Subject: [PATCH] Disable app dir location adding on iOS --- .../CustomDownloadLocationForm.dart | 11 ++++---- lib/components/AlbumImage.dart | 2 +- lib/main.dart | 1 + lib/screens/AddDownloadLocationScreen.dart | 26 ++++++++++++------- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/lib/components/AddDownloadLocationScreen/CustomDownloadLocationForm.dart b/lib/components/AddDownloadLocationScreen/CustomDownloadLocationForm.dart index d303c09b5..63f2d3bb9 100644 --- a/lib/components/AddDownloadLocationScreen/CustomDownloadLocationForm.dart +++ b/lib/components/AddDownloadLocationScreen/CustomDownloadLocationForm.dart @@ -141,11 +141,12 @@ class _CustomDownloadLocationFormState }, ), Padding(padding: const EdgeInsets.all(8.0)), - Text( - "Custom locations can be buggy regarding permissions. If they don't work, use an app directory location instead.", - textAlign: TextAlign.center, - style: Theme.of(context).textTheme.caption, - ), + if (Platform.isAndroid) + Text( + "Custom locations can be buggy regarding permissions. If they don't work, use an app directory location instead.", + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.caption, + ), ], ), ); diff --git a/lib/components/AlbumImage.dart b/lib/components/AlbumImage.dart index 47576d681..f9bbdee4e 100644 --- a/lib/components/AlbumImage.dart +++ b/lib/components/AlbumImage.dart @@ -29,7 +29,7 @@ class AlbumImage extends StatelessWidget { ), ), ); - } else if (kDebugMode) { + } else if (!kDebugMode) { // If Flutter encounters an error, such as a 404, when getting an image, it will throw an exception. // This is super annoying while debugging since every blank album stops the whole app. // Because of this, I don't load images while the app is in debug mode. diff --git a/lib/main.dart b/lib/main.dart index 4d8c6f7d5..f5294b43f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -210,6 +210,7 @@ class Finamp extends StatelessWidget { } }, child: MaterialApp( + debugShowCheckedModeBanner: false, title: "Finamp", routes: { "/": (context) => SplashScreen(), diff --git a/lib/screens/AddDownloadLocationScreen.dart b/lib/screens/AddDownloadLocationScreen.dart index ed5a4b01b..8c58bd925 100644 --- a/lib/screens/AddDownloadLocationScreen.dart +++ b/lib/screens/AddDownloadLocationScreen.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -16,10 +18,14 @@ class AddDownloadLocationScreen extends StatefulWidget { class _AddDownloadLocationScreenState extends State with SingleTickerProviderStateMixin { - static const List tabs = [ - Tab(text: "CUSTOM LOCATION"), - Tab(text: "APP DIRECTORY"), - ]; + final tabs = Platform.isAndroid + ? [ + Tab(text: "CUSTOM LOCATION"), + Tab(text: "APP DIRECTORY"), + ] + : [ + Tab(text: "CUSTOM LOCATION"), + ]; final customLocationFormKey = GlobalKey(); final appDirectoryFormKey = GlobalKey(); @@ -113,12 +119,14 @@ class _AddDownloadLocationScreenState extends State ), ), ), - Center( - child: Padding( - padding: const EdgeInsets.all(16.0), - child: AppDirectoryLocationForm(formKey: appDirectoryFormKey), + if (Platform.isAndroid) + Center( + child: Padding( + padding: const EdgeInsets.all(16.0), + child: + AppDirectoryLocationForm(formKey: appDirectoryFormKey), + ), ), - ), ], ), );