Skip to content

Commit

Permalink
main: Use system theme mode
Browse files Browse the repository at this point in the history
+ Some small fixes here and there
  • Loading branch information
tseli0s committed Dec 27, 2023
1 parent 9bfd469 commit 9b0294c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class FlText extends StatelessWidget {
return MaterialApp(
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
themeMode: ThemeMode.dark,
themeMode: ThemeMode.system,
debugShowCheckedModeBanner: false,
title: 'FlText',
theme: ThemeData(
Expand All @@ -76,7 +76,7 @@ class _HomepageState extends State<Homepage> {
void initState() {
super.initState();
if (!kIsWeb) {
if (firstLaunch && Platform.isAndroid) {
if (firstLaunch && (Platform.isAndroid || Platform.isFuchsia)) {
showErrorDialog(
context,
AppLocalizations.of(context)!.warning,
Expand Down Expand Up @@ -264,8 +264,8 @@ class _HomepageState extends State<Homepage> {
title: AppLocalizations.of(context)!.filenameTitle,
);
if (result != null) {
final path = await getApplicationDocumentsDirectory();
filename = '${path.absolute.path}/$result';
final path = await getExternalStorageDirectory();
filename = '${path?.absolute.path}/Documents/$result';
try {
File(filename).createSync(recursive: false, exclusive: true);
} catch (e) {
Expand Down

0 comments on commit 9b0294c

Please sign in to comment.