import 'amap_flutter_platform_interface.dart'; class AmapFlutter { // 初始化SDK Future initSdk({String? iosKey, String? androidKey}) async { await AmapFlutterPlatform.instance.setApiKey( iosKey: iosKey, androidKey: androidKey, ); } // 定位初始化 Future initLocation() async { return AmapFlutterPlatform.instance.initLocation(); } // 开始定位 Future startLocation() async { return AmapFlutterPlatform.instance.startLocation(); } // 监听定位返回位置 Stream locationStream() { return AmapFlutterPlatform.instance.locationStream(); } // 停止定位 Future stopLocation() async { await AmapFlutterPlatform.instance.stopLocation(); } // 销毁 Future dispose() async { await AmapFlutterPlatform.instance.dispose(); } }