fix(ui): Fix some ui bugs
This commit is contained in:
@@ -54,6 +54,8 @@ class _MapScreenState extends State<MapScreen> with WidgetsBindingObserver {
|
||||
// LatLng myLocation = const LatLng(213761, 123123);
|
||||
// Position? position;
|
||||
// bool isAllowLocationPermission = false;
|
||||
Timer? checkThemeTimer;
|
||||
Timer? getMarker;
|
||||
String themeMode = '';
|
||||
@override
|
||||
void initState() {
|
||||
@@ -62,11 +64,17 @@ class _MapScreenState extends State<MapScreen> with WidgetsBindingObserver {
|
||||
_loadIcons();
|
||||
getAllMarkers();
|
||||
clusterManager = _initClusterManager();
|
||||
const duration = Duration(seconds: 2);
|
||||
checkThemeTimer = Timer.periodic(duration, (Timer t) => checkTheme());
|
||||
const Duration markerDuration = Duration(seconds: 5);
|
||||
getMarker = Timer.periodic(markerDuration, (Timer t) => getAllMarkers());
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
checkThemeTimer?.cancel();
|
||||
getMarker?.cancel();
|
||||
_controller = Completer();
|
||||
streamController.close();
|
||||
}
|
||||
@@ -142,7 +150,6 @@ class _MapScreenState extends State<MapScreen> with WidgetsBindingObserver {
|
||||
return rootBundle.loadString(path);
|
||||
}
|
||||
|
||||
|
||||
Future<void> _loadIcons() async {
|
||||
List<Future<BitmapDescriptor>> iconFutures = imageAssets.map((asset) {
|
||||
return BitmapDescriptor.asset(
|
||||
@@ -245,7 +252,7 @@ class _MapScreenState extends State<MapScreen> with WidgetsBindingObserver {
|
||||
hasOtherState = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (hasStateOne) {
|
||||
return true; // flameIcon
|
||||
} else if (hasOtherState) {
|
||||
|
||||
Reference in New Issue
Block a user