79 lines
2.2 KiB
Dart
Executable File
79 lines
2.2 KiB
Dart
Executable File
|
|
|
|
import 'package:amap_flutter_location/amap_flutter_location.dart';
|
|
import 'package:amap_flutter_location/amap_location_option.dart';
|
|
import 'package:permission_handler/permission_handler.dart';
|
|
import 'package:star_lock/tools/baseGetXController.dart';
|
|
|
|
import 'lockAddressGaoDe_state.dart';
|
|
|
|
class LockAddressGaoDeLogic extends BaseGetXController{
|
|
LockAddressGaoDeState state = LockAddressGaoDeState();
|
|
|
|
// Future<void> requestPermission() async {
|
|
// final status = await Permission.location.request();
|
|
// AppLog.log("Permission.location.request()=status:$status");
|
|
// // state.permissionStatus = status;
|
|
// switch (status) {
|
|
// case PermissionStatus.denied:
|
|
// AppLog.log("拒绝");
|
|
// break;
|
|
// case PermissionStatus.granted:
|
|
// requestLocation();
|
|
// break;
|
|
// case PermissionStatus.limited:
|
|
// AppLog.log("限制");
|
|
// break;
|
|
// default:
|
|
// AppLog.log("其他状态");
|
|
// requestLocation();
|
|
// break;
|
|
// }
|
|
// }
|
|
//
|
|
// Future<void> requestLocation() async {
|
|
// state.location = AMapFlutterLocation()
|
|
// ..setLocationOption(AMapLocationOption())
|
|
// ..onLocationChanged().listen((event) {
|
|
// AppLog.log("listenLocationChanged$event");
|
|
// state.latitude.value = double.parse(event['latitude'] as String);
|
|
// state.longitude.value = double.parse(event['longitude'] as String);
|
|
// if (state.latitude.value != 0 && state.longitude.value != 0) {
|
|
// // widget.callback(event);
|
|
// state.addressInfo.value = event;
|
|
// // currentLocation = CameraPosition(
|
|
// // target: LatLng(latitude, longitude),
|
|
// // zoom: 10,
|
|
// // );
|
|
// }
|
|
// })
|
|
// ..startLocation();
|
|
// }
|
|
|
|
void pushAddAction(){
|
|
|
|
}
|
|
|
|
@override
|
|
void onReady() {
|
|
super.onReady();
|
|
|
|
}
|
|
|
|
@override
|
|
void onInit() {
|
|
super.onInit();
|
|
|
|
// AMapFlutterLocation.updatePrivacyAgree(true);
|
|
// AMapFlutterLocation.updatePrivacyShow(true, true);
|
|
// AMapFlutterLocation.setApiKey("11d49b3f4fc09c04a02bbb7500925ba2", "883a3355d2d77c2fdc2667030dc97ffe");
|
|
//
|
|
// requestPermission();
|
|
}
|
|
|
|
@override
|
|
void onClose() {
|
|
super.onClose();
|
|
}
|
|
|
|
} |