Merge branch 'release_hyx' into release
This commit is contained in:
commit
0a99c6663d
162
lib/app.dart
162
lib/app.dart
@ -7,9 +7,13 @@ import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/blue/blue_manage.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/login/login/app_get_version.dart';
|
||||
import 'package:star_lock/main/lockMian/lockMain/lockMain_logic.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
||||
import 'package:star_lock/tools/app_manager.dart';
|
||||
import 'package:star_lock/tools/bindings/app_binding.dart';
|
||||
import 'package:star_lock/tools/customer_tool.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
import 'package:star_lock/translations/app_dept.dart';
|
||||
@ -22,15 +26,13 @@ import 'tools/appRouteObserver.dart';
|
||||
import 'tools/store_service.dart';
|
||||
|
||||
class MyApp extends StatefulWidget {
|
||||
const MyApp({GlobalKey? key}) : super(key: key);
|
||||
MyApp({required this.isLogin, GlobalKey? key}) : super(key: key);
|
||||
bool isLogin;
|
||||
|
||||
@override
|
||||
State<MyApp> createState() => _MyAppState();
|
||||
}
|
||||
|
||||
// 注册 RouteObserver 作为 navigation observer.
|
||||
// final RouteObserver<PageRoute> routeObserver = RouteObserver<PageRoute>();
|
||||
|
||||
class _MyAppState extends State<MyApp> with WidgetsBindingObserver, BaseWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -39,72 +41,84 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver, BaseWidget {
|
||||
builder: (BuildContext w, Widget? a) => _initMaterialApp());
|
||||
}
|
||||
|
||||
GetMaterialApp _initMaterialApp() => GetMaterialApp(
|
||||
// enableLog: false,
|
||||
title: F.navTitle,
|
||||
navigatorObservers: <NavigatorObserver>[AppRouteObserver().routeObserver],
|
||||
translations: TranslationMessage(),
|
||||
supportedLocales: appDept.deptSupportedLocales,
|
||||
localizationsDelegates: const <LocalizationsDelegate<dynamic>>[
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
],
|
||||
localeResolutionCallback:
|
||||
(Locale? locale, Iterable<Locale> supportedLocales) {
|
||||
if (!supportedLocales.contains(locale)) {
|
||||
final int idx = appSupportedLocales.indexWhere(
|
||||
(Locale element) => element.languageCode == locale!.languageCode);
|
||||
if (idx != -1) {
|
||||
locale = appSupportedLocales[idx];
|
||||
} else {
|
||||
locale = const Locale('zh', 'CN');
|
||||
GetMaterialApp _initMaterialApp() {
|
||||
//判断是不是登录
|
||||
String initialRoute;
|
||||
if (widget.isLogin) {
|
||||
initialRoute = Routers.starLockMain;
|
||||
} else {
|
||||
initialRoute = Routers.login;
|
||||
}
|
||||
return GetMaterialApp(
|
||||
// enableLog: false,
|
||||
title: F.navTitle,
|
||||
navigatorObservers: <NavigatorObserver>[
|
||||
AppRouteObserver().routeObserver
|
||||
],
|
||||
translations: TranslationMessage(),
|
||||
supportedLocales: appDept.deptSupportedLocales,
|
||||
localizationsDelegates: const <LocalizationsDelegate<dynamic>>[
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
],
|
||||
localeResolutionCallback:
|
||||
(Locale? locale, Iterable<Locale> supportedLocales) {
|
||||
if (!supportedLocales.contains(locale)) {
|
||||
final int idx = appSupportedLocales.indexWhere((Locale element) =>
|
||||
element.languageCode == locale!.languageCode);
|
||||
if (idx != -1) {
|
||||
locale = appSupportedLocales[idx];
|
||||
} else {
|
||||
locale = const Locale('zh', 'CN');
|
||||
}
|
||||
}
|
||||
}
|
||||
AppManager()
|
||||
.setLanCode(code: '${locale!.languageCode}_${locale.countryCode}');
|
||||
return locale;
|
||||
},
|
||||
locale: StoreService.to.getLanguageCode()!.isNotEmpty
|
||||
? appDept.deptSupportedLocales
|
||||
.where((Locale element) =>
|
||||
element.languageCode == StoreService.to.getLanguageCode())
|
||||
.first
|
||||
: Get.deviceLocale,
|
||||
// locale: Get.deviceLocale,
|
||||
fallbackLocale: const Locale('zh', 'CN'),
|
||||
theme: ThemeData(
|
||||
scaffoldBackgroundColor: const Color(0xFFF6F6F6),
|
||||
backgroundColor: const Color(0xFFF6F6F6),
|
||||
primaryColor: const Color(0xFFFFFFFF),
|
||||
textTheme: TextTheme(
|
||||
//用在非Material组件上的文字显示,
|
||||
bodyText1:
|
||||
TextStyle(fontSize: 28.sp, color: const Color(0xff2E2B2B)),
|
||||
//Material组件上的文字显示
|
||||
bodyText2:
|
||||
TextStyle(fontSize: 28.sp, color: const Color(0xff2E2B2B)),
|
||||
button: TextStyle(fontSize: 28.sp)),
|
||||
iconTheme: IconThemeData(size: 28.sp, color: const Color(0xff2E2B2B)),
|
||||
appBarTheme: AppBarTheme(
|
||||
backgroundColor: const Color(0xFFFFFFFF),
|
||||
elevation: 0,
|
||||
centerTitle: true,
|
||||
iconTheme: IconThemeData(color: const Color(0xff333333), size: 36.sp),
|
||||
titleTextStyle: TextStyle(
|
||||
color: const Color(0xff333333),
|
||||
fontWeight: FontWeight.w400,
|
||||
fontSize: 36.sp),
|
||||
AppManager().setLanCode(
|
||||
code: '${locale!.languageCode}_${locale.countryCode}');
|
||||
return locale;
|
||||
},
|
||||
locale: StoreService.to.getLanguageCode()!.isNotEmpty
|
||||
? appDept.deptSupportedLocales
|
||||
.where((Locale element) =>
|
||||
element.languageCode == StoreService.to.getLanguageCode())
|
||||
.first
|
||||
: Get.deviceLocale,
|
||||
// locale: Get.deviceLocale,
|
||||
fallbackLocale: const Locale('zh', 'CN'),
|
||||
theme: ThemeData(
|
||||
scaffoldBackgroundColor: const Color(0xFFF6F6F6),
|
||||
backgroundColor: const Color(0xFFF6F6F6),
|
||||
primaryColor: const Color(0xFFFFFFFF),
|
||||
textTheme: TextTheme(
|
||||
//用在非Material组件上的文字显示,
|
||||
bodyText1:
|
||||
TextStyle(fontSize: 28.sp, color: const Color(0xff2E2B2B)),
|
||||
//Material组件上的文字显示
|
||||
bodyText2:
|
||||
TextStyle(fontSize: 28.sp, color: const Color(0xff2E2B2B)),
|
||||
button: TextStyle(fontSize: 28.sp)),
|
||||
iconTheme: IconThemeData(size: 28.sp, color: const Color(0xff2E2B2B)),
|
||||
appBarTheme: AppBarTheme(
|
||||
backgroundColor: const Color(0xFFFFFFFF),
|
||||
elevation: 0,
|
||||
centerTitle: true,
|
||||
iconTheme:
|
||||
IconThemeData(color: const Color(0xff333333), size: 36.sp),
|
||||
titleTextStyle: TextStyle(
|
||||
color: const Color(0xff333333),
|
||||
fontWeight: FontWeight.w400,
|
||||
fontSize: 36.sp),
|
||||
),
|
||||
splashColor: Colors.transparent,
|
||||
// 点击时的高亮效果设置为透明
|
||||
highlightColor: Colors.transparent,
|
||||
),
|
||||
splashColor: Colors.transparent,
|
||||
// 点击时的高亮效果设置为透明
|
||||
highlightColor: Colors.transparent,
|
||||
),
|
||||
debugShowCheckedModeBanner: false,
|
||||
getPages: AppRouters.routePages,
|
||||
builder: EasyLoading.init(),
|
||||
initialBinding: AppBindings(),
|
||||
initialRoute: '/');
|
||||
debugShowCheckedModeBanner: false,
|
||||
getPages: AppRouters.routePages,
|
||||
builder: EasyLoading.init(),
|
||||
initialBinding: AppBindings(),
|
||||
initialRoute: initialRoute );
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@ -153,3 +167,15 @@ Future<bool> getLoginStatus() async {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Future<void> getAgreePrivacyShowUpdate() async {
|
||||
final String? data = await Storage.getString(isAgreePrivacy);
|
||||
if (data == isAgreePrivacy) {
|
||||
AppFirstEnterHandle().getAppFirstEnter(isShowUpdateVersion);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> getAppInfo() async {
|
||||
final GetAppInfo entity = await ApiRepository.to.getAppInfo();
|
||||
CustomerTool.init(entity.data?.wechatServiceUrl ?? '');
|
||||
}
|
||||
@ -486,6 +486,8 @@ abstract class Routers {
|
||||
'/advancedFunctionRecordPage'; //高级功能购买记录
|
||||
static const String administratorAssociationLockPage =
|
||||
'/administratorAssociationLockPage'; //我的设置-授权管理员-关联锁
|
||||
|
||||
static const String login = '/login'; //登录
|
||||
}
|
||||
|
||||
abstract class AppRouters {
|
||||
@ -494,6 +496,12 @@ abstract class AppRouters {
|
||||
name: Routers.initial,
|
||||
page: () => const StarLockApplication(),
|
||||
),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.login,
|
||||
page: () => F.sw(
|
||||
skyCall: () => const StarLockLoginPage(),
|
||||
xhjCall: () => const StarLockLoginXHJPage()),
|
||||
),
|
||||
GetPage<dynamic>(
|
||||
name: Routers.starLockMain,
|
||||
page: () => F.sw(
|
||||
|
||||
@ -3,14 +3,17 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/login/login/starLock_login_state.dart';
|
||||
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
||||
import 'package:star_lock/tools/customer_tool.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
import '../../appRouters.dart';
|
||||
import '../../app_settings/app_colors.dart';
|
||||
import '../../common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import '../../tools/commonItem.dart';
|
||||
import '../../tools/tf_loginInput.dart';
|
||||
import '../../tools/submitBtn.dart';
|
||||
import '../../tools/tf_loginInput.dart';
|
||||
import '../../tools/titleAppBar.dart';
|
||||
import '../../translations/trans_lib.dart';
|
||||
import 'starLock_login_logic.dart';
|
||||
@ -23,8 +26,16 @@ class StarLockLoginPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
final logic = Get.put(StarLockLoginLogic());
|
||||
final state = Get.find<StarLockLoginLogic>().state;
|
||||
final StarLockLoginLogic logic = Get.put(StarLockLoginLogic());
|
||||
final StarLockLoginState state = Get.find<StarLockLoginLogic>().state;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
AppFirstEnterHandle().getAppFirstEnter(isAgreePrivacy);
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -35,7 +46,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
barTitle: TranslationLoader.lanKeys!.login!.tr,
|
||||
haveBack: false,
|
||||
backgroundColor: AppColors.mainColor,
|
||||
actionsList: [
|
||||
actionsList: <Widget>[
|
||||
const IconButton(
|
||||
onPressed: CustomerTool.openCustomerService,
|
||||
icon: Icon(
|
||||
@ -62,7 +73,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
),
|
||||
body: ListView(
|
||||
padding: EdgeInsets.only(top: 120.h, left: 40.w, right: 40.w),
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.all(10.w),
|
||||
child: Center(
|
||||
@ -111,7 +122,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
hintText:
|
||||
TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr,
|
||||
// keyboardType: TextInputType.number,
|
||||
inputFormatters: [
|
||||
inputFormatters: <TextInputFormatter>[
|
||||
// FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
||||
LengthLimitingTextInputFormatter(30),
|
||||
]),
|
||||
@ -135,13 +146,13 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
),
|
||||
hintText:
|
||||
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.password!.tr}",
|
||||
inputFormatters: [
|
||||
inputFormatters: <TextInputFormatter>[
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
]),
|
||||
// SizedBox(height: 15.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Obx(() => GestureDetector(
|
||||
onTap: () {
|
||||
state.agree.value = !state.agree.value;
|
||||
@ -168,7 +179,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
text: TranslationLoader.lanKeys!.readAndAgree!.tr,
|
||||
style: TextStyle(
|
||||
color: const Color(0xff333333), fontSize: 20.sp),
|
||||
children: [
|
||||
children: <InlineSpan>[
|
||||
WidgetSpan(
|
||||
alignment: PlaceholderAlignment.middle,
|
||||
child: GestureDetector(
|
||||
@ -178,7 +189,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
color: AppColors.mainColor,
|
||||
fontSize: 20.sp)),
|
||||
onTap: () {
|
||||
Get.toNamed(Routers.webviewShowPage, arguments: {
|
||||
Get.toNamed(Routers.webviewShowPage, arguments: <String, String>{
|
||||
'url': XSConstantMacro.userAgreementURL,
|
||||
'title': '用户协议'.tr
|
||||
});
|
||||
@ -193,7 +204,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
color: AppColors.mainColor,
|
||||
fontSize: 20.sp)),
|
||||
onTap: () {
|
||||
Get.toNamed(Routers.webviewShowPage, arguments: {
|
||||
Get.toNamed(Routers.webviewShowPage, arguments: <String, String>{
|
||||
'url': XSConstantMacro.privacyPolicyURL,
|
||||
'title': '隐私政策'.tr
|
||||
});
|
||||
@ -224,7 +235,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
SizedBox(height: 50.w),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
GestureDetector(
|
||||
child: SizedBox(
|
||||
// width: 150.w,
|
||||
@ -284,9 +295,9 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
width: 1.sp,
|
||||
// height: 200.h,
|
||||
child: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Container(
|
||||
color: Colors.red,
|
||||
child: Image.asset(
|
||||
|
||||
@ -1,20 +1,18 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/login/login/starLock_login_state.dart';
|
||||
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
||||
import 'package:star_lock/tools/customer_tool.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
import '../../appRouters.dart';
|
||||
import '../../app_settings/app_colors.dart';
|
||||
import '../../common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import '../../tools/commonItem.dart';
|
||||
import '../../tools/tf_loginInput.dart';
|
||||
import '../../tools/submitBtn.dart';
|
||||
import '../../tools/titleAppBar.dart';
|
||||
import '../../tools/tf_loginInput.dart';
|
||||
import '../../translations/trans_lib.dart';
|
||||
import 'starLock_login_logic.dart';
|
||||
|
||||
@ -29,290 +27,296 @@ class _StarLockLoginPageState extends State<StarLockLoginXHJPage> {
|
||||
final StarLockLoginLogic logic = Get.put(StarLockLoginLogic());
|
||||
final StarLockLoginState state = Get.find<StarLockLoginLogic>().state;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
AppFirstEnterHandle().getAppFirstEnter(isAgreePrivacy);
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: const Color(0xFFFFFFFF),
|
||||
body: ListView(
|
||||
padding: EdgeInsets.only(
|
||||
top: 110.h,
|
||||
),
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 40.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
'${"欢迎使用".tr}${F.title}',
|
||||
style: TextStyle(
|
||||
color: AppColors.darkGrayTextColor,
|
||||
fontSize: 48.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: CustomerTool.openCustomerService,
|
||||
icon: Icon(
|
||||
Icons.support_agent,
|
||||
color: AppColors.mainColor,
|
||||
)),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 30.h),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
final result =
|
||||
await Get.toNamed(Routers.selectCountryRegionPage);
|
||||
if (result != null) {
|
||||
result as Map<String, dynamic>;
|
||||
state.countryCode.value = result['code'];
|
||||
state.countryName.value = result['countryName'];
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
width: 5.w,
|
||||
),
|
||||
Text(
|
||||
TranslationLoader.lanKeys!.countryAndRegion!.tr,
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp,
|
||||
color: AppColors.darkGrayTextColor),
|
||||
),
|
||||
SizedBox(
|
||||
width: 40.w,
|
||||
),
|
||||
Obx(() {
|
||||
return Text(
|
||||
'${state.countryName.value} +${state.countryCode.value}',
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp, color: AppColors.mainColor),
|
||||
);
|
||||
})
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
LoginInput(
|
||||
controller: state.emailOrPhoneController,
|
||||
onchangeAction: (v) {
|
||||
logic.checkNext(state.emailOrPhoneController);
|
||||
},
|
||||
leftWidget: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 30.w,
|
||||
bottom: 20.w,
|
||||
),
|
||||
),
|
||||
rightSlot: IconButton(
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: () {},
|
||||
),
|
||||
label: TranslationLoader
|
||||
.lanKeys!.pleaseEnterNumberOrEmail!.tr,
|
||||
// keyboardType: TextInputType.number,
|
||||
inputFormatters: <TextInputFormatter>[
|
||||
LengthLimitingTextInputFormatter(30),
|
||||
]),
|
||||
LoginInput(
|
||||
controller: state.pwdController,
|
||||
onchangeAction: (v) {
|
||||
logic.checkNext(state.pwdController);
|
||||
},
|
||||
isPwd: true,
|
||||
// isSuffixIcon: 2,
|
||||
leftWidget: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 30.w,
|
||||
bottom: 20.w,
|
||||
),
|
||||
),
|
||||
label:
|
||||
'${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.password!.tr}',
|
||||
inputFormatters: <TextInputFormatter>[
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
]),
|
||||
SizedBox(height: 10.h),
|
||||
],
|
||||
),
|
||||
body: SizedBox(
|
||||
width: Get.width,
|
||||
child: ListView(
|
||||
padding: EdgeInsets.only(
|
||||
top: 110.h,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
state.agree.value = !state.agree.value;
|
||||
logic.changeAgreeState();
|
||||
},
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
padding: EdgeInsets.symmetric(vertical: 30.h, horizontal: 40.w),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 40.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Obx(
|
||||
() => Container(
|
||||
padding: EdgeInsets.only(
|
||||
left: 5.w,
|
||||
right: 10.w,
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Text(
|
||||
'${"欢迎使用".tr}${F.title}',
|
||||
style: TextStyle(
|
||||
color: AppColors.darkGrayTextColor,
|
||||
fontSize: 48.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Image.asset(
|
||||
state.agree.value
|
||||
? 'images/icon_round_select.png'
|
||||
: 'images/icon_round_unSelect.png',
|
||||
width: 20.w,
|
||||
height: 20.w,
|
||||
IconButton(
|
||||
onPressed: CustomerTool.openCustomerService,
|
||||
icon: Icon(
|
||||
Icons.support_agent,
|
||||
color: AppColors.mainColor,
|
||||
)),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 30.h),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
final result =
|
||||
await Get.toNamed(Routers.selectCountryRegionPage);
|
||||
if (result != null) {
|
||||
result as Map<String, dynamic>;
|
||||
state.countryCode.value = result['code'];
|
||||
state.countryName.value = result['countryName'];
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
width: 5.w,
|
||||
),
|
||||
Text(
|
||||
TranslationLoader.lanKeys!.countryAndRegion!.tr,
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp,
|
||||
color: AppColors.darkGrayTextColor),
|
||||
),
|
||||
SizedBox(
|
||||
width: 40.w,
|
||||
),
|
||||
Obx(() {
|
||||
return Text(
|
||||
'${state.countryName.value} +${state.countryCode.value}',
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp,
|
||||
color: AppColors.mainColor),
|
||||
);
|
||||
})
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
text: TranslationLoader.lanKeys!.readAndAgree!.tr,
|
||||
style: TextStyle(
|
||||
color: const Color(0xff333333), fontSize: 20.sp),
|
||||
children: <InlineSpan>[
|
||||
WidgetSpan(
|
||||
alignment: PlaceholderAlignment.middle,
|
||||
child: GestureDetector(
|
||||
child: Text(
|
||||
'《${TranslationLoader.lanKeys!.userAgreement!.tr}》',
|
||||
style: TextStyle(
|
||||
color: AppColors.mainColor,
|
||||
fontSize: 20.sp)),
|
||||
onTap: () {
|
||||
Get.toNamed(Routers.webviewShowPage,
|
||||
arguments: <String, String>{
|
||||
'url': XSConstantMacro.userAgreementURL,
|
||||
'title': '用户协议'.tr
|
||||
});
|
||||
},
|
||||
)),
|
||||
WidgetSpan(
|
||||
alignment: PlaceholderAlignment.middle,
|
||||
child: GestureDetector(
|
||||
child: Text(
|
||||
'《${TranslationLoader.lanKeys!.privacyPolicy!.tr}》',
|
||||
style: TextStyle(
|
||||
color: AppColors.mainColor,
|
||||
fontSize: 20.sp)),
|
||||
onTap: () {
|
||||
Get.toNamed(Routers.webviewShowPage,
|
||||
arguments: <String, String>{
|
||||
'url': XSConstantMacro.privacyPolicyURL,
|
||||
'title': '隐私政策'.tr
|
||||
});
|
||||
},
|
||||
)),
|
||||
],
|
||||
)),
|
||||
)
|
||||
LoginInput(
|
||||
controller: state.emailOrPhoneController,
|
||||
onchangeAction: (v) {
|
||||
logic.checkNext(state.emailOrPhoneController);
|
||||
},
|
||||
leftWidget: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 30.w,
|
||||
bottom: 20.w,
|
||||
),
|
||||
),
|
||||
rightSlot: IconButton(
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: () {},
|
||||
),
|
||||
label: TranslationLoader
|
||||
.lanKeys!.pleaseEnterNumberOrEmail!.tr,
|
||||
// keyboardType: TextInputType.number,
|
||||
inputFormatters: <TextInputFormatter>[
|
||||
LengthLimitingTextInputFormatter(30),
|
||||
]),
|
||||
LoginInput(
|
||||
controller: state.pwdController,
|
||||
onchangeAction: (v) {
|
||||
logic.checkNext(state.pwdController);
|
||||
},
|
||||
isPwd: true,
|
||||
// isSuffixIcon: 2,
|
||||
leftWidget: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 30.w,
|
||||
bottom: 20.w,
|
||||
),
|
||||
),
|
||||
label:
|
||||
'${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.password!.tr}',
|
||||
inputFormatters: <TextInputFormatter>[
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
]),
|
||||
SizedBox(height: 10.h),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 40.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
SizedBox(height: 5.w),
|
||||
Obx(() => SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.login!.tr,
|
||||
fontSize: 28.sp,
|
||||
borderRadius: 20.w,
|
||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
isDisabled: state.canNext.value,
|
||||
onClick: state.canNext.value
|
||||
? () {
|
||||
if (state.agree.value == false) {
|
||||
logic.showToast('请先同意用户协议及隐私政策'.tr);
|
||||
return;
|
||||
} else {
|
||||
logic.login();
|
||||
}
|
||||
}
|
||||
: null)),
|
||||
SizedBox(height: 10.h),
|
||||
SizedBox(
|
||||
width: Get.width,
|
||||
child: ElevatedButton(
|
||||
onPressed: () async {
|
||||
final dynamic data =
|
||||
await Get.toNamed(Routers.starLockRegisterPage);
|
||||
if (data != null) {
|
||||
state.emailOrPhoneController.text =
|
||||
data['phoneOrEmailStr'];
|
||||
logic.checkNext(state.emailOrPhoneController);
|
||||
state.pwdController.text = data['pwd'];
|
||||
logic.checkNext(state.pwdController);
|
||||
setState(() {});
|
||||
}
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppColors.mainColor),
|
||||
child: Text(
|
||||
TranslationLoader.lanKeys!.register!.tr,
|
||||
style: TextStyle(fontSize: 22.sp, color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 5.w),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
state.agree.value = !state.agree.value;
|
||||
logic.changeAgreeState();
|
||||
},
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
padding:
|
||||
EdgeInsets.symmetric(vertical: 30.h, horizontal: 40.w),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
GestureDetector(
|
||||
child: SizedBox(
|
||||
// width: 150.w,
|
||||
height: 50.h,
|
||||
// color: Colors.red,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'${TranslationLoader.lanKeys!.forgetPassword!.tr}?',
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp,
|
||||
color: AppColors.mainColor)),
|
||||
Obx(
|
||||
() => Container(
|
||||
padding: EdgeInsets.only(
|
||||
left: 5.w,
|
||||
right: 10.w,
|
||||
),
|
||||
child: Image.asset(
|
||||
state.agree.value
|
||||
? 'images/icon_round_select.png'
|
||||
: 'images/icon_round_unSelect.png',
|
||||
width: 20.w,
|
||||
height: 20.w,
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pushNamed(
|
||||
context, Routers.starLockForgetPasswordPage);
|
||||
},
|
||||
),
|
||||
Expanded(
|
||||
child: SizedBox(
|
||||
width: 10.sp,
|
||||
)),
|
||||
if (F.isLite)
|
||||
Container()
|
||||
else
|
||||
Row(children: <Widget>[
|
||||
Text(TranslationLoader.lanKeys!.readAndAgree!.tr,
|
||||
style: TextStyle(
|
||||
color: const Color(0xff333333),
|
||||
fontSize: 20.sp)),
|
||||
GestureDetector(
|
||||
child: Text(
|
||||
'《${TranslationLoader.lanKeys!.userAgreement!.tr}》',
|
||||
style: TextStyle(
|
||||
color: AppColors.mainColor,
|
||||
fontSize: 20.sp)),
|
||||
onTap: () {
|
||||
Get.toNamed(Routers.webviewShowPage,
|
||||
arguments: <String, String>{
|
||||
'url': XSConstantMacro.userAgreementURL,
|
||||
'title': '用户协议'.tr
|
||||
});
|
||||
},
|
||||
),
|
||||
GestureDetector(
|
||||
child: Text(
|
||||
'《${TranslationLoader.lanKeys!.privacyPolicy!.tr}》',
|
||||
style: TextStyle(
|
||||
color: AppColors.mainColor,
|
||||
fontSize: 20.sp)),
|
||||
onTap: () {
|
||||
Get.toNamed(Routers.webviewShowPage,
|
||||
arguments: <String, String>{
|
||||
'url': XSConstantMacro.privacyPolicyURL,
|
||||
'title': '隐私政策'.tr
|
||||
});
|
||||
},
|
||||
),
|
||||
]),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 40.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
SizedBox(height: 5.w),
|
||||
Obx(() => SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.login!.tr,
|
||||
fontSize: 28.sp,
|
||||
borderRadius: 20.w,
|
||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
isDisabled: state.canNext.value,
|
||||
onClick: state.canNext.value
|
||||
? () {
|
||||
if (state.agree.value == false) {
|
||||
logic.showToast('请先同意用户协议及隐私政策'.tr);
|
||||
return;
|
||||
} else {
|
||||
logic.login();
|
||||
}
|
||||
}
|
||||
: null)),
|
||||
SizedBox(height: 10.h),
|
||||
SizedBox(
|
||||
width: Get.width,
|
||||
child: ElevatedButton(
|
||||
onPressed: () async {
|
||||
final dynamic data =
|
||||
await Get.toNamed(Routers.starLockRegisterPage);
|
||||
if (data != null) {
|
||||
state.emailOrPhoneController.text =
|
||||
data['phoneOrEmailStr'];
|
||||
logic.checkNext(state.emailOrPhoneController);
|
||||
state.pwdController.text = data['pwd'];
|
||||
logic.checkNext(state.pwdController);
|
||||
setState(() {});
|
||||
}
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppColors.mainColor),
|
||||
child: Text(
|
||||
TranslationLoader.lanKeys!.register!.tr,
|
||||
style:
|
||||
TextStyle(fontSize: 22.sp, color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 5.w),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
GestureDetector(
|
||||
child: SizedBox(
|
||||
// width: 150.w,
|
||||
height: 50.h,
|
||||
// color: Colors.red,
|
||||
child: Center(
|
||||
child: Text('演示模式'.tr,
|
||||
child: Text(
|
||||
'${TranslationLoader.lanKeys!.forgetPassword!.tr}?',
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp,
|
||||
color: AppColors.mainColor)),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
Get.toNamed(Routers.demoModeLockDetailPage);
|
||||
Navigator.pushNamed(
|
||||
context, Routers.starLockForgetPasswordPage);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Expanded(
|
||||
child: SizedBox(
|
||||
width: 10.sp,
|
||||
)),
|
||||
if (F.isLite)
|
||||
Container()
|
||||
else
|
||||
GestureDetector(
|
||||
child: SizedBox(
|
||||
// width: 150.w,
|
||||
height: 50.h,
|
||||
// color: Colors.red,
|
||||
child: Center(
|
||||
child: Text('演示模式'.tr,
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp,
|
||||
color: AppColors.mainColor)),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
Get.toNamed(Routers.demoModeLockDetailPage);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@ -1,14 +1,16 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_bugly_plugin/flutter_bugly_plugin.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/mine/about/debug/debug_tool.dart';
|
||||
import 'package:star_lock/network/api_provider.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/bugly/bugly_tool.dart';
|
||||
import 'package:star_lock/tools/device_info_service.dart';
|
||||
import 'package:star_lock/tools/platform_info_services.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:star_lock/tools/xs_jPhush.dart';
|
||||
import 'package:star_lock/translations/trans_lib.dart';
|
||||
|
||||
@ -25,12 +27,20 @@ FutureOr<void> main() async {
|
||||
// 设置国际化信息
|
||||
await _initTranslation();
|
||||
|
||||
// bugly错误日志监控
|
||||
await BuglyTool.init();
|
||||
final bool isLogin = await getLoginStatus();
|
||||
if (isLogin) {
|
||||
await privacySDKInitialization();
|
||||
Future<void>.delayed(const Duration(milliseconds: 500), getAppInfo);
|
||||
}
|
||||
|
||||
await XSJPushProvider().initJPushService();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
final bool? openDeBug = await Storage.getBool(isOpenDeBug);
|
||||
if (openDeBug == true) {
|
||||
DeBug.showFloatWidget();
|
||||
}
|
||||
});
|
||||
|
||||
runApp(const MyApp());
|
||||
runApp(MyApp(isLogin: isLogin));
|
||||
|
||||
if (AppPlatform.isAndroid) {
|
||||
const SystemUiOverlayStyle systemUiOverlayStyle =
|
||||
@ -40,16 +50,18 @@ FutureOr<void> main() async {
|
||||
}
|
||||
|
||||
// 设置国际化信息
|
||||
Future _initTranslation() async => TranslationLoader.loadTranslation(
|
||||
Future<void> _initTranslation() async => TranslationLoader.loadTranslation(
|
||||
zhSource: 'images/lan/lan_zh.json',
|
||||
enSource: 'images/lan/lan_en.json',
|
||||
keySource: 'images/lan/lan_keys.json',
|
||||
);
|
||||
|
||||
// 设置包名服务设备信息
|
||||
Future _setCommonServices() async {
|
||||
Future<void> _setCommonServices() async {
|
||||
await Get.putAsync(() => StoreService().init());
|
||||
await Get.putAsync(() => PlatformInfoService().init());
|
||||
Get.put(ApiProvider());
|
||||
Get.put(ApiRepository(Get.find<ApiProvider>()));
|
||||
if (F.isLite) {
|
||||
//上架审核注释 获取设备信息
|
||||
// await Get.putAsync(() => DeviceInfoService().init());
|
||||
@ -57,3 +69,9 @@ Future _setCommonServices() async {
|
||||
await Get.putAsync(() => DeviceInfoService().init());
|
||||
}
|
||||
}
|
||||
|
||||
//关于隐私协议的初始化
|
||||
Future<void> privacySDKInitialization() async {
|
||||
await BuglyTool.init();
|
||||
await XSJPushProvider().initJPushService();
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:star_lock/app.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/login/login/app_get_version.dart';
|
||||
import 'package:star_lock/login/login/starLock_login_page.dart';
|
||||
@ -23,12 +24,7 @@ class _StarLockApplicationState extends State<StarLockApplication> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
bool? openDeBug = await Storage.getBool(isOpenDeBug);
|
||||
if (openDeBug == true) {
|
||||
DeBug.showFloatWidget();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
@ -37,7 +33,7 @@ class _StarLockApplicationState extends State<StarLockApplication> {
|
||||
|
||||
return FutureBuilder<bool>(
|
||||
future: getLoginStatus(),
|
||||
builder: (context, snapshot) {
|
||||
builder: (BuildContext context, AsyncSnapshot<bool> snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
// 如果异步操作尚未完成,返回一个加载指示器或其他等待状态的小部件
|
||||
return const CircularProgressIndicator();
|
||||
@ -66,23 +62,5 @@ class _StarLockApplicationState extends State<StarLockApplication> {
|
||||
);
|
||||
}
|
||||
|
||||
Future<bool> getLoginStatus() async {
|
||||
final data = await Storage.getString(saveUserLoginData);
|
||||
if (data != null && data.isNotEmpty) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Future<void> getAgreePrivacyShowUpdate() async {
|
||||
final data = await Storage.getString(isAgreePrivacy);
|
||||
if (data == isAgreePrivacy) {
|
||||
AppFirstEnterHandle().getAppFirstEnter(isShowUpdateVersion);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> getAppInfo() async {
|
||||
final GetAppInfo entity = await ApiRepository.to.getAppInfo();
|
||||
CustomerTool.init(entity.data?.wechatServiceUrl ?? '');
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,14 +6,18 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/login/login/app_get_version.dart';
|
||||
import 'package:star_lock/main.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/customer_tool.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
import '../versionUndate/versionUndateTool.dart';
|
||||
import 'bugly/bugly_tool.dart';
|
||||
import 'xs_jPhush.dart';
|
||||
|
||||
class AppFirstEnterHandle {
|
||||
Future<void> getAppFirstEnter(String flagStr) async {
|
||||
@ -24,6 +28,7 @@ class AppFirstEnterHandle {
|
||||
await showPrivacyAgreementAlert();
|
||||
}
|
||||
getAppInfo();
|
||||
await privacySDKInitialization();
|
||||
break;
|
||||
case isAgreePosition: // 位置权限
|
||||
if (getFlag != isAgreePosition) {
|
||||
@ -49,7 +54,7 @@ class AppFirstEnterHandle {
|
||||
Future<void> showPrivacyAgreementAlert() async {
|
||||
await showCupertinoDialog(
|
||||
context: Get.context!,
|
||||
builder: (context) {
|
||||
builder: (BuildContext context) {
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
child: F.sw(
|
||||
@ -72,7 +77,7 @@ class AppFirstEnterHandle {
|
||||
TextSpan(
|
||||
text: '感谢您使用本应用。我们非常重视您的个人信息和隐私保护,在使用本产品之前,请认真阅读'.tr,
|
||||
style: const TextStyle(fontSize: 16.0),
|
||||
children: [
|
||||
children: <InlineSpan>[
|
||||
TextSpan(
|
||||
text: '《用户协议》'.tr,
|
||||
style: const TextStyle(
|
||||
@ -80,7 +85,7 @@ class AppFirstEnterHandle {
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
// 处理用户协议点击事件
|
||||
Get.toNamed(Routers.webviewShowPage, arguments: {
|
||||
Get.toNamed(Routers.webviewShowPage, arguments: <String, String>{
|
||||
"url": XSConstantMacro.userAgreementURL,
|
||||
"title": '用户协议'.tr
|
||||
});
|
||||
@ -94,7 +99,7 @@ class AppFirstEnterHandle {
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
// 处理隐私政策点击事件
|
||||
Get.toNamed(Routers.webviewShowPage, arguments: {
|
||||
Get.toNamed(Routers.webviewShowPage, arguments: <String, String>{
|
||||
"url": XSConstantMacro.privacyPolicyURL,
|
||||
"title": '隐私政策'.tr
|
||||
});
|
||||
@ -106,15 +111,13 @@ class AppFirstEnterHandle {
|
||||
],
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
actions: <Widget>[
|
||||
CupertinoDialogAction(
|
||||
child: Text(
|
||||
'不同意'.tr,
|
||||
style: TextStyle(color: Colors.black),
|
||||
),
|
||||
onPressed: () {
|
||||
_exitApp();
|
||||
},
|
||||
onPressed: _exitApp,
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: Text(
|
||||
@ -140,7 +143,7 @@ class AppFirstEnterHandle {
|
||||
TextSpan(
|
||||
text: '感谢您使用本应用。我们非常重视您的个人信息和隐私保护,在使用本产品之前,请认真阅读'.tr,
|
||||
style: const TextStyle(fontSize: 16.0),
|
||||
children: [
|
||||
children: <InlineSpan>[
|
||||
TextSpan(
|
||||
text: '《用户协议》'.tr,
|
||||
style: TextStyle(
|
||||
@ -149,7 +152,7 @@ class AppFirstEnterHandle {
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
// 处理用户协议点击事件
|
||||
Get.toNamed(Routers.webviewShowPage, arguments: {
|
||||
Get.toNamed(Routers.webviewShowPage, arguments: <String, String>{
|
||||
"url": XSConstantMacro.userAgreementURL,
|
||||
"title": '用户协议'.tr
|
||||
});
|
||||
@ -164,7 +167,7 @@ class AppFirstEnterHandle {
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
// 处理隐私政策点击事件
|
||||
Get.toNamed(Routers.webviewShowPage, arguments: {
|
||||
Get.toNamed(Routers.webviewShowPage, arguments: <String, String>{
|
||||
"url": XSConstantMacro.privacyPolicyURL,
|
||||
"title": '隐私政策'.tr
|
||||
});
|
||||
@ -176,15 +179,13 @@ class AppFirstEnterHandle {
|
||||
],
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
actions: <Widget>[
|
||||
CupertinoDialogAction(
|
||||
child: Text(
|
||||
'不同意'.tr,
|
||||
style: TextStyle(color: Colors.black),
|
||||
),
|
||||
onPressed: () {
|
||||
_exitApp();
|
||||
},
|
||||
onPressed: _exitApp,
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: Text(
|
||||
@ -205,13 +206,13 @@ class AppFirstEnterHandle {
|
||||
void showPositionAlert() {
|
||||
showCupertinoDialog(
|
||||
context: Get.context!,
|
||||
builder: (context) {
|
||||
builder: (BuildContext context) {
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
child: CupertinoAlertDialog(
|
||||
title: const Text('位置权限'),
|
||||
content: const Text('请开启位置权限,应用需要位置权限才可以完成智能锁和网关的蓝牙操作'),
|
||||
actions: [
|
||||
actions: <Widget>[
|
||||
CupertinoDialogAction(
|
||||
child: Text('取消'.tr),
|
||||
onPressed: () {
|
||||
@ -235,13 +236,13 @@ class AppFirstEnterHandle {
|
||||
void showCameraAlert() {
|
||||
showCupertinoDialog(
|
||||
context: Get.context!,
|
||||
builder: (context) {
|
||||
builder: (BuildContext context) {
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
child: CupertinoAlertDialog(
|
||||
title: const Text('相机/相册权限'),
|
||||
content: const Text('请开启本地存储权限,允许应用读写设备上的照片及文件'),
|
||||
actions: [
|
||||
actions: <Widget>[
|
||||
CupertinoDialogAction(
|
||||
child: const Text('取消'),
|
||||
onPressed: () {
|
||||
|
||||
@ -7,8 +7,6 @@ import '../../network/api_repository.dart';
|
||||
class AppBindings extends Bindings {
|
||||
@override
|
||||
void dependencies() {
|
||||
Get.put(ApiProvider());
|
||||
Get.put(ApiRepository(Get.find<ApiProvider>()));
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user