2023-08-24 14:25:55 +08:00
|
|
|
|
import 'dart:async';
|
|
|
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
2023-07-10 17:50:31 +08:00
|
|
|
|
import 'package:flutter/material.dart';
|
2023-07-28 15:37:33 +08:00
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
2023-07-10 17:50:31 +08:00
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
|
|
|
|
|
|
|
import '../../../appRouters.dart';
|
|
|
|
|
|
import '../../../app_settings/app_colors.dart';
|
2023-08-24 14:25:55 +08:00
|
|
|
|
import '../../../main.dart';
|
2023-07-10 17:50:31 +08:00
|
|
|
|
import '../../../tools/titleAppBar.dart';
|
|
|
|
|
|
import '../../../translations/trans_lib.dart';
|
|
|
|
|
|
|
2023-08-24 14:25:55 +08:00
|
|
|
|
import 'lockAddressGaoDe_page.dart';
|
|
|
|
|
|
|
2023-07-10 17:50:31 +08:00
|
|
|
|
class LockAddressPage extends StatefulWidget {
|
2023-07-15 15:11:28 +08:00
|
|
|
|
const LockAddressPage({Key? key}) : super(key: key);
|
2023-07-10 17:50:31 +08:00
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
State<LockAddressPage> createState() => _LockAddressPageState();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-24 14:25:55 +08:00
|
|
|
|
class _LockAddressPageState extends State<LockAddressPage> with RouteAware{
|
2023-08-29 11:02:52 +08:00
|
|
|
|
Map<String, Object>? addressInfo;
|
2023-08-24 14:25:55 +08:00
|
|
|
|
|
2023-07-10 17:50:31 +08:00
|
|
|
|
@override
|
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
return Scaffold(
|
|
|
|
|
|
backgroundColor: AppColors.mainBackgroundColor,
|
2023-07-28 15:37:33 +08:00
|
|
|
|
appBar: TitleAppBar(
|
2023-08-24 14:25:55 +08:00
|
|
|
|
barTitle: TranslationLoader.lanKeys!.lockAddress!.tr,
|
2023-07-28 15:37:33 +08:00
|
|
|
|
haveBack: true,
|
|
|
|
|
|
backgroundColor: AppColors.mainColor,
|
|
|
|
|
|
actionsList: [
|
|
|
|
|
|
TextButton(
|
|
|
|
|
|
child: Text(
|
2023-08-24 14:25:55 +08:00
|
|
|
|
TranslationLoader.lanKeys!.next!.tr,
|
2023-07-28 15:37:33 +08:00
|
|
|
|
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
|
|
|
|
|
),
|
|
|
|
|
|
onPressed: () {
|
2023-08-29 11:02:52 +08:00
|
|
|
|
Get.toNamed(Routers.saveLockPage, arguments: addressInfo);
|
2023-08-24 14:25:55 +08:00
|
|
|
|
// Navigator.pushNamed(context, Routers.saveLockPage);
|
2023-07-28 15:37:33 +08:00
|
|
|
|
},
|
|
|
|
|
|
),
|
|
|
|
|
|
],
|
|
|
|
|
|
),
|
2023-08-29 11:02:52 +08:00
|
|
|
|
body: LockAddressGaoDePage(callback: (addressInfoMap){
|
|
|
|
|
|
addressInfo = addressInfoMap;
|
|
|
|
|
|
},)
|
|
|
|
|
|
// body: Container(),
|
|
|
|
|
|
);
|
2023-08-24 14:25:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
void dispose() {
|
|
|
|
|
|
super.dispose();
|
|
|
|
|
|
routeObserver.unsubscribe(this);
|
|
|
|
|
|
print("地图界面销毁了");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
void didChangeDependencies() {
|
|
|
|
|
|
super.didChangeDependencies();
|
|
|
|
|
|
// 订阅 routeObserver,之后就会尝试调用抽象类 RouteAware 的方法
|
|
|
|
|
|
routeObserver.subscribe(this, ModalRoute.of(context) as PageRoute);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
void didPush() {
|
|
|
|
|
|
// 当前页面入栈
|
|
|
|
|
|
print("当前页面入栈");
|
2023-07-10 17:50:31 +08:00
|
|
|
|
}
|
2023-08-24 14:25:55 +08:00
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
void didPopNext() {
|
|
|
|
|
|
// 当前路由的下个路由出栈,且当前页面显示
|
|
|
|
|
|
print("当前路由的下个路由出栈,且当前页面显示");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-07-10 17:50:31 +08:00
|
|
|
|
}
|