Skip to content

Commit 5a2b88d

Browse files
authored
v9.1.0: support flutter_map v7 & Flutter 3.22 (#157)
1 parent dfee86c commit 5a2b88d

File tree

11 files changed

+122
-38
lines changed

11 files changed

+122
-38
lines changed

CHANGELOG.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,19 @@ Many thanks to my sponsors, no matter how much or how little they donated. Spons
1010
* @eidolonFIRE
1111
* @weishuhn
1212
* @mohammedX6
13-
* and 3 anonymous or private donors
13+
* @quentinchaignaud
14+
* @Mayb3Nots
15+
* @T-moz
16+
* @micheljung
17+
* \+ more anonymous or private donors
1418

1519
# Changelog
1620

21+
## [9.1.0] - 2024/05/27
22+
23+
* Upgraded to flutter_map v7 to support Flutter 3.22 (also upgraded other dependencies)
24+
* Deprecated `BaseRegion.toDrawable`, and all implementations
25+
1726
## [9.0.1] - 2024/04/29
1827

1928
* Fixed bug on initialisation, where using multiple/background `FlutterEngine`s would attempt to re-open a single ObjectBox Store (aka. root) multiple times

example/lib/screens/main/pages/region_selection/components/region_shape.dart

-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ class RegionShape extends StatelessWidget {
8787
const LatLng(-90, -180),
8888
],
8989
holePointsList: [holePoints],
90-
isFilled: true,
9190
borderColor: Colors.black,
9291
borderStrokeWidth: 2,
9392
color: Theme.of(context).colorScheme.surface.withOpacity(0.5),

example/lib/screens/main/pages/region_selection/region_selection.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class _RegionSelectionPageState extends State<RegionSelectionPage> {
117117

118118
if (provider.regionSelectionMethod ==
119119
RegionSelectionMethod.useMapCenter) {
120-
provider.currentNewPointPos = position.center!;
120+
provider.currentNewPointPos = position.center;
121121

122122
if (provider.regionType == RegionType.customPolygon) {
123123
final coords = provider.coordinates;

example/pubspec.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: The example application for 'flutter_map_tile_caching', showcasing
33
it's functionality and use-cases.
44
publish_to: "none"
55

6-
version: 9.0.1
6+
version: 9.1.0
77

88
environment:
99
sdk: ">=3.3.0 <4.0.0"
@@ -18,8 +18,8 @@ dependencies:
1818
file_picker: ^8.0.3
1919
flutter:
2020
sdk: flutter
21-
flutter_map: ^6.1.0
22-
flutter_map_animations: ^0.6.0
21+
flutter_map: ^7.0.0
22+
flutter_map_animations: ^0.7.0
2323
flutter_map_tile_caching:
2424
google_fonts: ^6.2.1
2525
gpx: ^2.2.2

lib/src/regions/base_region.dart

+16-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ part of '../../flutter_map_tile_caching.dart';
77
///
88
/// It can be converted to a:
99
/// - [DownloadableRegion] for downloading: [toDownloadable]
10-
/// - [Widget] layer to be placed in a map: [toDrawable]
1110
/// - list of [LatLng]s forming the outline: [toOutline]
1211
///
1312
/// Extended/implemented by:
@@ -21,7 +20,6 @@ sealed class BaseRegion {
2120
///
2221
/// It can be converted to a:
2322
/// - [DownloadableRegion] for downloading: [toDownloadable]
24-
/// - [Widget] layer to be placed in a map: [toDrawable]
2523
/// - list of [LatLng]s forming the outline: [toOutline]
2624
///
2725
/// Extended/implemented by:
@@ -58,6 +56,22 @@ sealed class BaseRegion {
5856
});
5957

6058
/// Generate a graphical layer to be placed in a [FlutterMap]
59+
///
60+
/// **Deprecated.** Instead obtain the outline/line/points using other methods,
61+
/// and render the layer manually. This method is being removed to reduce
62+
/// dependency on flutter_map, and allow full usage of flutter_map
63+
/// functionality without it needing to be semi-implemented here. This feature
64+
/// was deprecated after v9.1.0, and will be removed in the next breaking/major
65+
/// release.
66+
@Deprecated(
67+
'Instead obtain the outline/line/points using other methods, and render the '
68+
'layer manually. '
69+
'This method is being removed to reduce dependency on flutter_map, and allow '
70+
'full usage of flutter_map functionality without it needing to be '
71+
'semi-implemented here. '
72+
'This feature was deprecated after v9.1.0, and will be removed in the next '
73+
'breaking/major release.',
74+
)
6175
Widget toDrawable({
6276
Color? fillColor,
6377
Color borderColor = const Color(0x00000000),

lib/src/regions/circle.dart

+19-5
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ part of '../../flutter_map_tile_caching.dart';
77
///
88
/// It can be converted to a:
99
/// - [DownloadableRegion] for downloading: [toDownloadable]
10-
/// - [Widget] layer to be placed in a map: [toDrawable]
1110
/// - list of [LatLng]s forming the outline: [toOutline]
1211
class CircleRegion extends BaseRegion {
1312
/// A geographically circular region based off a [center] coord and [radius]
1413
///
1514
/// It can be converted to a:
1615
/// - [DownloadableRegion] for downloading: [toDownloadable]
17-
/// - [Widget] layer to be placed in a map: [toDrawable]
1816
/// - list of [LatLng]s forming the outline: [toOutline]
1917
const CircleRegion(this.center, this.radius);
2018

@@ -43,6 +41,21 @@ class CircleRegion extends BaseRegion {
4341
crs: crs,
4442
);
4543

44+
/// **Deprecated.** Instead obtain the outline/line/points using other methods,
45+
/// and render the layer manually. This method is being removed to reduce
46+
/// dependency on flutter_map, and allow full usage of flutter_map
47+
/// functionality without it needing to be semi-implemented here. This feature
48+
/// was deprecated after v9.1.0, and will be removed in the next breaking/major
49+
/// release.
50+
@Deprecated(
51+
'Instead obtain the outline/line/points using other methods, and render the '
52+
'layer manually. '
53+
'This method is being removed to reduce dependency on flutter_map, and allow '
54+
'full usage of flutter_map functionality without it needing to be '
55+
'semi-implemented here. '
56+
'This feature was deprecated after v9.1.0, and will be removed in the next '
57+
'breaking/major release.',
58+
)
4659
@override
4760
PolygonLayer toDrawable({
4861
Color? fillColor,
@@ -57,11 +70,12 @@ class CircleRegion extends BaseRegion {
5770
polygons: [
5871
Polygon(
5972
points: toOutline().toList(),
60-
isFilled: fillColor != null,
61-
color: fillColor ?? Colors.transparent,
73+
color: fillColor,
6274
borderColor: borderColor,
6375
borderStrokeWidth: borderStrokeWidth,
64-
isDotted: isDotted,
76+
pattern: isDotted
77+
? const StrokePattern.dotted()
78+
: const StrokePattern.solid(),
6579
label: label,
6680
labelStyle: labelStyle,
6781
labelPlacement: labelPlacement,

lib/src/regions/custom_polygon.dart

+19-5
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ part of '../../flutter_map_tile_caching.dart';
77
///
88
/// It can be converted to a:
99
/// - [DownloadableRegion] for downloading: [toDownloadable]
10-
/// - [Widget] layer to be placed in a map: [toDrawable]
1110
/// - list of [LatLng]s forming the outline: [toOutline]
1211
class CustomPolygonRegion extends BaseRegion {
1312
/// A geographical region who's outline is defined by a list of coordinates
1413
///
1514
/// It can be converted to a:
1615
/// - [DownloadableRegion] for downloading: [toDownloadable]
17-
/// - [Widget] layer to be placed in a map: [toDrawable]
1816
/// - list of [LatLng]s forming the outline: [toOutline]
1917
const CustomPolygonRegion(this.outline);
2018

@@ -40,6 +38,21 @@ class CustomPolygonRegion extends BaseRegion {
4038
crs: crs,
4139
);
4240

41+
/// **Deprecated.** Instead obtain the outline/line/points using other methods,
42+
/// and render the layer manually. This method is being removed to reduce
43+
/// dependency on flutter_map, and allow full usage of flutter_map
44+
/// functionality without it needing to be semi-implemented here. This feature
45+
/// was deprecated after v9.1.0, and will be removed in the next breaking/major
46+
/// release.
47+
@Deprecated(
48+
'Instead obtain the outline/line/points using other methods, and render the '
49+
'layer manually. '
50+
'This method is being removed to reduce dependency on flutter_map, and allow '
51+
'full usage of flutter_map functionality without it needing to be '
52+
'semi-implemented here. '
53+
'This feature was deprecated after v9.1.0, and will be removed in the next '
54+
'breaking/major release.',
55+
)
4356
@override
4457
PolygonLayer toDrawable({
4558
Color? fillColor,
@@ -54,11 +67,12 @@ class CustomPolygonRegion extends BaseRegion {
5467
polygons: [
5568
Polygon(
5669
points: outline,
57-
isFilled: fillColor != null,
58-
color: fillColor ?? Colors.transparent,
70+
color: fillColor,
5971
borderColor: borderColor,
6072
borderStrokeWidth: borderStrokeWidth,
61-
isDotted: isDotted,
73+
pattern: isDotted
74+
? const StrokePattern.dotted()
75+
: const StrokePattern.solid(),
6276
label: label,
6377
labelStyle: labelStyle,
6478
labelPlacement: labelPlacement,

lib/src/regions/line.dart

+26-6
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ part of '../../flutter_map_tile_caching.dart';
77
///
88
/// It can be converted to a:
99
/// - [DownloadableRegion] for downloading: [toDownloadable]
10-
/// - [Widget] layer to be placed in a map: [toDrawable]
1110
/// - list of [LatLng]s forming the outline: [LineRegion.toOutlines]
1211
class LineRegion extends BaseRegion {
1312
/// A geographically line/locus region based off a list of coords and a [radius]
1413
///
1514
/// It can be converted to a:
1615
/// - [DownloadableRegion] for downloading: [toDownloadable]
17-
/// - [Widget] layer to be placed in a map: [toDrawable]
1816
/// - list of [LatLng]s forming the outline: [LineRegion.toOutlines]
1917
const LineRegion(this.line, this.radius);
2018

@@ -91,6 +89,25 @@ class LineRegion extends BaseRegion {
9189
crs: crs,
9290
);
9391

92+
/// **Deprecated.** Instead obtain the outline/line/points using other methods,
93+
/// and render the layer manually. This method is being removed to reduce
94+
/// dependency on flutter_map, and allow full usage of flutter_map
95+
/// functionality without it needing to be semi-implemented here. This feature
96+
/// was deprecated after v9.1.0, and will be removed in the next breaking/major
97+
/// release.
98+
///
99+
/// If `prettyPaint` was `true`, render a `Polyline` based on [line] and
100+
/// [radius]. Otherwise, render multiple `Polygons` based on the result of
101+
/// `toOutlines(1)`.
102+
@Deprecated(
103+
'Instead obtain the outline/line/points using other methods, and render the '
104+
'layer manually. '
105+
'This method is being removed to reduce dependency on flutter_map, and allow '
106+
'full usage of flutter_map functionality without it needing to be '
107+
'semi-implemented here. '
108+
'This feature was deprecated after v9.1.0, and will be removed in the next '
109+
'breaking/major release.',
110+
)
94111
@override
95112
Widget toDrawable({
96113
Color? fillColor,
@@ -113,7 +130,9 @@ class LineRegion extends BaseRegion {
113130
color: fillColor ?? const Color(0x00000000),
114131
borderColor: borderColor ?? const Color(0x00000000),
115132
borderStrokeWidth: borderStrokeWidth,
116-
isDotted: isDotted,
133+
pattern: isDotted
134+
? const StrokePattern.dotted()
135+
: const StrokePattern.solid(),
117136
gradientColors: gradientColors,
118137
colorsStop: colorsStop,
119138
strokeCap: strokeCap,
@@ -126,11 +145,12 @@ class LineRegion extends BaseRegion {
126145
.map(
127146
(rect) => Polygon(
128147
points: rect,
129-
isFilled: fillColor != null,
130-
color: fillColor ?? Colors.transparent,
148+
color: fillColor,
131149
borderColor: borderColor ?? const Color(0x00000000),
132150
borderStrokeWidth: borderStrokeWidth,
133-
isDotted: isDotted,
151+
pattern: isDotted
152+
? const StrokePattern.dotted()
153+
: const StrokePattern.solid(),
134154
strokeCap: strokeCap,
135155
strokeJoin: strokeJoin,
136156
),

lib/src/regions/rectangle.dart

+19-5
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@ part of '../../flutter_map_tile_caching.dart';
99
///
1010
/// It can be converted to a:
1111
/// - [DownloadableRegion] for downloading: [toDownloadable]
12-
/// - [Widget] layer to be placed in a map: [toDrawable]
1312
/// - list of [LatLng]s forming the outline: [toOutline]
1413
class RectangleRegion extends BaseRegion {
1514
/// A geographically rectangular region based off coordinate bounds
1615
///
1716
/// It can be converted to a:
1817
/// - [DownloadableRegion] for downloading: [toDownloadable]
19-
/// - [Widget] layer to be placed in a map: [toDrawable]
2018
/// - list of [LatLng]s forming the outline: [toOutline]
2119
const RectangleRegion(this.bounds);
2220

@@ -42,6 +40,21 @@ class RectangleRegion extends BaseRegion {
4240
crs: crs,
4341
);
4442

43+
/// **Deprecated.** Instead obtain the outline/line/points using other methods,
44+
/// and render the layer manually. This method is being removed to reduce
45+
/// dependency on flutter_map, and allow full usage of flutter_map
46+
/// functionality without it needing to be semi-implemented here. This feature
47+
/// was deprecated after v9.1.0, and will be removed in the next breaking/major
48+
/// release.
49+
@Deprecated(
50+
'Instead obtain the outline/line/points using other methods, and render the '
51+
'layer manually. '
52+
'This method is being removed to reduce dependency on flutter_map, and allow '
53+
'full usage of flutter_map functionality without it needing to be '
54+
'semi-implemented here. '
55+
'This feature was deprecated after v9.1.0, and will be removed in the next '
56+
'breaking/major release.',
57+
)
4558
@override
4659
PolygonLayer toDrawable({
4760
Color? fillColor,
@@ -55,11 +68,12 @@ class RectangleRegion extends BaseRegion {
5568
PolygonLayer(
5669
polygons: [
5770
Polygon(
58-
isFilled: fillColor != null,
59-
color: fillColor ?? Colors.transparent,
71+
color: fillColor,
6072
borderColor: borderColor,
6173
borderStrokeWidth: borderStrokeWidth,
62-
isDotted: isDotted,
74+
pattern: isDotted
75+
? const StrokePattern.dotted()
76+
: const StrokePattern.solid(),
6377
label: label,
6478
labelStyle: labelStyle,
6579
labelPlacement: labelPlacement,

pubspec.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: flutter_map_tile_caching
22
description: Plugin for 'flutter_map' providing advanced caching functionality,
33
with ability to download map regions for offline use.
4-
version: 9.0.1
4+
version: 9.1.0
55

66
repository: https://github.com/JaffaKetchup/flutter_map_tile_caching
77
issue_tracker: https://github.com/JaffaKetchup/flutter_map_tile_caching/issues
@@ -33,19 +33,19 @@ dependencies:
3333
flat_buffers: ^23.5.26
3434
flutter:
3535
sdk: flutter
36-
flutter_map: ^6.1.0
36+
flutter_map: ^7.0.0
3737
http: ^1.2.1
3838
latlong2: ^0.9.1
39-
meta: ^1.11.0
40-
objectbox: ^2.5.1
41-
objectbox_flutter_libs: ^2.5.1
39+
meta: ^1.12.0
40+
objectbox: ^4.0.1
41+
objectbox_flutter_libs: ^4.0.1
4242
path: ^1.9.0
4343
path_provider: ^2.1.3
4444

4545
dev_dependencies:
46-
build_runner: ^2.4.9
47-
objectbox_generator: ^2.5.1
48-
test: ^1.25.2
46+
build_runner: ^2.4.0
47+
objectbox_generator: ^4.0.1
48+
test: ^1.25.0
4949

5050
flutter: null
5151

windowsApplicationInstallerSetup.iss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; Script generated by the Inno Setup Script Wizard
22

33
#define MyAppName "FMTC Demo"
4-
#define MyAppVersion "for 9.0.1"
4+
#define MyAppVersion "for 9.1.0"
55
#define MyAppPublisher "JaffaKetchup Development"
66
#define MyAppURL "https://github.com/JaffaKetchup/flutter_map_tile_caching"
77
#define MyAppSupportURL "https://github.com/JaffaKetchup/flutter_map_tile_caching/issues"

0 commit comments

Comments
 (0)