diff --git a/analysis_options.yaml b/analysis_options.yaml index 5455ecc..aa934b5 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -5,4 +5,5 @@ linter: flutter_style_todos: false cascade_invocations: false sort_pub_dependencies: false - deprecated_member_use_from_same_package: false \ No newline at end of file + deprecated_member_use_from_same_package: false + discarded_futures: false \ No newline at end of file diff --git a/example/lib/flutter_map_cache/page.dart b/example/lib/flutter_map_cache/page.dart index a9aaf27..c15f477 100644 --- a/example/lib/flutter_map_cache/page.dart +++ b/example/lib/flutter_map_cache/page.dart @@ -85,8 +85,6 @@ class _FlutterMapCachePageState extends State { ), if (!kIsWeb) FutureBuilder( - // future does not get discarded - // ignore: discarded_futures future: getTemporaryDirectory(), // not available on web builder: (context, snapshot) { if (snapshot.hasData) { diff --git a/example/lib/flutter_map_maplibre/page2.dart b/example/lib/flutter_map_maplibre/page2.dart index dd981c6..a56d348 100644 --- a/example/lib/flutter_map_maplibre/page2.dart +++ b/example/lib/flutter_map_maplibre/page2.dart @@ -26,8 +26,8 @@ class _FlutterMapMapLibrePageState extends State { ), body: MapLibreMap( onMapCreated: (controller) => _controller = controller, - options: MapOptions( - initCenter: Position(0, 0), + options: const MapOptions( + initCenter: Geographic(lon: 0, lat: 0), initZoom: 3, maxPitch: 0, // flutter_map doesn't support pitch, disable it here initStyle: diff --git a/example/lib/flutter_map_pmtiles/page.dart b/example/lib/flutter_map_pmtiles/page.dart index abc081a..3805afd 100644 --- a/example/lib/flutter_map_pmtiles/page.dart +++ b/example/lib/flutter_map_pmtiles/page.dart @@ -18,7 +18,8 @@ const String tileSource = 'https://raw.githubusercontent.com/protomaps/PMTiles/main/spec/v3/stamen_toner(raster)CC-BY%2BODbL_z3.pmtiles'; class _FlutterMapPmTilesPageState extends State { - final _futureTileProvider = PmTilesTileProvider.fromSource(tileSource); + final Future _futureTileProvider = + PmTilesTileProvider.fromSource(tileSource); @override Widget build(BuildContext context) { diff --git a/example/lib/vector_map_tiles_mbtiles/page.dart b/example/lib/vector_map_tiles_mbtiles/page.dart index 929e53c..2258229 100644 --- a/example/lib/vector_map_tiles_mbtiles/page.dart +++ b/example/lib/vector_map_tiles_mbtiles/page.dart @@ -19,7 +19,7 @@ class _VectorMapTilesMbTilesPageState extends State { final Future _futureMbtiles = _initMbTiles(); MbTiles? _mbtiles; - final _theme = vtr.ProvidedThemes.lightTheme(); + final vtr.Theme _theme = vtr.ProvidedThemes.lightTheme(); static Future _initMbTiles() async { // This function copies an asset file from the asset bundle to the temporary diff --git a/example/lib/vector_map_tiles_pmtiles/page.dart b/example/lib/vector_map_tiles_pmtiles/page.dart index d53cbe7..d84aa8f 100644 --- a/example/lib/vector_map_tiles_pmtiles/page.dart +++ b/example/lib/vector_map_tiles_pmtiles/page.dart @@ -24,7 +24,8 @@ class VectorMapTilesPmTilesPage extends StatelessWidget { logger: kDebugMode ? const vtr.Logger.console() : null, ); - final _futureTileProvider = PmTilesVectorTileProvider.fromSource(tileSource); + final Future _futureTileProvider = + PmTilesVectorTileProvider.fromSource(tileSource); @override Widget build(BuildContext context) { diff --git a/example/pubspec.yaml b/example/pubspec.yaml index b6f1429..7ce2f6d 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -15,7 +15,7 @@ dependencies: sdk: flutter latlong2: ^0.9.0 url_launcher: ^6.2.4 - connectivity_plus: ^6.0.0 + connectivity_plus: ^7.0.0 path_provider: ^2.0.15 dio: ^5.2.0+1 dio_cache_interceptor: ^4.0.0 @@ -26,7 +26,7 @@ dependencies: vector_map_tiles: ^9.0.0-beta.8 vector_tile_renderer: ^6.0.0 mbtiles: ^0.4.0 - maplibre: ^0.2.0 + maplibre: ^0.3.0 flutter_map_cache: path: ../flutter_map_cache @@ -44,7 +44,7 @@ dependencies: path: ../vector_map_tiles_pmtiles dev_dependencies: - very_good_analysis: ^7.0.0 + very_good_analysis: ^10.0.0 flutter: uses-material-design: true diff --git a/flutter_map_cache/lib/src/cached_image_provider.dart b/flutter_map_cache/lib/src/cached_image_provider.dart index 82a3def..f537324 100644 --- a/flutter_map_cache/lib/src/cached_image_provider.dart +++ b/flutter_map_cache/lib/src/cached_image_provider.dart @@ -52,7 +52,6 @@ class CachedImageProvider extends ImageProvider { final chunkEvents = StreamController(); return MultiFrameImageStreamCompleter( - // ignore: discarded_futures, not actually but the lint thinks so codec: loadAsync(key, chunkEvents, decode), chunkEvents: chunkEvents.stream, scale: 1, diff --git a/flutter_map_cache/pubspec.yaml b/flutter_map_cache/pubspec.yaml index ab58130..94cc43f 100644 --- a/flutter_map_cache/pubspec.yaml +++ b/flutter_map_cache/pubspec.yaml @@ -33,4 +33,4 @@ dev_dependencies: http_mock_adapter: ^0.6.1 latlong2: ^0.9.0 test: ^1.24.9 - very_good_analysis: ^7.0.0 \ No newline at end of file + very_good_analysis: ^10.0.0 \ No newline at end of file diff --git a/flutter_map_compass/lib/src/utils.dart b/flutter_map_compass/lib/src/utils.dart index 9e37b9d..cd1e88a 100644 --- a/flutter_map_compass/lib/src/utils.dart +++ b/flutter_map_compass/lib/src/utils.dart @@ -1,4 +1,4 @@ import 'dart:math'; /// Saved calculation -const deg2Rad = pi / 180.0; +const double deg2Rad = pi / 180.0; diff --git a/flutter_map_compass/pubspec.yaml b/flutter_map_compass/pubspec.yaml index 2014e37..299ec85 100644 --- a/flutter_map_compass/pubspec.yaml +++ b/flutter_map_compass/pubspec.yaml @@ -24,4 +24,4 @@ dev_dependencies: sdk: flutter latlong2: ^0.9.0 test: ^1.24.9 - very_good_analysis: ^7.0.0 + very_good_analysis: ^10.0.0 diff --git a/flutter_map_maplibre/CHANGELOG.md b/flutter_map_maplibre/CHANGELOG.md index c926ff1..6184d92 100644 --- a/flutter_map_maplibre/CHANGELOG.md +++ b/flutter_map_maplibre/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.5 + +- Update `maplibre` to `^0.3.0` + ## 0.0.4 - Update docs diff --git a/flutter_map_maplibre/README.md b/flutter_map_maplibre/README.md index dd6bed6..f0ed9a2 100644 --- a/flutter_map_maplibre/README.md +++ b/flutter_map_maplibre/README.md @@ -23,8 +23,8 @@ powered by [maplibre](https://pub.dev/packages/maplibre). ```yaml dependencies: flutter_map: ^8.0.0 - flutter_map_maplibre: ^0.0.4 - maplibre: ^0.2.0 + flutter_map_maplibre: ^0.0.5 + maplibre: ^0.3.0 ``` 2. Follow the platform @@ -33,6 +33,7 @@ dependencies: - [Setup Web](https://flutter-maplibre.pages.dev/docs/getting-started/setup-web) - [Setup Android](https://flutter-maplibre.pages.dev/docs/getting-started/setup-android) +- [Setup iOS](https://flutter-maplibre.pages.dev/docs/getting-started/setup-ios) ## Usage @@ -88,7 +89,7 @@ Widget build(BuildContext context) { return MapLibreMap( onMapCreated: (controller) => _controller = controller, options: MapOptions( - initCenter: Position(0, 0), + initCenter: Geographic(lon: 0, lat: 0), initZoom: 3, maxPitch: 0, // flutter_map doesn't support camera pitch, disable it here initStyle: 'insert your style url here', diff --git a/flutter_map_maplibre/lib/src/extensions.dart b/flutter_map_maplibre/lib/src/extensions.dart index 119c60f..4b3a486 100644 --- a/flutter_map_maplibre/lib/src/extensions.dart +++ b/flutter_map_maplibre/lib/src/extensions.dart @@ -3,16 +3,16 @@ import 'package:flutter_map/flutter_map.dart' as fm; import 'package:latlong2/latlong.dart'; import 'package:maplibre/maplibre.dart'; -/// Extension methods on [Position]; -extension PositionExt on Position { - /// Convert [Position] to [LatLng]. - LatLng toLatLng() => LatLng(lat.toDouble(), lng.toDouble()); +/// Extension methods on [Geographic]; +extension PositionExt on Geographic { + /// Convert [Geographic] to [LatLng]. + LatLng toLatLng() => LatLng(lat, lon); } /// Extension methods on [LatLng]; extension LatLngExt on LatLng { - /// Convert [LatLng] to [Position]. - Position toPosition() => Position(longitude, latitude); + /// Convert [LatLng] to [Geographic]. + Geographic toPosition() => Geographic(lon: longitude, lat: latitude); } /// Extension methods on [MapController]; diff --git a/flutter_map_maplibre/pubspec.yaml b/flutter_map_maplibre/pubspec.yaml index cda2763..5dcbaad 100644 --- a/flutter_map_maplibre/pubspec.yaml +++ b/flutter_map_maplibre/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_map_maplibre description: "Performant Mapbox Vector Tiles (MVT) support for flutter_map powered by native MapLibre SDKs." -version: 0.0.4 +version: 0.0.5 topics: [ flutter-map, map, vector, maplibre, mvt ] repository: https://github.com/josxha/flutter_map_plugins issue_tracker: https://github.com/josxha/flutter_map_plugins/issues @@ -18,9 +18,9 @@ dependencies: sdk: flutter flutter_map: ^8.0.0 latlong2: ^0.9.1 - maplibre: ^0.2.1 + maplibre: ^0.3.0 dev_dependencies: flutter_test: sdk: flutter - very_good_analysis: ^7.0.0 + very_good_analysis: ^10.0.0 diff --git a/flutter_map_mbtiles/lib/src/mbtiles_image_provider.dart b/flutter_map_mbtiles/lib/src/mbtiles_image_provider.dart index 3190348..5d75eff 100644 --- a/flutter_map_mbtiles/lib/src/mbtiles_image_provider.dart +++ b/flutter_map_mbtiles/lib/src/mbtiles_image_provider.dart @@ -37,7 +37,6 @@ class MbTilesImageProvider extends ImageProvider { final chunkEvents = StreamController(); return MultiFrameImageStreamCompleter( - // ignore: discarded_futures, not actually but the lint thinks so codec: _loadAsync(key, chunkEvents, decode), chunkEvents: chunkEvents.stream, scale: 1, diff --git a/flutter_map_mbtiles/pubspec.yaml b/flutter_map_mbtiles/pubspec.yaml index ffe926b..da1e88a 100644 --- a/flutter_map_mbtiles/pubspec.yaml +++ b/flutter_map_mbtiles/pubspec.yaml @@ -27,4 +27,4 @@ dev_dependencies: latlong2: ^0.9.0 mockito: ^5.4.4 test: ^1.24.9 - very_good_analysis: ^7.0.0 + very_good_analysis: ^10.0.0 diff --git a/flutter_map_pmtiles/lib/src/pmtiles_image_provider.dart b/flutter_map_pmtiles/lib/src/pmtiles_image_provider.dart index ac9f8b3..16503e6 100644 --- a/flutter_map_pmtiles/lib/src/pmtiles_image_provider.dart +++ b/flutter_map_pmtiles/lib/src/pmtiles_image_provider.dart @@ -36,7 +36,6 @@ class PmTilesImageProvider extends ImageProvider { final chunkEvents = StreamController(); return MultiFrameImageStreamCompleter( - // ignore: discarded_futures, not actually but the lint thinks so codec: _loadAsync(key, chunkEvents, decode), chunkEvents: chunkEvents.stream, scale: 1, diff --git a/flutter_map_pmtiles/pubspec.yaml b/flutter_map_pmtiles/pubspec.yaml index 25b878d..726e852 100644 --- a/flutter_map_pmtiles/pubspec.yaml +++ b/flutter_map_pmtiles/pubspec.yaml @@ -26,4 +26,4 @@ dev_dependencies: mockito: ^5.4.4 build_runner: ^2.4.8 latlong2: ^0.9.0 - very_good_analysis: ^7.0.0 + very_good_analysis: ^10.0.0 diff --git a/vector_map_tiles_mbtiles/pubspec.yaml b/vector_map_tiles_mbtiles/pubspec.yaml index ba44b1d..0917376 100644 --- a/vector_map_tiles_mbtiles/pubspec.yaml +++ b/vector_map_tiles_mbtiles/pubspec.yaml @@ -27,5 +27,5 @@ dev_dependencies: build_runner: ^2.4.8 latlong2: ^0.9.0 flutter_map: ^8.0.0 - very_good_analysis: ^7.0.0 + very_good_analysis: ^10.0.0 vector_tile_renderer: ^6.0.0 diff --git a/vector_map_tiles_pmtiles/lib/src/themes/v3/_package.dart b/vector_map_tiles_pmtiles/lib/src/themes/v3/_package.dart index d01e329..be536a9 100644 --- a/vector_map_tiles_pmtiles/lib/src/themes/v3/_package.dart +++ b/vector_map_tiles_pmtiles/lib/src/themes/v3/_package.dart @@ -1,6 +1,3 @@ -// Altering format because it got pasted from json. -// ignore_for_file: prefer_single_quotes, require_trailing_commas - part 'black.dart'; part 'dark.dart'; part 'grayscale.dart'; diff --git a/vector_map_tiles_pmtiles/lib/src/themes/v3/black.dart b/vector_map_tiles_pmtiles/lib/src/themes/v3/black.dart index aea895a..c50134b 100644 --- a/vector_map_tiles_pmtiles/lib/src/themes/v3/black.dart +++ b/vector_map_tiles_pmtiles/lib/src/themes/v3/black.dart @@ -4,7 +4,7 @@ part of '_package.dart'; // ignore_for_file: prefer_single_quotes, require_trailing_commas /// https://docs.protomaps.com/basemaps/themes#black -const themeBlack = [ +const themeBlack = >[ { "id": "background", "type": "background", diff --git a/vector_map_tiles_pmtiles/lib/src/themes/v3/dark.dart b/vector_map_tiles_pmtiles/lib/src/themes/v3/dark.dart index bc50049..fb42680 100644 --- a/vector_map_tiles_pmtiles/lib/src/themes/v3/dark.dart +++ b/vector_map_tiles_pmtiles/lib/src/themes/v3/dark.dart @@ -4,7 +4,7 @@ part of '_package.dart'; // ignore_for_file: prefer_single_quotes, require_trailing_commas /// https://docs.protomaps.com/basemaps/themes#dark -const themeDark = [ +const themeDark = >[ { "id": "background", "type": "background", diff --git a/vector_map_tiles_pmtiles/lib/src/themes/v3/grayscale.dart b/vector_map_tiles_pmtiles/lib/src/themes/v3/grayscale.dart index 129ee2e..83cde40 100644 --- a/vector_map_tiles_pmtiles/lib/src/themes/v3/grayscale.dart +++ b/vector_map_tiles_pmtiles/lib/src/themes/v3/grayscale.dart @@ -4,7 +4,7 @@ part of '_package.dart'; // ignore_for_file: prefer_single_quotes, require_trailing_commas /// https://docs.protomaps.com/basemaps/themes#grayscale -const themeGrayscale = [ +const themeGrayscale = >[ { "id": "background", "type": "background", diff --git a/vector_map_tiles_pmtiles/lib/src/themes/v3/light.dart b/vector_map_tiles_pmtiles/lib/src/themes/v3/light.dart index 5243d02..ae912fd 100644 --- a/vector_map_tiles_pmtiles/lib/src/themes/v3/light.dart +++ b/vector_map_tiles_pmtiles/lib/src/themes/v3/light.dart @@ -4,7 +4,7 @@ part of '_package.dart'; // ignore_for_file: prefer_single_quotes, require_trailing_commas /// https://docs.protomaps.com/basemaps/themes#light -const themeLight = [ +const themeLight = >[ { "id": "background", "type": "background", diff --git a/vector_map_tiles_pmtiles/lib/src/themes/v3/white.dart b/vector_map_tiles_pmtiles/lib/src/themes/v3/white.dart index 07cc35a..a26f122 100644 --- a/vector_map_tiles_pmtiles/lib/src/themes/v3/white.dart +++ b/vector_map_tiles_pmtiles/lib/src/themes/v3/white.dart @@ -4,7 +4,7 @@ part of '_package.dart'; // ignore_for_file: prefer_single_quotes, require_trailing_commas /// https://docs.protomaps.com/basemaps/themes#white -const themeWhite = [ +const themeWhite = >[ { "id": "background", "type": "background", diff --git a/vector_map_tiles_pmtiles/lib/src/themes/v4/_package.dart b/vector_map_tiles_pmtiles/lib/src/themes/v4/_package.dart index e697c3c..7ff571d 100644 --- a/vector_map_tiles_pmtiles/lib/src/themes/v4/_package.dart +++ b/vector_map_tiles_pmtiles/lib/src/themes/v4/_package.dart @@ -1,8 +1,9 @@ -// Keep the original format. -// ignore_for_file: prefer_single_quotes, require_trailing_commas - part 'black.dart'; + part 'dark.dart'; + part 'grayscale.dart'; + part 'light.dart'; + part 'white.dart'; diff --git a/vector_map_tiles_pmtiles/lib/src/themes/v4/black.dart b/vector_map_tiles_pmtiles/lib/src/themes/v4/black.dart index 079be13..20be2a7 100644 --- a/vector_map_tiles_pmtiles/lib/src/themes/v4/black.dart +++ b/vector_map_tiles_pmtiles/lib/src/themes/v4/black.dart @@ -4,7 +4,7 @@ part of '_package.dart'; // ignore_for_file: prefer_single_quotes, require_trailing_commas /// https://docs.protomaps.com/basemaps/themes#black -const themeBlack = [ +const themeBlack = >[ { "id": "background", "type": "background", diff --git a/vector_map_tiles_pmtiles/lib/src/themes/v4/dark.dart b/vector_map_tiles_pmtiles/lib/src/themes/v4/dark.dart index 8330aea..2b6d437 100644 --- a/vector_map_tiles_pmtiles/lib/src/themes/v4/dark.dart +++ b/vector_map_tiles_pmtiles/lib/src/themes/v4/dark.dart @@ -4,7 +4,7 @@ part of '_package.dart'; // ignore_for_file: prefer_single_quotes, require_trailing_commas /// https://docs.protomaps.com/basemaps/themes#dark -const themeDark = [ +const themeDark = >[ { "id": "background", "type": "background", diff --git a/vector_map_tiles_pmtiles/lib/src/themes/v4/grayscale.dart b/vector_map_tiles_pmtiles/lib/src/themes/v4/grayscale.dart index badab34..9fc2613 100644 --- a/vector_map_tiles_pmtiles/lib/src/themes/v4/grayscale.dart +++ b/vector_map_tiles_pmtiles/lib/src/themes/v4/grayscale.dart @@ -4,7 +4,7 @@ part of '_package.dart'; // ignore_for_file: prefer_single_quotes, require_trailing_commas /// https://docs.protomaps.com/basemaps/themes#grayscale -const themeGrayscale = [ +const themeGrayscale = >[ { "id": "background", "type": "background", diff --git a/vector_map_tiles_pmtiles/lib/src/themes/v4/light.dart b/vector_map_tiles_pmtiles/lib/src/themes/v4/light.dart index 299f9c5..313839d 100644 --- a/vector_map_tiles_pmtiles/lib/src/themes/v4/light.dart +++ b/vector_map_tiles_pmtiles/lib/src/themes/v4/light.dart @@ -4,7 +4,7 @@ part of '_package.dart'; // ignore_for_file: prefer_single_quotes, require_trailing_commas /// https://docs.protomaps.com/basemaps/themes#light -const themeLight = [ +const themeLight = >[ { "id": "background", "type": "background", diff --git a/vector_map_tiles_pmtiles/lib/src/themes/v4/white.dart b/vector_map_tiles_pmtiles/lib/src/themes/v4/white.dart index 123ce4e..de4a60e 100644 --- a/vector_map_tiles_pmtiles/lib/src/themes/v4/white.dart +++ b/vector_map_tiles_pmtiles/lib/src/themes/v4/white.dart @@ -4,7 +4,7 @@ part of '_package.dart'; // ignore_for_file: prefer_single_quotes, require_trailing_commas /// https://docs.protomaps.com/basemaps/themes#white -const themeWhite = [ +const themeWhite = >[ { "id": "background", "type": "background", diff --git a/vector_map_tiles_pmtiles/pubspec.yaml b/vector_map_tiles_pmtiles/pubspec.yaml index 1a721f8..285d9c5 100644 --- a/vector_map_tiles_pmtiles/pubspec.yaml +++ b/vector_map_tiles_pmtiles/pubspec.yaml @@ -28,4 +28,4 @@ dev_dependencies: latlong2: ^0.9.0 mockito: ^5.4.4 test: ^1.24.9 - very_good_analysis: ^7.0.0 \ No newline at end of file + very_good_analysis: ^10.0.0 \ No newline at end of file