-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug where explicitly disabled stores would not be excluded from…
… reading whilst browse caching Improved example app capabilities (added ability to explictily disable stores when neccessary)
- Loading branch information
1 parent
04423de
commit 36dd576
Showing
20 changed files
with
478 additions
and
272 deletions.
There are no files selected for viewing
82 changes: 82 additions & 0 deletions
82
example/lib/src/screens/main/map_view/components/attribution.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_map/flutter_map.dart'; | ||
import 'package:flutter_map_tile_caching/flutter_map_tile_caching.dart'; | ||
|
||
import '../map_view.dart'; | ||
|
||
class Attribution extends StatelessWidget { | ||
const Attribution({ | ||
super.key, | ||
required this.urlTemplate, | ||
required this.mode, | ||
required this.stores, | ||
required this.otherStoresStrategy, | ||
}); | ||
|
||
final String urlTemplate; | ||
final MapViewMode mode; | ||
final Map<String, BrowseStoreStrategy?> stores; | ||
final BrowseStoreStrategy? otherStoresStrategy; | ||
|
||
@override | ||
Widget build(BuildContext context) => RichAttributionWidget( | ||
alignment: AttributionAlignment.bottomLeft, | ||
popupInitialDisplayDuration: const Duration(seconds: 3), | ||
popupBorderRadius: BorderRadius.circular(12), | ||
attributions: [ | ||
TextSourceAttribution(Uri.parse(urlTemplate).host), | ||
const TextSourceAttribution( | ||
'For demonstration purposes only', | ||
prependCopyright: false, | ||
textStyle: TextStyle(fontWeight: FontWeight.bold), | ||
), | ||
const TextSourceAttribution( | ||
'Offline mapping made with FMTC', | ||
prependCopyright: false, | ||
textStyle: TextStyle(fontStyle: FontStyle.italic), | ||
), | ||
LogoSourceAttribution( | ||
mode == MapViewMode.standard | ||
? const Icon(Icons.bug_report) | ||
: const SizedBox.shrink(), | ||
tooltip: 'Show resolved store configuration', | ||
onTap: () => showDialog( | ||
context: context, | ||
builder: (context) => AlertDialog.adaptive( | ||
title: const Text('Resolved store configuration'), | ||
content: Column( | ||
mainAxisSize: MainAxisSize.min, | ||
children: [ | ||
Text( | ||
stores.entries.isEmpty | ||
? 'No stores set explicitly' | ||
: stores.entries | ||
.map( | ||
(e) => '${e.key}: ${e.value ?? 'Explicitly ' | ||
'disabled'}', | ||
) | ||
.join('\n'), | ||
), | ||
Text( | ||
otherStoresStrategy == null | ||
? 'No other stores in use' | ||
: 'All unspecified stores: $otherStoresStrategy', | ||
), | ||
], | ||
), | ||
actions: [ | ||
TextButton( | ||
onPressed: () => Navigator.of(context).pop(), | ||
child: const Text('Understood'), | ||
), | ||
], | ||
), | ||
), | ||
), | ||
LogoSourceAttribution( | ||
Image.asset('assets/icons/ProjectIcon.png'), | ||
tooltip: 'flutter_map_tile_caching', | ||
), | ||
], | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...ts/home/components/stores_list/components/export_stores/example_app_limitations_text.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const exampleAppLimitationsText = | ||
'There are some limitations to the example app which do not exist in FMTC, ' | ||
'because it is difficult to express in this UI design.\nEach store only ' | ||
'contains tiles from a single URL template. Only a single tile layer is ' | ||
'used/available (only a single URL template can be used at any one time).'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.