| | |
| | | import 'package:locations/model/map/location_model.dart'; |
| | | import 'package:locations/model/sos/sos_model.dart'; |
| | | import 'package:locations/model/sos/sos_record_model.dart'; |
| | | import 'package:locations/ui/map/map.dart'; |
| | | import 'package:locations/ui/sos/sos_contacts.dart'; |
| | | import 'package:locations/ui/widget/base_ui.dart'; |
| | | import 'package:locations/ui/widget/button.dart'; |
| | |
| | | Map<String, dynamic>? result = |
| | | await SOSApiUtil.listSOSRecord(context, _page); |
| | | if (result!["code"] == 0) { |
| | | Map<String, dynamic> data = result!["data"]; |
| | | Map<String, dynamic> data = result["data"]; |
| | | List<dynamic> list = data["list"]; |
| | | List<SosRecordModel> recordList = []; |
| | | for (var element in list) { |
| | |
| | | |
| | | _totalCount = data["count"]; |
| | | } else { |
| | | ToastUtil.toast(result!["msg"]); |
| | | ToastUtil.toast(result["msg"]); |
| | | } |
| | | } |
| | | |
| | |
| | | sos = true; |
| | | }); |
| | | } else { |
| | | ToastUtil.toast(value!["msg"]); |
| | | ToastUtil.toast(value["msg"]); |
| | | } |
| | | }); |
| | | } else if (LocationState.permission_denied == |
| | |
| | | ToastUtil.toast("定位失败"); |
| | | } |
| | | }); |
| | | }else{ |
| | | } else { |
| | | setState(() { |
| | | sos = false; |
| | | }); |
| | |
| | | Container( |
| | | width: 12.5, |
| | | ), |
| | | _totalCount>0? |
| | | InkWell( |
| | | onTap: () { |
| | | DialogUtil.showDialog( |
| | |
| | | NotifyDialog( |
| | | "温馨提示", |
| | | "确定要清空记录吗?", |
| | | () { |
| | | }, |
| | | () {}, |
| | | () { |
| | | SOSApiUtil.clearSOSRecord(context) |
| | | .then((value) { |
| | | if (value!["code"] == 0) { |
| | | _onRefresh(); |
| | | } else { |
| | | ToastUtil.toast(value!["msg"]); |
| | | ToastUtil.toast(value["msg"]); |
| | | } |
| | | }); |
| | | }, |
| | |
| | | style: TextStyle( |
| | | color: Color(0xFF999999), fontSize: 12), |
| | | ), |
| | | ), |
| | | ):Container(), |
| | | Expanded( |
| | | child: SmartRefresher( |
| | | enablePullDown: true, |
| | |
| | | controller!.reverse(); |
| | | } |
| | | } else { |
| | | ToastUtil.toast(value!["msg"]); |
| | | ToastUtil.toast(value["msg"]); |
| | | } |
| | | }); |
| | | })) |
| | |
| | | Container( |
| | | height: 6, |
| | | ), |
| | | Row( |
| | | crossAxisAlignment: CrossAxisAlignment.center, |
| | | children: [ |
| | | Image.asset("assets/images/main/icon_location_position_name.png", |
| | | height: 16), |
| | | Container( |
| | | width: 6, |
| | | ), |
| | | Expanded(child: |
| | | FittedBox( |
| | | fit: BoxFit.fitWidth, |
| | | child: Text( |
| | | record.location!.address! + record.location!.addressDetail!, |
| | | softWrap: false, |
| | | overflow: TextOverflow.ellipsis, |
| | | style: TextStyle(fontSize: 12, color: Color(0xFF999999)), |
| | | ))), |
| | | Container( |
| | | width: 6, |
| | | ), |
| | | Image.asset( |
| | | "assets/images/main/icon_location_position_more.png", |
| | | height: 10, |
| | | ), |
| | | ], |
| | | ) |
| | | InkWell( |
| | | onTap: () { |
| | | NavigatorUtil.navigateToNextPage(context, MapPage("位置",share: false,location:record.location,uid: record.targetUid,), (data) { }); |
| | | |
| | | }, |
| | | child: Row( |
| | | crossAxisAlignment: CrossAxisAlignment.center, |
| | | children: [ |
| | | Image.asset( |
| | | "assets/images/main/icon_location_position_name.png", |
| | | height: 16), |
| | | Container( |
| | | width: 6, |
| | | ), |
| | | Expanded( |
| | | child: FittedBox( |
| | | fit: BoxFit.fitWidth, |
| | | child: Text( |
| | | record.location!.address! + |
| | | record.location!.addressDetail!, |
| | | softWrap: false, |
| | | overflow: TextOverflow.ellipsis, |
| | | style: const TextStyle( |
| | | fontSize: 12, color: Color(0xFF999999)), |
| | | ))), |
| | | Container( |
| | | width: 6, |
| | | ), |
| | | Image.asset( |
| | | "assets/images/main/icon_location_position_more.png", |
| | | height: 10, |
| | | ), |
| | | ], |
| | | )) |
| | | ], |
| | | ), |
| | | ); |