diff --git a/CHANGELOG.md b/CHANGELOG.md index 366c603c..fe8967d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,10 +10,19 @@ Many thanks to my sponsors, no matter how much or how little they donated. Spons * @eidolonFIRE * @weishuhn * @mohammedX6 -* and 3 anonymous or private donors +* @quentinchaignaud +* @Mayb3Nots +* @T-moz +* @micheljung +* \+ more anonymous or private donors # Changelog +## [9.1.0] - 2024/05/27 + +* Upgraded to flutter_map v7 to support Flutter 3.22 (also upgraded other dependencies) +* Deprecated `BaseRegion.toDrawable`, and all implementations + ## [9.0.1] - 2024/04/29 * Fixed bug on initialisation, where using multiple/background `FlutterEngine`s would attempt to re-open a single ObjectBox Store (aka. root) multiple times diff --git a/example/lib/screens/main/pages/region_selection/components/region_shape.dart b/example/lib/screens/main/pages/region_selection/components/region_shape.dart index 0caef237..770f8c4d 100644 --- a/example/lib/screens/main/pages/region_selection/components/region_shape.dart +++ b/example/lib/screens/main/pages/region_selection/components/region_shape.dart @@ -87,7 +87,6 @@ class RegionShape extends StatelessWidget { const LatLng(-90, -180), ], holePointsList: [holePoints], - isFilled: true, borderColor: Colors.black, borderStrokeWidth: 2, color: Theme.of(context).colorScheme.surface.withOpacity(0.5), diff --git a/example/lib/screens/main/pages/region_selection/region_selection.dart b/example/lib/screens/main/pages/region_selection/region_selection.dart index 9e4ad313..e11b9eca 100644 --- a/example/lib/screens/main/pages/region_selection/region_selection.dart +++ b/example/lib/screens/main/pages/region_selection/region_selection.dart @@ -117,7 +117,7 @@ class _RegionSelectionPageState extends State { if (provider.regionSelectionMethod == RegionSelectionMethod.useMapCenter) { - provider.currentNewPointPos = position.center!; + provider.currentNewPointPos = position.center; if (provider.regionType == RegionType.customPolygon) { final coords = provider.coordinates; diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 07e902db..83ed8b6d 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -3,7 +3,7 @@ description: The example application for 'flutter_map_tile_caching', showcasing it's functionality and use-cases. publish_to: "none" -version: 9.0.1 +version: 9.1.0 environment: sdk: ">=3.3.0 <4.0.0" @@ -18,8 +18,8 @@ dependencies: file_picker: ^8.0.3 flutter: sdk: flutter - flutter_map: ^6.1.0 - flutter_map_animations: ^0.6.0 + flutter_map: ^7.0.0 + flutter_map_animations: ^0.7.0 flutter_map_tile_caching: google_fonts: ^6.2.1 gpx: ^2.2.2 diff --git a/lib/src/regions/base_region.dart b/lib/src/regions/base_region.dart index 9b293fad..88841e90 100644 --- a/lib/src/regions/base_region.dart +++ b/lib/src/regions/base_region.dart @@ -7,7 +7,6 @@ part of '../../flutter_map_tile_caching.dart'; /// /// It can be converted to a: /// - [DownloadableRegion] for downloading: [toDownloadable] -/// - [Widget] layer to be placed in a map: [toDrawable] /// - list of [LatLng]s forming the outline: [toOutline] /// /// Extended/implemented by: @@ -21,7 +20,6 @@ sealed class BaseRegion { /// /// It can be converted to a: /// - [DownloadableRegion] for downloading: [toDownloadable] - /// - [Widget] layer to be placed in a map: [toDrawable] /// - list of [LatLng]s forming the outline: [toOutline] /// /// Extended/implemented by: @@ -58,6 +56,22 @@ sealed class BaseRegion { }); /// Generate a graphical layer to be placed in a [FlutterMap] + /// + /// **Deprecated.** Instead obtain the outline/line/points using other methods, + /// and render the layer manually. This method is being removed to reduce + /// dependency on flutter_map, and allow full usage of flutter_map + /// functionality without it needing to be semi-implemented here. This feature + /// was deprecated after v9.1.0, and will be removed in the next breaking/major + /// release. + @Deprecated( + 'Instead obtain the outline/line/points using other methods, and render the ' + 'layer manually. ' + 'This method is being removed to reduce dependency on flutter_map, and allow ' + 'full usage of flutter_map functionality without it needing to be ' + 'semi-implemented here. ' + 'This feature was deprecated after v9.1.0, and will be removed in the next ' + 'breaking/major release.', + ) Widget toDrawable({ Color? fillColor, Color borderColor = const Color(0x00000000), diff --git a/lib/src/regions/circle.dart b/lib/src/regions/circle.dart index ec94b8d1..4b6b8b47 100644 --- a/lib/src/regions/circle.dart +++ b/lib/src/regions/circle.dart @@ -7,14 +7,12 @@ part of '../../flutter_map_tile_caching.dart'; /// /// It can be converted to a: /// - [DownloadableRegion] for downloading: [toDownloadable] -/// - [Widget] layer to be placed in a map: [toDrawable] /// - list of [LatLng]s forming the outline: [toOutline] class CircleRegion extends BaseRegion { /// A geographically circular region based off a [center] coord and [radius] /// /// It can be converted to a: /// - [DownloadableRegion] for downloading: [toDownloadable] - /// - [Widget] layer to be placed in a map: [toDrawable] /// - list of [LatLng]s forming the outline: [toOutline] const CircleRegion(this.center, this.radius); @@ -43,6 +41,21 @@ class CircleRegion extends BaseRegion { crs: crs, ); + /// **Deprecated.** Instead obtain the outline/line/points using other methods, + /// and render the layer manually. This method is being removed to reduce + /// dependency on flutter_map, and allow full usage of flutter_map + /// functionality without it needing to be semi-implemented here. This feature + /// was deprecated after v9.1.0, and will be removed in the next breaking/major + /// release. + @Deprecated( + 'Instead obtain the outline/line/points using other methods, and render the ' + 'layer manually. ' + 'This method is being removed to reduce dependency on flutter_map, and allow ' + 'full usage of flutter_map functionality without it needing to be ' + 'semi-implemented here. ' + 'This feature was deprecated after v9.1.0, and will be removed in the next ' + 'breaking/major release.', + ) @override PolygonLayer toDrawable({ Color? fillColor, @@ -57,11 +70,12 @@ class CircleRegion extends BaseRegion { polygons: [ Polygon( points: toOutline().toList(), - isFilled: fillColor != null, - color: fillColor ?? Colors.transparent, + color: fillColor, borderColor: borderColor, borderStrokeWidth: borderStrokeWidth, - isDotted: isDotted, + pattern: isDotted + ? const StrokePattern.dotted() + : const StrokePattern.solid(), label: label, labelStyle: labelStyle, labelPlacement: labelPlacement, diff --git a/lib/src/regions/custom_polygon.dart b/lib/src/regions/custom_polygon.dart index 3f88324a..319d24d3 100644 --- a/lib/src/regions/custom_polygon.dart +++ b/lib/src/regions/custom_polygon.dart @@ -7,14 +7,12 @@ part of '../../flutter_map_tile_caching.dart'; /// /// It can be converted to a: /// - [DownloadableRegion] for downloading: [toDownloadable] -/// - [Widget] layer to be placed in a map: [toDrawable] /// - list of [LatLng]s forming the outline: [toOutline] class CustomPolygonRegion extends BaseRegion { /// A geographical region who's outline is defined by a list of coordinates /// /// It can be converted to a: /// - [DownloadableRegion] for downloading: [toDownloadable] - /// - [Widget] layer to be placed in a map: [toDrawable] /// - list of [LatLng]s forming the outline: [toOutline] const CustomPolygonRegion(this.outline); @@ -40,6 +38,21 @@ class CustomPolygonRegion extends BaseRegion { crs: crs, ); + /// **Deprecated.** Instead obtain the outline/line/points using other methods, + /// and render the layer manually. This method is being removed to reduce + /// dependency on flutter_map, and allow full usage of flutter_map + /// functionality without it needing to be semi-implemented here. This feature + /// was deprecated after v9.1.0, and will be removed in the next breaking/major + /// release. + @Deprecated( + 'Instead obtain the outline/line/points using other methods, and render the ' + 'layer manually. ' + 'This method is being removed to reduce dependency on flutter_map, and allow ' + 'full usage of flutter_map functionality without it needing to be ' + 'semi-implemented here. ' + 'This feature was deprecated after v9.1.0, and will be removed in the next ' + 'breaking/major release.', + ) @override PolygonLayer toDrawable({ Color? fillColor, @@ -54,11 +67,12 @@ class CustomPolygonRegion extends BaseRegion { polygons: [ Polygon( points: outline, - isFilled: fillColor != null, - color: fillColor ?? Colors.transparent, + color: fillColor, borderColor: borderColor, borderStrokeWidth: borderStrokeWidth, - isDotted: isDotted, + pattern: isDotted + ? const StrokePattern.dotted() + : const StrokePattern.solid(), label: label, labelStyle: labelStyle, labelPlacement: labelPlacement, diff --git a/lib/src/regions/line.dart b/lib/src/regions/line.dart index 467549eb..e498ebe4 100644 --- a/lib/src/regions/line.dart +++ b/lib/src/regions/line.dart @@ -7,14 +7,12 @@ part of '../../flutter_map_tile_caching.dart'; /// /// It can be converted to a: /// - [DownloadableRegion] for downloading: [toDownloadable] -/// - [Widget] layer to be placed in a map: [toDrawable] /// - list of [LatLng]s forming the outline: [LineRegion.toOutlines] class LineRegion extends BaseRegion { /// A geographically line/locus region based off a list of coords and a [radius] /// /// It can be converted to a: /// - [DownloadableRegion] for downloading: [toDownloadable] - /// - [Widget] layer to be placed in a map: [toDrawable] /// - list of [LatLng]s forming the outline: [LineRegion.toOutlines] const LineRegion(this.line, this.radius); @@ -91,6 +89,25 @@ class LineRegion extends BaseRegion { crs: crs, ); + /// **Deprecated.** Instead obtain the outline/line/points using other methods, + /// and render the layer manually. This method is being removed to reduce + /// dependency on flutter_map, and allow full usage of flutter_map + /// functionality without it needing to be semi-implemented here. This feature + /// was deprecated after v9.1.0, and will be removed in the next breaking/major + /// release. + /// + /// If `prettyPaint` was `true`, render a `Polyline` based on [line] and + /// [radius]. Otherwise, render multiple `Polygons` based on the result of + /// `toOutlines(1)`. + @Deprecated( + 'Instead obtain the outline/line/points using other methods, and render the ' + 'layer manually. ' + 'This method is being removed to reduce dependency on flutter_map, and allow ' + 'full usage of flutter_map functionality without it needing to be ' + 'semi-implemented here. ' + 'This feature was deprecated after v9.1.0, and will be removed in the next ' + 'breaking/major release.', + ) @override Widget toDrawable({ Color? fillColor, @@ -113,7 +130,9 @@ class LineRegion extends BaseRegion { color: fillColor ?? const Color(0x00000000), borderColor: borderColor ?? const Color(0x00000000), borderStrokeWidth: borderStrokeWidth, - isDotted: isDotted, + pattern: isDotted + ? const StrokePattern.dotted() + : const StrokePattern.solid(), gradientColors: gradientColors, colorsStop: colorsStop, strokeCap: strokeCap, @@ -126,11 +145,12 @@ class LineRegion extends BaseRegion { .map( (rect) => Polygon( points: rect, - isFilled: fillColor != null, - color: fillColor ?? Colors.transparent, + color: fillColor, borderColor: borderColor ?? const Color(0x00000000), borderStrokeWidth: borderStrokeWidth, - isDotted: isDotted, + pattern: isDotted + ? const StrokePattern.dotted() + : const StrokePattern.solid(), strokeCap: strokeCap, strokeJoin: strokeJoin, ), diff --git a/lib/src/regions/rectangle.dart b/lib/src/regions/rectangle.dart index 62a0bf0c..957cff6f 100644 --- a/lib/src/regions/rectangle.dart +++ b/lib/src/regions/rectangle.dart @@ -9,14 +9,12 @@ part of '../../flutter_map_tile_caching.dart'; /// /// It can be converted to a: /// - [DownloadableRegion] for downloading: [toDownloadable] -/// - [Widget] layer to be placed in a map: [toDrawable] /// - list of [LatLng]s forming the outline: [toOutline] class RectangleRegion extends BaseRegion { /// A geographically rectangular region based off coordinate bounds /// /// It can be converted to a: /// - [DownloadableRegion] for downloading: [toDownloadable] - /// - [Widget] layer to be placed in a map: [toDrawable] /// - list of [LatLng]s forming the outline: [toOutline] const RectangleRegion(this.bounds); @@ -42,6 +40,21 @@ class RectangleRegion extends BaseRegion { crs: crs, ); + /// **Deprecated.** Instead obtain the outline/line/points using other methods, + /// and render the layer manually. This method is being removed to reduce + /// dependency on flutter_map, and allow full usage of flutter_map + /// functionality without it needing to be semi-implemented here. This feature + /// was deprecated after v9.1.0, and will be removed in the next breaking/major + /// release. + @Deprecated( + 'Instead obtain the outline/line/points using other methods, and render the ' + 'layer manually. ' + 'This method is being removed to reduce dependency on flutter_map, and allow ' + 'full usage of flutter_map functionality without it needing to be ' + 'semi-implemented here. ' + 'This feature was deprecated after v9.1.0, and will be removed in the next ' + 'breaking/major release.', + ) @override PolygonLayer toDrawable({ Color? fillColor, @@ -55,11 +68,12 @@ class RectangleRegion extends BaseRegion { PolygonLayer( polygons: [ Polygon( - isFilled: fillColor != null, - color: fillColor ?? Colors.transparent, + color: fillColor, borderColor: borderColor, borderStrokeWidth: borderStrokeWidth, - isDotted: isDotted, + pattern: isDotted + ? const StrokePattern.dotted() + : const StrokePattern.solid(), label: label, labelStyle: labelStyle, labelPlacement: labelPlacement, diff --git a/pubspec.yaml b/pubspec.yaml index c5dcaf69..60da76b6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: flutter_map_tile_caching description: Plugin for 'flutter_map' providing advanced caching functionality, with ability to download map regions for offline use. -version: 9.0.1 +version: 9.1.0 repository: https://github.com/JaffaKetchup/flutter_map_tile_caching issue_tracker: https://github.com/JaffaKetchup/flutter_map_tile_caching/issues @@ -33,19 +33,19 @@ dependencies: flat_buffers: ^23.5.26 flutter: sdk: flutter - flutter_map: ^6.1.0 + flutter_map: ^7.0.0 http: ^1.2.1 latlong2: ^0.9.1 - meta: ^1.11.0 - objectbox: ^2.5.1 - objectbox_flutter_libs: ^2.5.1 + meta: ^1.12.0 + objectbox: ^4.0.1 + objectbox_flutter_libs: ^4.0.1 path: ^1.9.0 path_provider: ^2.1.3 dev_dependencies: - build_runner: ^2.4.9 - objectbox_generator: ^2.5.1 - test: ^1.25.2 + build_runner: ^2.4.0 + objectbox_generator: ^4.0.1 + test: ^1.25.0 flutter: null diff --git a/windowsApplicationInstallerSetup.iss b/windowsApplicationInstallerSetup.iss index f4e68140..72c9778f 100644 --- a/windowsApplicationInstallerSetup.iss +++ b/windowsApplicationInstallerSetup.iss @@ -1,7 +1,7 @@ ; Script generated by the Inno Setup Script Wizard #define MyAppName "FMTC Demo" -#define MyAppVersion "for 9.0.1" +#define MyAppVersion "for 9.1.0" #define MyAppPublisher "JaffaKetchup Development" #define MyAppURL "https://github.com/JaffaKetchup/flutter_map_tile_caching" #define MyAppSupportURL "https://github.com/JaffaKetchup/flutter_map_tile_caching/issues"