|
|
|
@ -38,7 +38,6 @@ class UnionPage extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
class _UnionPage extends State<UnionPage> |
|
|
|
|
with AutomaticKeepAliveClientMixin, WidgetsBindingObserver { |
|
|
|
|
|
|
|
|
|
LocationFlutterPlugin aMapFlutterLocation; |
|
|
|
|
RefreshController refreshController = |
|
|
|
|
RefreshController(initialRefresh: false); |
|
|
|
@ -95,9 +94,10 @@ class _UnionPage extends State<UnionPage>
|
|
|
|
|
latLng = BMFCoordinate(event["latitude"], event["longitude"]); |
|
|
|
|
} |
|
|
|
|
BMFCalculateUtils.coordConvert( |
|
|
|
|
coordinate: latLng, |
|
|
|
|
fromType: BMF_COORD_TYPE.COMMON, |
|
|
|
|
toType: BMF_COORD_TYPE.BD09LL).then((value) { |
|
|
|
|
coordinate: latLng, |
|
|
|
|
fromType: BMF_COORD_TYPE.COMMON, |
|
|
|
|
toType: BMF_COORD_TYPE.BD09LL) |
|
|
|
|
.then((value) { |
|
|
|
|
this.latLng = value; |
|
|
|
|
saveLatLng( |
|
|
|
|
value, event["province"], event["city"], event["district"]); |
|
|
|
@ -155,12 +155,9 @@ class _UnionPage extends State<UnionPage>
|
|
|
|
|
SharedPreferences prefs = await SharedPreferences.getInstance(); |
|
|
|
|
await prefs.setString("latitude", "${latLng.latitude}"); |
|
|
|
|
await prefs.setString("longitude", "${latLng.longitude}"); |
|
|
|
|
if (province != null) |
|
|
|
|
await prefs.setString("province", province); |
|
|
|
|
if (city != null) |
|
|
|
|
await prefs.setString("city", city); |
|
|
|
|
if (district != null) |
|
|
|
|
await prefs.setString("district", district); |
|
|
|
|
if (province != null) await prefs.setString("province", province); |
|
|
|
|
if (city != null) await prefs.setString("city", city); |
|
|
|
|
if (district != null) await prefs.setString("district", district); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getLatLng() async { |
|
|
|
@ -360,7 +357,9 @@ class _UnionPage extends State<UnionPage>
|
|
|
|
|
requestDialog(); |
|
|
|
|
refreshController.refreshCompleted(); |
|
|
|
|
} else if (await Permission.location.isGranted) { |
|
|
|
|
SmartDialog.showLoading(msg: S.of(context).zhengzaijiazai, animationDurationTemp: Duration(seconds: 1)); |
|
|
|
|
SmartDialog.showLoading( |
|
|
|
|
msg: S.of(context).zhengzaijiazai, |
|
|
|
|
animationDurationTemp: Duration(seconds: 1)); |
|
|
|
|
aMapFlutterLocation.startLocation(); |
|
|
|
|
Future.delayed(Duration(seconds: 6), () { |
|
|
|
|
SmartDialog.dismiss(); |
|
|
|
@ -663,12 +662,17 @@ class _UnionPage extends State<UnionPage>
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
SizedBox( |
|
|
|
|
width: 2.w, |
|
|
|
|
), |
|
|
|
|
Image.asset( |
|
|
|
|
"assets/image/icon_union_location_black.png", |
|
|
|
|
width: 14.w, |
|
|
|
|
height: 14.h, |
|
|
|
|
), |
|
|
|
|
SizedBox(width: 2.w,), |
|
|
|
|
SizedBox( |
|
|
|
|
width: 2.w, |
|
|
|
|
), |
|
|
|
|
Expanded( |
|
|
|
|
flex: 1, |
|
|
|
|
child: Text( |
|
|
|
|