李志伟 3 年之前
父節點
當前提交
dc83a4d8ac
共有 1 個檔案被更改,包括 2 行新增2 行删除
  1. 2
    2
      lib/models/app.dart

+ 2
- 2
lib/models/app.dart 查看文件

@@ -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()}',