Skip to content

Commit

Permalink
Disable app dir location adding on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
jmshrv committed Jul 11, 2021
1 parent 8e50c7d commit 0cf027f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
],
),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/components/AlbumImage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ class Finamp extends StatelessWidget {
}
},
child: MaterialApp(
debugShowCheckedModeBanner: false,
title: "Finamp",
routes: {
"/": (context) => SplashScreen(),
Expand Down
26 changes: 17 additions & 9 deletions lib/screens/AddDownloadLocationScreen.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

Expand All @@ -16,10 +18,14 @@ class AddDownloadLocationScreen extends StatefulWidget {

class _AddDownloadLocationScreenState extends State<AddDownloadLocationScreen>
with SingleTickerProviderStateMixin {
static const List<Tab> 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<FormState>();
final appDirectoryFormKey = GlobalKey<FormState>();
Expand Down Expand Up @@ -113,12 +119,14 @@ class _AddDownloadLocationScreenState extends State<AddDownloadLocationScreen>
),
),
),
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),
),
),
),
],
),
);
Expand Down

0 comments on commit 0cf027f

Please sign in to comment.