From 866ff78adcd83c1b5c8057fc705a29bfeea8cad9 Mon Sep 17 00:00:00 2001 From: Luis Thein Date: Sat, 19 Feb 2022 17:10:32 +0100 Subject: [PATCH] fix: Fixed annotation tests --- .github/workflows/dart.yml | 7 ++++++- .gitignore | 1 + README.md | 2 ++ lib/src/controller.dart | 2 -- test/fake_maps_controllers.dart | 15 +++++++++------ 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index fb9fed2..1bf19a2 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -28,7 +28,12 @@ jobs: - name: Run dart analyze run: dart analyze - name: run tests - run: flutter test + run: flutter test --coverage + - name: upload coverage report + uses: codecov/codecov-action@v2 + with: + token: ${{secrets.CODECOV}} + file: ./coverage/lcov.info - name: build example project working-directory: ./example run: flutter build ios --release --no-codesign diff --git a/.gitignore b/.gitignore index 4655c8a..b80c8d4 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,7 @@ .pub/ build/ pubspec.lock +coverage/ # Android related **/android/**/gradle-wrapper.jar diff --git a/README.md b/README.md index 43aa145..6d10958 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # apple_maps_flutter +[![codecov](https://codecov.io/gh/LuisThein/apple_maps_flutter/branch/master/graph/badge.svg)](https://codecov.io/gh/LuisThein/apple_maps_flutter) + A Flutter plugin that provides an Apple Maps widget. The plugin relies on Flutter's mechanism for embedding Android and iOS views. As that mechanism is currently in a developers preview, this plugin should also be considered a developers preview. diff --git a/lib/src/controller.dart b/lib/src/controller.dart index b6f086a..72fd6e1 100644 --- a/lib/src/controller.dart +++ b/lib/src/controller.dart @@ -69,8 +69,6 @@ class AppleMapController { case 'annotation#onZIndexChanged': _appleMapState.onAnnotationZIndexChanged( call.arguments['annotationId'], call.arguments['zIndex']); - print( - 'AnnotationId: ${call.arguments['annotationId']}, got zIndex: ${call.arguments['zIndex']}'); break; case 'map#onTap': _appleMapState.onTap(LatLng._fromJson(call.arguments['position'])!); diff --git a/test/fake_maps_controllers.dart b/test/fake_maps_controllers.dart index 1a7acce..fa992ac 100644 --- a/test/fake_maps_controllers.dart +++ b/test/fake_maps_controllers.dart @@ -120,6 +120,7 @@ class FakePlatformAppleMap { final String annotationId = annotationData['annotationId']; final bool draggable = annotationData['draggable']; final bool visible = annotationData['visible']; + final double alpha = annotationData['alpha']; final dynamic infoWindowData = annotationData['infoWindow']; InfoWindow infoWindow = InfoWindow.noText; @@ -131,12 +132,14 @@ class FakePlatformAppleMap { ); } - result.add(Annotation( - annotationId: AnnotationId(annotationId), - draggable: draggable, - visible: visible, - infoWindow: infoWindow, - )); + result.add( + Annotation( + annotationId: AnnotationId(annotationId), + draggable: draggable, + visible: visible, + infoWindow: infoWindow, + alpha: alpha), + ); } return result;