stackunderflow
stackunderflow

Reputation: 1774

Flutter - Mapbox cause all widgets above the map become invisible

I replaced Google Map with Mapbox before found out that everything above the map disappeared, which does not happen with Google's. The widgets are all there not gone but they're invisible. Same with popup. I don't think there are setting's option provided by Mapbox since this is not something supposed to happen, like a bug. I don't know but I need to solve it.

  MapboxMap map = MapboxMap(
        compassEnabled : false,
        rotateGesturesEnabled : false,
        tiltGesturesEnabled : false,
        minMaxZoomPreference : MinMaxZoomPreference(5, 15),
        initialCameraPosition : CameraPosition(
              target: LatLng(0, 0),
              zoom: 15
        ),
        onMapCreated : (MapboxMapController controller){
              completer.complete(controller);
        },
  );
  ...
  Container wrap = Container(... child : map);
  Positioned mark = Positioned(... child: Icon(Icons.location_pin ...) ...);
  Stack stack = Stack(children : [wrap, mark]);

Updated : It's fine on Vivo model. Persistent on Galaxy and Xiaomi

Upvotes: 0

Views: 838

Answers (1)

Jinto Joseph
Jinto Joseph

Reputation: 1404

change to channel main , in main this issue is fixed

  • flutter channel main

  • flutter upgrade

Example :

enter image description here

in this example you can see

  • The app bar
  • Positioned icon in the Center of the map
  • Positioned bottom widget

all inside the stack widget

flutter --version
Flutter 3.1.0-0.0.pre.2592 • 
channel main • https://github.com/flutter/flutter.git
Tools • Dart 2.19.0 

Upvotes: 2

Related Questions