李志伟 3 gadus atpakaļ
vecāks
revīzija
dc83a4d8ac
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2
    2
      lib/models/app.dart

+ 2
- 2
lib/models/app.dart Parādīt failu

@@ -14,7 +14,7 @@ class AppController extends GetxController {
14 14
   static AppController t = Get.find();
15 15
   GetStorage box = GetStorage();
16 16
   final user = Rx<Person>(Person());
17
-  final location = Rxn<Map<String, Object>>();
17
+  final location = Rxn<Map<String, Object>>({'address':''});
18 18
   final testInt = 1.obs;
19 19
 
20 20
   AMapFlutterLocation? _location;
@@ -31,7 +31,7 @@ class AppController extends GetxController {
31 31
   void onLocationChange(Map<String, Object> result) {
32 32
     if (box.read('token') == null) {
33 33
       location(result);
34
-    } else if (result['address'] == '') {
34
+    } else if (location.value!['address'] == '') {
35 35
       setAmap({
36 36
         //定位有问题
37 37
         // 'params': 'location=${result['longitude'].toString()},${result['latitude'].toString()}',