build method
dynamic
build
(- dynamic context
)
Implementation
@override
Widget build(BuildContext context) {
return BlocBuilder<MapBloc, MapState>(builder: (context, state) {
if (state is MapLoadingState) {
return Center(child: CircularProgressIndicator());
} else if (state is MapLoadedState) {
// Set<Marker> _currentMarkers = state.markers;
final GoogleMap googleMap = GoogleMap(
onMapCreated: (controller) {
mapBloc.updateController(context, controller);
},
initialCameraPosition: kInitialPosition,
compassEnabled: _compassEnabled,
mapToolbarEnabled: _mapToolbarEnabled,
cameraTargetBounds: _cameraTargetBounds,
minMaxZoomPreference: _minMaxZoomPreference,
rotateGesturesEnabled: _rotateGesturesEnabled,
scrollGesturesEnabled: _scrollGesturesEnabled,
tiltGesturesEnabled: _tiltGesturesEnabled,
zoomGesturesEnabled: _zoomGesturesEnabled,
indoorViewEnabled: _indoorViewEnabled,
myLocationEnabled: _myLocationEnabled,
myLocationButtonEnabled: _myLocationButtonEnabled,
trafficEnabled: _myTrafficEnabled,
polylines: state.polylines,
markers: state.markers,
zoomControlsEnabled: true,
onCameraMove: (position) {
currentZoom = position.zoom;
mapBloc.add(MapMoveEvent(zoomLevel: currentZoom));
},
mapType: _mapType,
);
return MapUI(googleMap: googleMap);
} else {
return Center(child: Text("error bruh"));
}
});
}