fixed open last saved file location folder

This commit is contained in:
Nico
2025-06-19 17:14:21 +02:00
parent da091e491e
commit 0ae87d9e54
3 changed files with 26 additions and 13 deletions

View File

@@ -6,6 +6,7 @@
import 'package:flutter/material.dart';
import 'package:fforte/l10n/app_localizations.dart';
import 'package:open_file_manager/open_file_manager.dart';
import 'package:shared_preferences/shared_preferences.dart';
// * Widget for the settings screen
@@ -24,7 +25,7 @@ class _SettingsState extends State<Settings> {
@override
void initState() {
super.initState();
_loadSettings(); // Load saved settings on start
_loadSettings(); // Load saved settings on start
}
// * Load settings from SharedPreferences
@@ -72,20 +73,23 @@ class _SettingsState extends State<Settings> {
),
// Display current save directory
FutureBuilder(
future: _getSaveDir(),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
return Text(snapshot.data ?? "");
} else {
return const Text("");
}
}
),
future: _getSaveDir(),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
return Text(snapshot.data ?? "");
} else {
return const Text("");
}
}),
// Button to open directory selection
ElevatedButton(
onPressed: () {},
child: Text(AppLocalizations.of(context)!.open)
),
onPressed: () async {
await openFileManager(
androidConfig: AndroidConfig(
folderType: AndroidFolderType.other,
folderPath: await _getSaveDir()));
},
child: Text(AppLocalizations.of(context)!.open)),
const SizedBox(height: 24),
// * Tracking interval section