amap_map_fluttify

This commit is contained in:
2024-11-17 15:45:43 +08:00
commit ee80f75473
554 changed files with 220726 additions and 0 deletions

View File

@ -0,0 +1,11 @@
import 'package:permission_handler/permission_handler.dart';
Future<bool> requestPermission() async {
final status = await Permission.location.request();
if (status == PermissionStatus.granted) {
return true;
} else {
return false;
}
}

View File

@ -0,0 +1,25 @@
import 'dart:math';
import 'package:amap_map_fluttify/amap_map_fluttify.dart';
mixin NextLatLng {
final random = Random();
LatLng getNextLatLng({ LatLng? center}) {
center ??= LatLng(39.90960, 116.397228);
return LatLng(
center.latitude + random.nextDouble(),
center.longitude + random.nextDouble(),
);
}
List<LatLng> getNextBatchLatLng(int count) {
return [
for (int i = 0; i < count; i++)
LatLng(
39.90960 + random.nextDouble() * 4,
116.397228 + random.nextDouble() * 4,
)
];
}
}

View File

@ -0,0 +1 @@
export 'misc.dart';