When tapping a custom button overlaid on the map, the camera event sequence behaves unexpectedly.
The idle event is triggered before move events
[✓] Flutter (Channel stable, 3.38.5, on macOS 26.4.1 25E253 darwin-arm64, locale en-FR)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
[✓] Xcode - develop for iOS and macOS (Xcode 26.4)
[✓] Chrome - develop for the web
[✓] Connected device (5 available)
[✓] Network resources
diff --git forkSrcPrefix/example/lib/pages/navigation.dart forkDstPrefix/example/lib/pages/navigation.dart
index 7210a871dc0a1e2089c86660d8dec3209db38a97..9c837d1ffe1902f8a940c2abae8661170f10e43a 100644
--- forkSrcPrefix/example/lib/pages/navigation.dart
+++ forkDstPrefix/example/lib/pages/navigation.dart
@@ -1318,6 +1318,9 @@ class _NavigationPageState extends ExamplePageState<NavigationPage> {
mapId: MapIdManager.instance.mapId,
initialMapColorScheme: _mapColorScheme,
initialForceNightMode: _forceNightMode,
+ onCameraIdle: (_) => print('==> onCameraIdle'),
+ onCameraMove: (_) => print('==> onCameraMove'),
+ onCameraMoveStarted: (_, __) => print('==> onCameraMoveStarted'),
)
: const Center(
child: Column(
@@ -1337,6 +1340,18 @@ class _NavigationPageState extends ExamplePageState<NavigationPage> {
if (_navigationViewController != null) bottomControls,
],
),
+ Positioned(
+ top: 40,
+ left: 0,
+ right: 0,
+ child: TextButton(onPressed: () => _navigationViewController?.animateCamera(CameraUpdate.newLatLng(LatLng(latitude: 51.5160895, longitude: -0.1294527))), child: Container(color: Colors.red, height: 20, child: Text('Change camera position'))),
+ ),
+ Positioned(
+ bottom: 140,
+ left: 0,
+ right: 0,
+ child: TextButton(onPressed: () => _navigationViewController?.animateCamera(CameraUpdate.newLatLng(LatLng(latitude: 51.5160895, longitude: -0.1294527))), child: Container(color: Colors.red, height: 20, child: Text('Change camera position'))),
+ ),
if (_showRemainingTimeAndDistanceLabels)
_createRemainingTimeAndDistanceLabels(),
],
Is there an existing issue for this?
Description of the bug
When tapping a custom button overlaid on the map, the camera event sequence behaves unexpectedly.
The idle event is triggered before move events
Flutter version
3.38.5
Package version
0.8.4
Native SDK versions
Flutter Doctor Output
[✓] Flutter (Channel stable, 3.38.5, on macOS 26.4.1 25E253 darwin-arm64, locale en-FR)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
[✓] Xcode - develop for iOS and macOS (Xcode 26.4)
[✓] Chrome - develop for the web
[✓] Connected device (5 available)
[✓] Network resources
• No issues found!
Steps to reproduce
'apply the following diff'
→ Logs show idle event occurs after move events (expected behavior)
→ Logs show idle event occurs before move events (unexpected behavior)
Expected vs Actual Behavior
/
Code Sample