Skip to content

Commit 59231f9

Browse files
authored
multi: add platform directory, add MapScalebar params, add more tests (#128)
- use 3.24.0 in matrix ci workflows - add more tests - move `web` to `platform/web` - move `native` to `platform/android` - always use black color for event logs on event example page - rename CI `[Android] Unit tests` to `Unit tests` - remove cached hashCodes from annotation layers as they where not used - add `MapScalebar´ parameters for padding and alignment
1 parent 472dd42 commit 59231f9

File tree

234 files changed

+617
-219
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

234 files changed

+617
-219
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ jobs:
6363
# cache: true
6464
# - run: flutter pub get
6565
# - run: flutter test integration_test --no-pub -r expanded
66-
unit-test-android:
67-
name: "[Android] Unit tests"
66+
unit-test:
67+
name: "Unit tests"
6868
runs-on: ubuntu-latest
6969
strategy:
7070
fail-fast: false
7171
matrix:
72-
sdk: [ '3.24.3', '' ]
72+
sdk: [ '3.24.0', '' ]
7373
timeout-minutes: 30
7474
steps:
7575
- uses: actions/checkout@v4
@@ -174,7 +174,7 @@ jobs:
174174
strategy:
175175
fail-fast: false
176176
matrix:
177-
sdk: [ '3.24.3', '' ]
177+
sdk: [ '3.24.0', '' ]
178178
steps:
179179
- uses: actions/checkout@v4
180180
- uses: subosito/flutter-action@v2
@@ -206,7 +206,7 @@ jobs:
206206
# strategy:
207207
# fail-fast: false
208208
# matrix:
209-
# sdk: [ '3.24.3', '' ]
209+
# sdk: [ '3.24.0', '' ]
210210
# steps:
211211
# - uses: actions/checkout@v4
212212
# - uses: subosito/flutter-action@v2
@@ -235,7 +235,7 @@ jobs:
235235
strategy:
236236
fail-fast: false
237237
matrix:
238-
sdk: [ '3.24.3', '' ]
238+
sdk: [ '3.24.0', '' ]
239239
steps:
240240
- uses: actions/checkout@v4
241241
- uses: subosito/flutter-action@v2
@@ -255,7 +255,7 @@ jobs:
255255
strategy:
256256
fail-fast: false
257257
matrix:
258-
sdk: [ '3.24.3', '' ]
258+
sdk: [ '3.24.0', '' ]
259259
steps:
260260
- uses: actions/checkout@v4
261261
- uses: subosito/flutter-action@v2

codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ comment:
99

1010
ignore:
1111
- "**/*.g.dart"
12-
- "lib/src/native/jni"
12+
- "lib/src/platform/android/jni"
1313
- "example"

docs/docs/getting-started/setup-android.md

Lines changed: 33 additions & 1 deletion

docs/versioned_docs/version-0.1.x/getting-started/setup-android.md

Lines changed: 3 additions & 4 deletions

example/lib/events_page.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ class _EventsPageState extends State<EventsPage> {
2828
child: Container(
2929
padding: const EdgeInsets.all(8),
3030
alignment: Alignment.bottomLeft,
31-
child: Text(_eventMessages.join('\n')),
31+
child: Text(
32+
_eventMessages.join('\n'),
33+
style: const TextStyle(color: Colors.black),
34+
),
3235
),
3336
),
3437
],

lib/maplibre.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export 'src/map_controller.dart';
1111
export 'src/map_events.dart';
1212
export 'src/map_gestures.dart';
1313
export 'src/map_options.dart';
14+
export 'src/offline/download_progress.dart';
1415
export 'src/offline/offline_manager.dart';
1516
export 'src/offline/offline_region.dart';
1617
export 'src/permission_manager.dart';

lib/src/annotation/circle_annotation_layer.dart

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ part of 'annotation_layer.dart';
44
@immutable
55
class CircleAnnotationLayer extends AnnotationLayer<Point> {
66
/// Create a new [CircleAnnotationLayer] instance.
7-
// ignore: prefer_const_constructors_in_immutables
8-
CircleAnnotationLayer({
7+
const CircleAnnotationLayer({
98
required List<Point> points,
109
this.radius = 5,
1110
this.color = const Color(0xFF000000),
@@ -70,10 +69,8 @@ class CircleAnnotationLayer extends AnnotationLayer<Point> {
7069
strokeWidth == other.strokeWidth &&
7170
strokeColor == other.strokeColor;
7271

73-
late final int? _cachedHashCode;
74-
7572
@override
76-
int get hashCode => _cachedHashCode ??= Object.hash(
73+
int get hashCode => Object.hash(
7774
super.hashCode,
7875
radius,
7976
color,

lib/src/annotation/marker_annotation_layer.dart

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ part of 'annotation_layer.dart';
44
@immutable
55
class MarkerAnnotationLayer extends AnnotationLayer<Point> {
66
/// Create a new [MarkerAnnotationLayer] instance.
7-
// ignore: prefer_const_constructors_in_immutables
8-
MarkerAnnotationLayer({
7+
const MarkerAnnotationLayer({
98
required List<Point> points,
109
this.iconAllowOverlap = false,
1110
this.iconIgnorePlacement = false,
@@ -281,10 +280,8 @@ class MarkerAnnotationLayer extends AnnotationLayer<Point> {
281280
textTranslate == other.textTranslate &&
282281
iconAnchor == other.iconAnchor;
283282

284-
late final int? _cachedHashCode;
285-
286283
@override
287-
int get hashCode => _cachedHashCode ??= Object.hashAll([
284+
int get hashCode => Object.hashAll([
288285
super.hashCode,
289286
iconAllowOverlap,
290287
iconIgnorePlacement,

lib/src/annotation/polygon_annotation_layer.dart

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ part of 'annotation_layer.dart';
44
@immutable
55
class PolygonAnnotationLayer extends AnnotationLayer<Polygon> {
66
/// Create a new [PolygonAnnotationLayer] instance.
7-
// ignore: prefer_const_constructors_in_immutables
8-
PolygonAnnotationLayer({
7+
const PolygonAnnotationLayer({
98
required List<Polygon> polygons,
109
this.color = const Color(0xFF000000),
1110
this.outlineColor = const Color(0xFF000000),
@@ -47,9 +46,6 @@ class PolygonAnnotationLayer extends AnnotationLayer<Polygon> {
4746
color == other.color &&
4847
outlineColor == other.outlineColor;
4948

50-
late final int? _cachedHashCode;
51-
5249
@override
53-
int get hashCode =>
54-
_cachedHashCode ??= Object.hash(super.hashCode, color, outlineColor);
50+
int get hashCode => Object.hash(super.hashCode, color, outlineColor);
5551
}

lib/src/annotation/polyline_annotation_layer.dart

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ part of 'annotation_layer.dart';
44
@immutable
55
class PolylineAnnotationLayer extends AnnotationLayer<LineString> {
66
/// Create a new [PolylineAnnotationLayer] instance.
7-
// ignore: prefer_const_constructors_in_immutables
8-
PolylineAnnotationLayer({
7+
const PolylineAnnotationLayer({
98
required List<LineString> polylines,
109
this.color = const Color(0xFF000000),
1110
this.width = 1,
@@ -66,9 +65,7 @@ class PolylineAnnotationLayer extends AnnotationLayer<LineString> {
6665
blur == other.blur &&
6766
dashArray == other.dashArray;
6867

69-
late final int? _cachedHashCode;
70-
7168
@override
72-
int get hashCode => _cachedHashCode ??=
69+
int get hashCode =>
7370
Object.hash(super.hashCode, color, width, gapWidth, blur, dashArray);
7471
}

0 commit comments

Comments
 (0)