fix map
This commit is contained in:
@@ -194,15 +194,6 @@ class _MainScreenState extends State<MainScreen> with WidgetsBindingObserver {
|
||||
inactiveIcon:
|
||||
IconConstants.instance.getMaterialIcon(Icons.group_outlined),
|
||||
),
|
||||
// PersistentBottomNavBarItem(
|
||||
// icon: IconConstants.instance
|
||||
// .getMaterialIcon(Icons.notifications_outlined),
|
||||
// title: appLocalization(context).notification,
|
||||
// activeColorPrimary: Colors.blue,
|
||||
// inactiveColorPrimary: Colors.grey,
|
||||
// inactiveIcon: IconConstants.instance
|
||||
// .getMaterialIcon(Icons.notifications_outlined),
|
||||
// ),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@ class _MapScreenState extends State<MapScreen> with WidgetsBindingObserver {
|
||||
Timer? checkThemeTimer;
|
||||
Timer? getMarker;
|
||||
String themeMode = '';
|
||||
bool _isDisposed = false;
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@@ -74,19 +75,21 @@ class _MapScreenState extends State<MapScreen> with WidgetsBindingObserver {
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_isDisposed = true;
|
||||
checkThemeTimer?.cancel();
|
||||
getMarker?.cancel();
|
||||
_controller = Completer();
|
||||
streamController.close();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void onMapCreated(GoogleMapController controller) {
|
||||
if (!_isDisposed && !streamController.isClosed) {
|
||||
_controller.complete(controller);
|
||||
streamController.add(controller);
|
||||
clusterManager.setMapId(controller.mapId);
|
||||
checkTheme();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -173,11 +176,11 @@ class _MapScreenState extends State<MapScreen> with WidgetsBindingObserver {
|
||||
return ClusterManager<Device>(
|
||||
devices,
|
||||
_updateMarkers,
|
||||
markerBuilder: _getmarkerBuilder(),
|
||||
markerBuilder: _getMarkerBuilder(),
|
||||
);
|
||||
}
|
||||
|
||||
Future<Marker> Function(Cluster<Device>) _getmarkerBuilder() =>
|
||||
Future<Marker> Function(Cluster<Device>) _getMarkerBuilder() =>
|
||||
(cluster) async {
|
||||
return Marker(
|
||||
markerId: MarkerId(
|
||||
|
||||
Reference in New Issue
Block a user