| 1234567891011121314151617181920212223242526 |
- import 'package:flutter_map/flutter_map.dart';
- import '../../utils/atmob_log.dart';
- class MapHelper {
- static const String tag = "MapHelper";
- static MapLocation? _lastLocation;
- static late MapPlatform _mapPlatform;
- static Future<void> init() async {
- await FlutterMap.init();
- _mapPlatform = FlutterMap.getMapPlatform();
- initLocationClient();
- }
- static initLocationClient() {
- _mapPlatform.setLocationListener(
- interval: 5000,
- listener: (location) {
- AtmobLog.d(tag, "onLocationChanged: $location");
- if (location.errorCode == 0) {
- _lastLocation = location;
- }
- });
- }
- }
|