|
|
|
@@ -32,7 +32,7 @@ class _SettingsPageState extends State<SettingsPage> {
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
final titlePadding = Theme.of(context).listTileTheme.contentPadding!;
|
|
|
|
final titlePadding = Theme.of(context).listTileTheme.contentPadding!;
|
|
|
|
checkStoragePermission;
|
|
|
|
checkStoragePermission();
|
|
|
|
return Scaffold(
|
|
|
|
return Scaffold(
|
|
|
|
appBar: AppBar(title: Text(AppLocalizations.of(context)!.settings)),
|
|
|
|
appBar: AppBar(title: Text(AppLocalizations.of(context)!.settings)),
|
|
|
|
body: Center(
|
|
|
|
body: Center(
|
|
|
|
@@ -54,7 +54,8 @@ class _SettingsPageState extends State<SettingsPage> {
|
|
|
|
subtitle: Text(
|
|
|
|
subtitle: Text(
|
|
|
|
'For app-data settings to work, you need to grant the app permissions to manage internal storage.',
|
|
|
|
'For app-data settings to work, you need to grant the app permissions to manage internal storage.',
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onTap: () => PermissionService.requestStoragePermission,
|
|
|
|
onTap: () => PermissionService.requestStoragePermission
|
|
|
|
|
|
|
|
.whenComplete(() => checkStoragePermission()),
|
|
|
|
trailing: Icon(Icons.arrow_forward_ios_rounded),
|
|
|
|
trailing: Icon(Icons.arrow_forward_ios_rounded),
|
|
|
|
enabled: !storagePermissionIsGranted,
|
|
|
|
enabled: !storagePermissionIsGranted,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@@ -93,7 +94,7 @@ class _SettingsPageState extends State<SettingsPage> {
|
|
|
|
Storage.importFromJsonFile().then(showImportInfo);
|
|
|
|
Storage.importFromJsonFile().then(showImportInfo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future<void> get checkStoragePermission async {
|
|
|
|
Future<void> checkStoragePermission() async {
|
|
|
|
PermissionService.storagePermissionStatus.then((value) {
|
|
|
|
PermissionService.storagePermissionStatus.then((value) {
|
|
|
|
storagePermissionIsGranted = value.isGranted;
|
|
|
|
storagePermissionIsGranted = value.isGranted;
|
|
|
|
if (context.mounted && value.isGranted != storagePermissionIsGranted) {
|
|
|
|
if (context.mounted && value.isGranted != storagePermissionIsGranted) {
|
|
|
|
|