@@ -55,27 +55,27 @@ void main() {
5555 final ctrl = await ctrlCompleter.future;
5656 final size = tester.getSize (find.byType (MapLibreMap ));
5757
58- final region = await ctrl.getVisibleRegion ();
58+ final region = ctrl.getVisibleRegion ();
5959
60- var offset = await ctrl.toScreenLocation (
60+ var offset = ctrl.toScreenLocation (
6161 Position (region.longitudeWest, region.latitudeNorth),
6262 );
6363 expect (offset.dx, closeTo (0 , 1 ));
6464 expect (offset.dy, closeTo (0 , 1 ));
6565
66- offset = await ctrl.toScreenLocation (
66+ offset = ctrl.toScreenLocation (
6767 Position (region.longitudeEast, region.latitudeNorth),
6868 );
6969 expect (offset.dx, closeTo (size.width, 1 ));
7070 expect (offset.dy, closeTo (0 , 1 ));
7171
72- offset = await ctrl.toScreenLocation (
72+ offset = ctrl.toScreenLocation (
7373 Position (region.longitudeWest, region.latitudeSouth),
7474 );
7575 expect (offset.dx, closeTo (0 , 1 ));
7676 expect (offset.dy, closeTo (size.height, 1 ));
7777
78- offset = await ctrl.toScreenLocation (
78+ offset = ctrl.toScreenLocation (
7979 Position (region.longitudeEast, region.latitudeSouth),
8080 );
8181 expect (offset.dx, closeTo (size.width, 1 ));
@@ -91,14 +91,14 @@ void main() {
9191 await tester.pumpWidget (app);
9292 final ctrl = await ctrlCompleter.future;
9393 final size = tester.getSize (find.byType (MapLibreMap ));
94- final region = await ctrl.getVisibleRegion ();
94+ final region = ctrl.getVisibleRegion ();
9595 final positions = [
9696 Position (region.longitudeWest, region.latitudeNorth),
9797 Position (region.longitudeEast, region.latitudeNorth),
9898 Position (region.longitudeWest, region.latitudeSouth),
9999 Position (region.longitudeEast, region.latitudeSouth),
100100 ];
101- final offsets = await ctrl.toScreenLocations (positions);
101+ final offsets = ctrl.toScreenLocations (positions);
102102
103103 expect (offsets[0 ].dx, closeTo (0 , 1 ));
104104 expect (offsets[0 ].dy, closeTo (0 , 1 ));
@@ -122,21 +122,21 @@ void main() {
122122 await tester.pumpWidget (app);
123123 final ctrl = await ctrlCompleter.future;
124124 final size = tester.getSize (find.byType (MapLibreMap ));
125- final region = await ctrl.getVisibleRegion ();
125+ final region = ctrl.getVisibleRegion ();
126126
127- var lngLat = await ctrl.toLngLat (Offset .zero);
127+ var lngLat = ctrl.toLngLat (Offset .zero);
128128 expect (lngLat.lng, closeTo (region.longitudeWest, 0.00001 ));
129129 expect (lngLat.lat, closeTo (region.latitudeNorth, 0.00001 ));
130130
131- lngLat = await ctrl.toLngLat (Offset (size.width, 0 ));
131+ lngLat = ctrl.toLngLat (Offset (size.width, 0 ));
132132 expect (lngLat.lng, closeTo (region.longitudeEast, 0.00001 ));
133133 expect (lngLat.lat, closeTo (region.latitudeNorth, 0.00001 ));
134134
135- lngLat = await ctrl.toLngLat (Offset (0 , size.height));
135+ lngLat = ctrl.toLngLat (Offset (0 , size.height));
136136 expect (lngLat.lng, closeTo (region.longitudeWest, 0.00001 ));
137137 expect (lngLat.lat, closeTo (region.latitudeSouth, 0.00001 ));
138138
139- lngLat = await ctrl.toLngLat (Offset (size.width, size.height));
139+ lngLat = ctrl.toLngLat (Offset (size.width, size.height));
140140 expect (lngLat.lng, closeTo (region.longitudeEast, 0.00001 ));
141141 expect (lngLat.lat, closeTo (region.latitudeSouth, 0.00001 ));
142142 });
@@ -150,14 +150,14 @@ void main() {
150150 await tester.pumpWidget (app);
151151 final ctrl = await ctrlCompleter.future;
152152 final size = tester.getSize (find.byType (MapLibreMap ));
153- final region = await ctrl.getVisibleRegion ();
153+ final region = ctrl.getVisibleRegion ();
154154 final offsets = [
155155 Offset .zero,
156156 Offset (size.width, 0 ),
157157 Offset (0 , size.height),
158158 Offset (size.width, size.height),
159159 ];
160- final lngLats = await ctrl.toLngLats (offsets);
160+ final lngLats = ctrl.toLngLats (offsets);
161161
162162 expect (lngLats[0 ].lng, closeTo (region.longitudeWest, 0.00001 ));
163163 expect (lngLats[0 ].lat, closeTo (region.latitudeNorth, 0.00001 ));
@@ -184,9 +184,9 @@ void main() {
184184 await tester.pumpWidget (app);
185185 final ctrl = await ctrlCompleter.future;
186186 final size = tester.getSize (find.byType (MapLibreMap ));
187- final pos0 = await ctrl.toLngLat (Offset (0 , size.height / 4 ));
188- final pos1 = await ctrl.toLngLat (Offset (100 , size.height / 4 ));
189- final meters = await ctrl.getMetersPerPixelAtLatitude (
187+ final pos0 = ctrl.toLngLat (Offset (0 , size.height / 4 ));
188+ final pos1 = ctrl.toLngLat (Offset (100 , size.height / 4 ));
189+ final meters = ctrl.getMetersPerPixelAtLatitude (
190190 pos0.lat.toDouble (),
191191 );
192192 final actual =
@@ -206,7 +206,7 @@ void main() {
206206 );
207207 await tester.pumpWidget (app);
208208 final ctrl = await ctrlCompleter.future;
209- final region = await ctrl.getVisibleRegion ();
209+ final region = ctrl.getVisibleRegion ();
210210 // testing devices have different screen sizes
211211 expect (region.longitudeWest, lessThan (0 ));
212212 expect (region.longitudeEast, greaterThan (0 ));
@@ -326,10 +326,10 @@ void main() {
326326 final size = tester.getSize (find.byType (MapLibreMap ));
327327 final centerScreen = Offset (size.width / 2 , size.height / 2 );
328328
329- var layers = await ctrl.queryLayers (Offset .zero);
329+ var layers = ctrl.queryLayers (Offset .zero);
330330 expect (layers, isEmpty);
331331
332- layers = await ctrl.queryLayers (centerScreen);
332+ layers = ctrl.queryLayers (centerScreen);
333333 expect (layers, hasLength (1 ));
334334 expect (layers.first, expectedPoint);
335335
@@ -375,7 +375,7 @@ void main() {
375375
376376 await tester.pumpAndSettle (const Duration (seconds: 2 ));
377377
378- layers = await ctrl.queryLayers (centerScreen);
378+ layers = ctrl.queryLayers (centerScreen);
379379 expect (layers, hasLength (2 ));
380380 expect (layers, containsAll ([expectedPoint, expectedPolygon]));
381381 });
@@ -403,7 +403,7 @@ void main() {
403403 sourceId: 'maptiler_planet' ,
404404 sourceLayer: 'water' ,
405405 );
406- final layers = await ctrl.queryLayers (Offset .zero);
406+ final layers = ctrl.queryLayers (Offset .zero);
407407 expect (layers, hasLength (1 ));
408408 expect (layers.first, oceanExpected);
409409 });
@@ -486,9 +486,9 @@ void main() {
486486 await tester.pump (const Duration (seconds: 1 ));
487487 final size = tester.getSize (find.byType (MapLibreMap ));
488488 final centerScreen = Offset (size.width / 2 , size.height / 2 );
489- var features = await ctrl.featuresAtPoint (Offset .zero);
489+ var features = ctrl.featuresAtPoint (Offset .zero);
490490 expect (features, isEmpty);
491- features = await ctrl.featuresAtPoint (centerScreen);
491+ features = ctrl.featuresAtPoint (centerScreen);
492492 expect (features, hasLength (2 ));
493493 final pointFeature = features.firstWhere (
494494 (f) => f.id == 1 || f.id == '1' ,
@@ -500,14 +500,14 @@ void main() {
500500 );
501501 expect (polygonFeature.properties['poly' ], 'gon' );
502502
503- features = await ctrl.featuresAtPoint (
503+ features = ctrl.featuresAtPoint (
504504 centerScreen,
505505 layerIds: [pointLayerId],
506506 );
507507 expect (features, hasLength (1 ));
508508 expect (features.first.id, isIn ([1 , '1' ]));
509509 expect (features.first.properties['foo' ], 'bar' );
510- features = await ctrl.featuresAtPoint (
510+ features = ctrl.featuresAtPoint (
511511 centerScreen,
512512 layerIds: [polygonLayerId],
513513 );
@@ -523,14 +523,14 @@ void main() {
523523 ),
524524 );
525525 await tester.pump (const Duration (seconds: 1 ));
526- features = await ctrl.featuresAtPoint (centerScreen);
526+ features = ctrl.featuresAtPoint (centerScreen);
527527 expect (features, hasLength (3 ));
528- features = await ctrl.featuresAtPoint (
528+ features = ctrl.featuresAtPoint (
529529 centerScreen,
530530 layerIds: [pointLayerId, pointLayer2Id],
531531 );
532532 expect (features, hasLength (2 ));
533- features = await ctrl.featuresAtPoint (
533+ features = ctrl.featuresAtPoint (
534534 centerScreen,
535535 layerIds: [],
536536 );
@@ -644,12 +644,12 @@ void main() {
644644 );
645645 await tester.pump (const Duration (seconds: 1 ));
646646 final size = tester.getSize (find.byType (MapLibreMap ));
647- var features = await ctrl.featuresInRect (
647+ var features = ctrl.featuresInRect (
648648 const Rect .fromLTWH (0 , 0 , 10 , 10 ),
649649 );
650650 expect (features, isEmpty);
651651 final pointScreen = Offset (size.width / 2 , size.height / 2 );
652- features = await ctrl.featuresInRect (
652+ features = ctrl.featuresInRect (
653653 Rect .fromCenter (center: pointScreen, width: 2 , height: 2 ),
654654 );
655655 expect (features, hasLength (2 ));
@@ -661,19 +661,19 @@ void main() {
661661 (f) => f.id == 3 || f.id == '3' ,
662662 );
663663 expect (polygonFeature.properties['poly' ], 'gon' );
664- final lineStartScreen = await ctrl.toScreenLocation (
664+ final lineStartScreen = ctrl.toScreenLocation (
665665 Position (0.09 , 0.11 ),
666666 );
667- final lineEndScreen = await ctrl.toScreenLocation (Position (0.11 , 0.11 ));
668- features = await ctrl.featuresInRect (
667+ final lineEndScreen = ctrl.toScreenLocation (Position (0.11 , 0.11 ));
668+ features = ctrl.featuresInRect (
669669 Rect .fromPoints (lineStartScreen, lineEndScreen),
670670 );
671671 // FIXME: blocked on https://github.com/josxha/flutter-maplibre/issues/317
672672 // expect(
673673 // features.firstWhere((f) => f.id == 2 || f.id == '2').properties['line'],
674674 // 'string',
675675 // );
676- features = await ctrl.featuresInRect (
676+ features = ctrl.featuresInRect (
677677 Rect .fromLTWH (0 , 0 , size.width, size.height),
678678 );
679679 expect (features, hasLength (3 ));
@@ -693,7 +693,7 @@ void main() {
693693 );
694694 expect (polygonFeature2.properties['poly' ], 'gon' );
695695
696- features = await ctrl.featuresInRect (
696+ features = ctrl.featuresInRect (
697697 Rect .fromLTWH (0 , 0 , size.width, size.height),
698698 layerIds: [pointLayerId, lineLayerId],
699699 );
@@ -708,7 +708,7 @@ void main() {
708708 (f) => f.id == 2 || f.id == '2' ,
709709 );
710710 expect (lineFeature2.properties['line' ], 'string' );
711- features = await ctrl.featuresInRect (
711+ features = ctrl.featuresInRect (
712712 Rect .fromLTWH (0 , 0 , size.width, size.height),
713713 layerIds: [],
714714 );
0 commit comments