fixed open last saved file location folder
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:fforte/l10n/app_localizations.dart';
|
import 'package:fforte/l10n/app_localizations.dart';
|
||||||
|
import 'package:open_file_manager/open_file_manager.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
// * Widget for the settings screen
|
// * Widget for the settings screen
|
||||||
@@ -24,7 +25,7 @@ class _SettingsState extends State<Settings> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_loadSettings(); // Load saved settings on start
|
_loadSettings(); // Load saved settings on start
|
||||||
}
|
}
|
||||||
|
|
||||||
// * Load settings from SharedPreferences
|
// * Load settings from SharedPreferences
|
||||||
@@ -72,20 +73,23 @@ class _SettingsState extends State<Settings> {
|
|||||||
),
|
),
|
||||||
// Display current save directory
|
// Display current save directory
|
||||||
FutureBuilder(
|
FutureBuilder(
|
||||||
future: _getSaveDir(),
|
future: _getSaveDir(),
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (snapshot.connectionState == ConnectionState.done) {
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
return Text(snapshot.data ?? "");
|
return Text(snapshot.data ?? "");
|
||||||
} else {
|
} else {
|
||||||
return const Text("");
|
return const Text("");
|
||||||
}
|
}
|
||||||
}
|
}),
|
||||||
),
|
|
||||||
// Button to open directory selection
|
// Button to open directory selection
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: () {},
|
onPressed: () async {
|
||||||
child: Text(AppLocalizations.of(context)!.open)
|
await openFileManager(
|
||||||
),
|
androidConfig: AndroidConfig(
|
||||||
|
folderType: AndroidFolderType.other,
|
||||||
|
folderPath: await _getSaveDir()));
|
||||||
|
},
|
||||||
|
child: Text(AppLocalizations.of(context)!.open)),
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
|
|
||||||
// * Tracking interval section
|
// * Tracking interval section
|
||||||
|
|||||||
@@ -493,6 +493,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.3"
|
version: "2.0.3"
|
||||||
|
open_file_manager:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: open_file_manager
|
||||||
|
sha256: e8a08a7a12b33b5d77b0d458c2ae656a4396ff1dd1d79a877f7dcb228f47fadc
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.1"
|
||||||
path:
|
path:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ dependencies:
|
|||||||
flutter_slidable: ^4.0.0
|
flutter_slidable: ^4.0.0
|
||||||
flutter_local_notifications: ^19.2.0
|
flutter_local_notifications: ^19.2.0
|
||||||
flutter_map_location_marker: ^10.1.0
|
flutter_map_location_marker: ^10.1.0
|
||||||
|
open_file_manager: ^2.0.1
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_lints: ^5.0.0
|
flutter_lints: ^5.0.0
|
||||||
|
|||||||
Reference in New Issue
Block a user