Flutter Google Maps janky animation when page is closed

43 Views Asked by At

enter image description here

When I pop from map view, still I can see the map animation which doesn't feel good as UX.

Sample code snippet:

class StoreListinMapView extends ConsumerStatefulWidget {
  static String path = "/shop/map-view";

  const StoreListinMapView({super.key});

  @override
  ConsumerState<StoreListinMapView> createState() => _ShopListingMapViewState();
}

class _ShopListingMapViewState extends ConsumerState<StoreListinMapView> {

  final Completer<GoogleMapController> _controller =
      Completer<GoogleMapController>();

 @override
  Widget build(BuildContext context) {

    return Scaffold(
      appBar: AppBar(
        title: const Text("Find a store"),
      ),
      body: Stack(
        children: [
          GoogleMap(
            markers: _storeProvider.storeMarkers,
            mapType: MapType.normal,
            onMapCreated: (GoogleMapController controller) {
              _controller.complete(controller);
            },
          )]));
}
}

Using google_maps_flutter: ^2.4.0 version.

0

There are 0 best solutions below