mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-09-30 21:19:42 +02:00
Move "about osm" to about page, add option to clear tile caches, option to add reason when deleting, min zoom 16 for edits/submissions, 300km nav distance warning
This commit is contained in:
1 parent
256dd1a43c
commit
08b395214b
25 files changed
+364
-160
No files matched your search
@@ -104,6 +104,9 @@ class TileProviderSection extends StatelessWidget {
|
||||
case 'edit':
|
||||
_editProvider(context, provider);
|
||||
break;
|
||||
case 'clear_cache':
|
||||
_clearProviderCaches(context, provider);
|
||||
break;
|
||||
case 'delete':
|
||||
_deleteProvider(context, provider);
|
||||
break;
|
||||
@@ -120,6 +123,16 @@ class TileProviderSection extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: 'clear_cache',
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.clear_all),
|
||||
const SizedBox(width: 8),
|
||||
Text(locService.t('tileProviders.clearCaches')),
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: 'delete',
|
||||
child: Row(
|
||||
@@ -154,6 +167,37 @@ class TileProviderSection extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
void _clearProviderCaches(BuildContext context, TileProvider provider) {
|
||||
final locService = LocalizationService.instance;
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text(locService.t('tileProviders.clearCaches')),
|
||||
content: Text(locService.t('tileProviders.clearCachesConfirm', params: [provider.name])),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: Text(locService.t('actions.cancel')),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
Navigator.of(context).pop();
|
||||
await context.read<AppState>().clearTileProviderCaches(provider.id);
|
||||
if (context.mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(locService.t('tileProviders.cachesCleared', params: [provider.name])),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
child: Text(locService.t('tileProviders.clearCaches')),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _deleteProvider(BuildContext context, TileProvider provider) {
|
||||
final locService = LocalizationService.instance;
|
||||
showDialog(
|
||||
|
||||
Reference in new issue
Block a user