1,修复非首次进入APP也会显示隐私协议框问题
2,高级功能点击购买直接进入高级功能购买网页而非shop页面 3,解决授权管理员列表的管理员应提示要开高级功能否则不可进入管理员详情
This commit is contained in:
parent
93cbbb7ae7
commit
e8458be2c6
@ -4,6 +4,7 @@ import 'package:flutter_slidable/flutter_slidable.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/mine/mineSet/authorizedAdministrator/authorizedAdministrator/authorizedAdminListEntity.dart';
|
import 'package:star_lock/mine/mineSet/authorizedAdministrator/authorizedAdministrator/authorizedAdminListEntity.dart';
|
||||||
import 'package:star_lock/tools/noData.dart';
|
import 'package:star_lock/tools/noData.dart';
|
||||||
|
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
||||||
|
|
||||||
import '../../../../../appRouters.dart';
|
import '../../../../../appRouters.dart';
|
||||||
import '../../../../../app_settings/app_colors.dart';
|
import '../../../../../app_settings/app_colors.dart';
|
||||||
@ -23,14 +24,15 @@ class AuthorizedAdministratorListPage extends StatefulWidget {
|
|||||||
_AuthorizedAdministratorListPageState();
|
_AuthorizedAdministratorListPageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _AuthorizedAdministratorListPageState extends State<AuthorizedAdministratorListPage> {
|
class _AuthorizedAdministratorListPageState
|
||||||
|
extends State<AuthorizedAdministratorListPage> {
|
||||||
final logic = Get.put(AuthorizedAdministratorListLogic());
|
final logic = Get.put(AuthorizedAdministratorListLogic());
|
||||||
final state = Get.find<AuthorizedAdministratorListLogic>().state;
|
final state = Get.find<AuthorizedAdministratorListLogic>().state;
|
||||||
|
|
||||||
Future<void> getHttpData() async {
|
Future<void> getHttpData() async {
|
||||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
if (isDemoMode == false) {
|
if (isDemoMode == false) {
|
||||||
logic.mockNetworkDataRequest().then((AuthorizedAdminListEntity value){
|
logic.mockNetworkDataRequest().then((AuthorizedAdminListEntity value) {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -60,7 +62,9 @@ class _AuthorizedAdministratorListPageState extends State<AuthorizedAdministrato
|
|||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
// 处理操作按钮的点击事件
|
// 处理操作按钮的点击事件
|
||||||
Navigator.pushNamed(context, Routers.addAuthorizedAdministratorPage).then((value) {
|
Navigator.pushNamed(
|
||||||
|
context, Routers.addAuthorizedAdministratorPage)
|
||||||
|
.then((value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
logic.pageNo = 1;
|
logic.pageNo = 1;
|
||||||
getHttpData();
|
getHttpData();
|
||||||
@ -71,119 +75,98 @@ class _AuthorizedAdministratorListPageState extends State<AuthorizedAdministrato
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: EasyRefreshTool(
|
body: EasyRefreshTool(
|
||||||
onRefresh: (){
|
onRefresh: () {
|
||||||
logic.pageNo = 1;
|
logic.pageNo = 1;
|
||||||
getHttpData();
|
getHttpData();
|
||||||
},
|
},
|
||||||
onLoad: (){
|
onLoad: () {
|
||||||
getHttpData();
|
getHttpData();
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
// _searchWidget(),
|
// _searchWidget(),
|
||||||
Expanded(child: _buildMainUI()),
|
Expanded(child: _buildMainUI()),
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Widget _searchWidget() {
|
|
||||||
// return Container(
|
|
||||||
// height: 60.h,
|
|
||||||
// margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 10.w),
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// color: Colors.white, borderRadius: BorderRadius.circular(5)),
|
|
||||||
// child: TextField(
|
|
||||||
// //输入框一行
|
|
||||||
// maxLines: 1,
|
|
||||||
// // controller: _controller,
|
|
||||||
// autofocus: false,
|
|
||||||
//
|
|
||||||
// decoration: InputDecoration(
|
|
||||||
// //输入里面输入文字内边距设置
|
|
||||||
// contentPadding: const EdgeInsets.only(
|
|
||||||
// top: 12.0, left: -19.0, right: -15.0, bottom: 8.0),
|
|
||||||
// hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
|
||||||
// hintStyle: TextStyle(fontSize: 22.sp, height: 3.0),
|
|
||||||
// //不需要输入框下划线
|
|
||||||
// border: InputBorder.none,
|
|
||||||
// //左边图标设置
|
|
||||||
// icon: Padding(
|
|
||||||
// padding: EdgeInsets.only(
|
|
||||||
// top: 20.h, bottom: 20.h, right: 20.w, left: 10.w),
|
|
||||||
// child: Image.asset(
|
|
||||||
// 'images/main/icon_main_search.png',
|
|
||||||
// width: 40.w,
|
|
||||||
// height: 40.w,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
Widget _buildMainUI() {
|
Widget _buildMainUI() {
|
||||||
return Obx(() => state.itemDataList.value.isEmpty
|
return Obx(() => state.itemDataList.value.isEmpty
|
||||||
? NoData(noDataHeight: 1.sh - ScreenUtil().statusBarHeight - ScreenUtil().bottomBarHeight - 190.h - 64.h)
|
? NoData(
|
||||||
|
noDataHeight: 1.sh -
|
||||||
|
ScreenUtil().statusBarHeight -
|
||||||
|
ScreenUtil().bottomBarHeight -
|
||||||
|
190.h -
|
||||||
|
64.h)
|
||||||
: SlidableAutoCloseBehavior(
|
: SlidableAutoCloseBehavior(
|
||||||
child: ListView.separated(
|
child: ListView.separated(
|
||||||
itemCount: state.itemDataList.value.length,
|
itemCount: state.itemDataList.value.length,
|
||||||
itemBuilder: (c, index) {
|
itemBuilder: (c, index) {
|
||||||
AuthorizedAdminListItem authorizedAdminListItem = state.itemDataList.value[index];
|
AuthorizedAdminListItem authorizedAdminListItem =
|
||||||
|
state.itemDataList.value[index];
|
||||||
|
|
||||||
return Slidable(
|
return Slidable(
|
||||||
key:ValueKey(authorizedAdminListItem.uid),
|
key: ValueKey(authorizedAdminListItem.uid),
|
||||||
endActionPane: ActionPane(
|
endActionPane: ActionPane(
|
||||||
extentRatio: 0.2,
|
extentRatio: 0.2,
|
||||||
motion: const ScrollMotion(),
|
motion: const ScrollMotion(),
|
||||||
children: [
|
children: [
|
||||||
SlidableAction(
|
SlidableAction(
|
||||||
onPressed: (BuildContext context){
|
onPressed: (BuildContext context) {
|
||||||
ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时删除其发送的所有钥匙,钥匙删除后不能恢复', (isAllData) {
|
ShowTipView()
|
||||||
logic.deleteAdministratorRequest(authorizedAdminListItem.uid.toString(), isAllData ? 1 : 0);
|
.showDeleteAdministratorIsHaveAllDataDialog(
|
||||||
});
|
'同时删除其发送的所有钥匙,钥匙删除后不能恢复', (isAllData) {
|
||||||
},
|
logic.deleteAdministratorRequest(
|
||||||
backgroundColor: Colors.red,
|
authorizedAdminListItem.uid.toString(),
|
||||||
foregroundColor: Colors.white,
|
isAllData ? 1 : 0);
|
||||||
label: '删除',
|
});
|
||||||
padding: EdgeInsets.only(left: 5.w, right: 5.w),
|
},
|
||||||
),
|
backgroundColor: Colors.red,
|
||||||
],
|
foregroundColor: Colors.white,
|
||||||
|
label: '删除',
|
||||||
|
padding: EdgeInsets.only(left: 5.w, right: 5.w),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: _electronicKeyItem(authorizedAdminListItem),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
|
return const Divider(
|
||||||
|
height: 1,
|
||||||
|
color: AppColors.greyLineColor,
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
child: _electronicKeyItem(authorizedAdminListItem),
|
));
|
||||||
);
|
|
||||||
},
|
|
||||||
separatorBuilder: (BuildContext context, int index) {
|
|
||||||
return const Divider(
|
|
||||||
height: 1,
|
|
||||||
color: AppColors.greyLineColor,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _electronicKeyItem(AuthorizedAdminListItem itemData) {
|
Widget _electronicKeyItem(AuthorizedAdminListItem itemData) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () async {
|
||||||
Navigator.pushNamed(context, Routers.administratorDetailsPage, arguments: {'itemData': itemData}).then((value) {
|
//高级功能
|
||||||
setState(() {
|
var isVip = await Storage.getBool(saveIsVip);
|
||||||
logic.pageNo = 1;
|
if (isVip == true) {
|
||||||
getHttpData();
|
Get.toNamed(Routers.administratorDetailsPage,
|
||||||
|
arguments: {'itemData': itemData})?.then((value) {
|
||||||
|
setState(() {
|
||||||
|
logic.pageNo = 1;
|
||||||
|
getHttpData();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
} else {
|
||||||
|
ShowCupertinoAlertView().advancedFeatureAlert();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 100.h,
|
height: 100.h,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
// margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w),
|
|
||||||
// decoration: const BoxDecoration(
|
|
||||||
// color: Colors.white,
|
|
||||||
// borderRadius: BorderRadius.circular(10.w),
|
|
||||||
// ),
|
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(width: 30.w,),
|
SizedBox(
|
||||||
|
width: 30.w,
|
||||||
|
),
|
||||||
Image.asset('images/controls_user.png', width: 60.w, height: 60.w),
|
Image.asset('images/controls_user.png', width: 60.w, height: 60.w),
|
||||||
SizedBox(width: 20.w),
|
SizedBox(width: 20.w),
|
||||||
Expanded(
|
Expanded(
|
||||||
@ -193,24 +176,18 @@ class _AuthorizedAdministratorListPageState extends State<AuthorizedAdministrato
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
// Text(
|
|
||||||
// itemData.name ?? '',
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize: 24.sp, color: AppColors.blackColor),
|
|
||||||
// ),
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 1.sw - 110.w - 100.w,
|
width: 1.sw - 110.w - 100.w,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Text(
|
child: Text(itemData.name ?? '',
|
||||||
itemData.name ?? '',
|
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor)
|
style: TextStyle(
|
||||||
),
|
fontSize: 24.sp,
|
||||||
|
color: AppColors.blackColor)),
|
||||||
),
|
),
|
||||||
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -243,5 +220,4 @@ class _AuthorizedAdministratorListPageState extends State<AuthorizedAdministrato
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
|||||||
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireElectronicKey/expireLockList_entity.dart';
|
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireElectronicKey/expireLockList_entity.dart';
|
||||||
import 'package:star_lock/mine/mineSet/mineSet/mineSet_state.dart';
|
import 'package:star_lock/mine/mineSet/mineSet/mineSet_state.dart';
|
||||||
import 'package:star_lock/mine/mineSet/mineSet/weChatQRCodeEntity.dart';
|
import 'package:star_lock/mine/mineSet/mineSet/weChatQRCodeEntity.dart';
|
||||||
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
||||||
import 'package:star_lock/tools/storage.dart';
|
import 'package:star_lock/tools/storage.dart';
|
||||||
import 'package:star_lock/tools/xs_jPhush.dart';
|
import 'package:star_lock/tools/xs_jPhush.dart';
|
||||||
import 'package:star_lock/versionUndate/versionUndate_entity.dart';
|
import 'package:star_lock/versionUndate/versionUndate_entity.dart';
|
||||||
@ -85,7 +85,7 @@ class MineSetLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void showQRImageAlert(String qrCodeUrl, BuildContext widgetContext) {
|
void showQRImageAlert(String qrCodeUrl, BuildContext widgetContext) {
|
||||||
AppFirstEnterHandle().showQRImageAlert(widgetContext, qrCodeUrl);
|
ShowCupertinoAlertView().showQRImageAlert(widgetContext, qrCodeUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
//退出登录请求
|
//退出登录请求
|
||||||
|
|||||||
@ -23,8 +23,8 @@ class AdvancedFeaturesWebLogic extends BaseGetXController {
|
|||||||
AdvancedFeaturesWebEntity entity =
|
AdvancedFeaturesWebEntity entity =
|
||||||
await ApiRepository.to.getServicePackageBuyUrl();
|
await ApiRepository.to.getServicePackageBuyUrl();
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
state.vipBuyUrl.value = state.isShop.value == true
|
state.vipBuyUrl.value = state.isVipShop.value == true
|
||||||
? entity.data!.shopList!
|
? entity.data!.vipBuyUrl!
|
||||||
: entity.data!.cloudauthBuyUrl!;
|
: entity.data!.cloudauthBuyUrl!;
|
||||||
state.vipBuyWebView.setNavigationDelegate(
|
state.vipBuyWebView.setNavigationDelegate(
|
||||||
NavigationDelegate(
|
NavigationDelegate(
|
||||||
|
|||||||
@ -32,8 +32,9 @@ class _AdvancedFeaturesWebPageState extends State<AdvancedFeaturesWebPage> {
|
|||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
backgroundColor: const Color(0xFFFFFFFF),
|
backgroundColor: const Color(0xFFFFFFFF),
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
barTitle:
|
barTitle: logic.state.isVipShop.value == true
|
||||||
logic.state.isShop.value == true ? '高级功能'.tr : '实名认证'.tr,
|
? '高级功能'.tr
|
||||||
|
: '实名认证'.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor,
|
backgroundColor: AppColors.mainColor,
|
||||||
backAction: () => logic.canGoBack(false),
|
backAction: () => logic.canGoBack(false),
|
||||||
|
|||||||
@ -8,7 +8,7 @@ class AdvancedFeaturesWebState {
|
|||||||
var webProgress = 0.0.obs;
|
var webProgress = 0.0.obs;
|
||||||
bool allowReturn = true;
|
bool allowReturn = true;
|
||||||
late WebViewController vipBuyWebView = initWebViewController();
|
late WebViewController vipBuyWebView = initWebViewController();
|
||||||
var isShop = true.obs; //是否为高级功能购买页面
|
var isVipShop = true.obs; //是否为高级功能购买页面
|
||||||
bool canGoBack = false;
|
bool canGoBack = false;
|
||||||
|
|
||||||
//初始化webView控制器
|
//初始化webView控制器
|
||||||
@ -23,7 +23,7 @@ class AdvancedFeaturesWebState {
|
|||||||
AdvancedFeaturesWebState() {
|
AdvancedFeaturesWebState() {
|
||||||
Map map = Get.arguments;
|
Map map = Get.arguments;
|
||||||
if (map['isShop'] != null) {
|
if (map['isShop'] != null) {
|
||||||
isShop.value = map['isShop'];
|
isVipShop.value = map['isShop'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
|
||||||
import 'package:star_lock/flavors.dart';
|
import 'package:star_lock/flavors.dart';
|
||||||
import 'package:star_lock/login/login/starLock_login_page.dart';
|
import 'package:star_lock/login/login/starLock_login_page.dart';
|
||||||
import 'package:star_lock/login/login/starLock_login_xhj_page.dart';
|
import 'package:star_lock/login/login/starLock_login_xhj_page.dart';
|
||||||
@ -31,7 +30,6 @@ class _StarLockApplicationState extends State<StarLockApplication> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
AppFirstEnterHandle().getAppFirstEnter(context, isAgreePrivacy);
|
|
||||||
getAgreePrivacyShowUpdate();
|
getAgreePrivacyShowUpdate();
|
||||||
|
|
||||||
return FutureBuilder<bool>(
|
return FutureBuilder<bool>(
|
||||||
@ -48,6 +46,8 @@ class _StarLockApplicationState extends State<StarLockApplication> {
|
|||||||
xhjCall: () => const StarLockMainXHJPage());
|
xhjCall: () => const StarLockMainXHJPage());
|
||||||
} else {
|
} else {
|
||||||
// 如果用户未登录,返回登录页面
|
// 如果用户未登录,返回登录页面
|
||||||
|
AppFirstEnterHandle().getAppFirstEnter(isAgreePrivacy);
|
||||||
|
|
||||||
return F.sw(
|
return F.sw(
|
||||||
defaultCall: () => const StarLockLoginPage(),
|
defaultCall: () => const StarLockLoginPage(),
|
||||||
xhjCall: () => const StarLockLoginXHJPage());
|
xhjCall: () => const StarLockLoginXHJPage());
|
||||||
@ -73,7 +73,7 @@ class _StarLockApplicationState extends State<StarLockApplication> {
|
|||||||
Future<void> getAgreePrivacyShowUpdate() async {
|
Future<void> getAgreePrivacyShowUpdate() async {
|
||||||
final data = await Storage.getString(isAgreePrivacy);
|
final data = await Storage.getString(isAgreePrivacy);
|
||||||
if (data == isAgreePrivacy) {
|
if (data == isAgreePrivacy) {
|
||||||
AppFirstEnterHandle().getAppFirstEnter(context, isShowUpdateVersion);
|
AppFirstEnterHandle().getAppFirstEnter(isShowUpdateVersion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,6 @@ import 'dart:io';
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/appRouters.dart';
|
import 'package:star_lock/appRouters.dart';
|
||||||
import 'package:star_lock/app_settings/app_colors.dart';
|
import 'package:star_lock/app_settings/app_colors.dart';
|
||||||
@ -14,24 +13,24 @@ import 'package:star_lock/tools/storage.dart';
|
|||||||
import '../versionUndate/versionUndateTool.dart';
|
import '../versionUndate/versionUndateTool.dart';
|
||||||
|
|
||||||
class AppFirstEnterHandle {
|
class AppFirstEnterHandle {
|
||||||
Future getAppFirstEnter(BuildContext widgetContext, String flagStr) async {
|
Future getAppFirstEnter(String flagStr) async {
|
||||||
var getFlag = await Storage.getString(flagStr);
|
var getFlag = await Storage.getString(flagStr);
|
||||||
switch (flagStr) {
|
switch (flagStr) {
|
||||||
case isAgreePrivacy: // 隐私协议
|
case isAgreePrivacy: // 隐私协议
|
||||||
{
|
{
|
||||||
if (getFlag != isAgreePrivacy) {
|
if (getFlag != isAgreePrivacy) {
|
||||||
showPrivacyAgreementAlert(widgetContext);
|
showPrivacyAgreementAlert();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case isAgreePosition: // 位置权限
|
case isAgreePosition: // 位置权限
|
||||||
{
|
{
|
||||||
if (getFlag != isAgreePosition) showPositionAlert(widgetContext);
|
if (getFlag != isAgreePosition) showPositionAlert();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case isAgreeCamera: // 相机权限
|
case isAgreeCamera: // 相机权限
|
||||||
{
|
{
|
||||||
if (getFlag != isAgreeCamera) showCameraAlert(widgetContext);
|
if (getFlag != isAgreeCamera) showCameraAlert();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case isShowUpdateVersion: // 版本更新
|
case isShowUpdateVersion: // 版本更新
|
||||||
@ -45,9 +44,9 @@ class AppFirstEnterHandle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//隐私协议弹窗
|
//隐私协议弹窗
|
||||||
void showPrivacyAgreementAlert(BuildContext widgetContext) {
|
void showPrivacyAgreementAlert() {
|
||||||
showCupertinoDialog(
|
showCupertinoDialog(
|
||||||
context: widgetContext,
|
context: Get.context!,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return PopScope(
|
return PopScope(
|
||||||
canPop: false,
|
canPop: false,
|
||||||
@ -118,7 +117,7 @@ class AppFirstEnterHandle {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
Storage.setString(isAgreePrivacy, isAgreePrivacy);
|
Storage.setString(isAgreePrivacy, isAgreePrivacy);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
getAppFirstEnter(context, isShowUpdateVersion);
|
getAppFirstEnter(isShowUpdateVersion);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -188,7 +187,7 @@ class AppFirstEnterHandle {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
Storage.setString(isAgreePrivacy, isAgreePrivacy);
|
Storage.setString(isAgreePrivacy, isAgreePrivacy);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
getAppFirstEnter(context, isShowUpdateVersion);
|
getAppFirstEnter(isShowUpdateVersion);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -196,9 +195,9 @@ class AppFirstEnterHandle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//位置权限弹窗
|
//位置权限弹窗
|
||||||
void showPositionAlert(BuildContext widgetContext) {
|
void showPositionAlert() {
|
||||||
showCupertinoDialog(
|
showCupertinoDialog(
|
||||||
context: widgetContext,
|
context: Get.context!,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return PopScope(
|
return PopScope(
|
||||||
canPop: false,
|
canPop: false,
|
||||||
@ -226,9 +225,9 @@ class AppFirstEnterHandle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//相机权限弹窗
|
//相机权限弹窗
|
||||||
void showCameraAlert(BuildContext widgetContext) {
|
void showCameraAlert() {
|
||||||
showCupertinoDialog(
|
showCupertinoDialog(
|
||||||
context: widgetContext,
|
context: Get.context!,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return PopScope(
|
return PopScope(
|
||||||
canPop: false,
|
canPop: false,
|
||||||
@ -255,55 +254,6 @@ class AppFirstEnterHandle {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
//微信公众号二维码弹窗
|
|
||||||
void showQRImageAlert(BuildContext widgetContext, String qrCodeUrl) {
|
|
||||||
showCupertinoModalPopup(
|
|
||||||
context: widgetContext,
|
|
||||||
builder: (context) {
|
|
||||||
return CupertinoActionSheet(
|
|
||||||
actions: [
|
|
||||||
Container(
|
|
||||||
color: Colors.white, // 设置底色为白色
|
|
||||||
child: CupertinoActionSheetAction(
|
|
||||||
child: Container(
|
|
||||||
margin: const EdgeInsets.all(0),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
height: 60.h,
|
|
||||||
),
|
|
||||||
Image.network(
|
|
||||||
qrCodeUrl,
|
|
||||||
width: 400.w,
|
|
||||||
height: 400.w,
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 20.h,
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.only(left: 60.w, right: 60.w),
|
|
||||||
child: Text(
|
|
||||||
'开启微信接收报警消息需要先关注斯凯智能锁微信公众号,请保存二维码并使用微信扫一扫设置'.tr,
|
|
||||||
style:
|
|
||||||
TextStyle(fontSize: 24.sp, color: Colors.black),
|
|
||||||
)),
|
|
||||||
SizedBox(
|
|
||||||
height: 60.h,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// _launchURL(String url) async {
|
// _launchURL(String url) async {
|
||||||
// if (await canLaunchUrl(Uri.parse(url))) {
|
// if (await canLaunchUrl(Uri.parse(url))) {
|
||||||
// await launchUrl(Uri.parse(url));
|
// await launchUrl(Uri.parse(url));
|
||||||
|
|||||||
@ -8,6 +8,55 @@ import 'package:star_lock/app_settings/app_colors.dart';
|
|||||||
typedef AuthInfoCallback = void Function(String idCard, String name);
|
typedef AuthInfoCallback = void Function(String idCard, String name);
|
||||||
|
|
||||||
class ShowCupertinoAlertView {
|
class ShowCupertinoAlertView {
|
||||||
|
//微信公众号二维码弹窗
|
||||||
|
void showQRImageAlert(BuildContext widgetContext, String qrCodeUrl) {
|
||||||
|
showCupertinoModalPopup(
|
||||||
|
context: widgetContext,
|
||||||
|
builder: (context) {
|
||||||
|
return CupertinoActionSheet(
|
||||||
|
actions: [
|
||||||
|
Container(
|
||||||
|
color: Colors.white, // 设置底色为白色
|
||||||
|
child: CupertinoActionSheetAction(
|
||||||
|
child: Container(
|
||||||
|
margin: const EdgeInsets.all(0),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
height: 60.h,
|
||||||
|
),
|
||||||
|
Image.network(
|
||||||
|
qrCodeUrl,
|
||||||
|
width: 400.w,
|
||||||
|
height: 400.w,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.h,
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(left: 60.w, right: 60.w),
|
||||||
|
child: Text(
|
||||||
|
'开启微信接收报警消息需要先关注斯凯智能锁微信公众号,请保存二维码并使用微信扫一扫设置'.tr,
|
||||||
|
style:
|
||||||
|
TextStyle(fontSize: 24.sp, color: Colors.black),
|
||||||
|
)),
|
||||||
|
SizedBox(
|
||||||
|
height: 60.h,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
//高级功能弹窗
|
//高级功能弹窗
|
||||||
void advancedFeatureAlert() {
|
void advancedFeatureAlert() {
|
||||||
showCupertinoDialog(
|
showCupertinoDialog(
|
||||||
|
|||||||
@ -26,7 +26,7 @@ const saveIsVip = "saveIsVip"; //是否是VIP
|
|||||||
|
|
||||||
const saveUserLoginData = "userLoginData";
|
const saveUserLoginData = "userLoginData";
|
||||||
const saveLockMainListData = "lockMainListData";
|
const saveLockMainListData = "lockMainListData";
|
||||||
const isOpenDeBug = "isOpenDeBug";//是否打开 debug
|
const isOpenDeBug = "isOpenDeBug"; //是否打开 debug
|
||||||
|
|
||||||
class Storage {
|
class Storage {
|
||||||
Storage._internal();
|
Storage._internal();
|
||||||
@ -145,6 +145,12 @@ class Storage {
|
|||||||
static Future<void> clearAll() async {
|
static Future<void> clearAll() async {
|
||||||
SharedPreferences sp = await SharedPreferences.getInstance();
|
SharedPreferences sp = await SharedPreferences.getInstance();
|
||||||
sp.clear();
|
sp.clear();
|
||||||
|
|
||||||
|
// 重新设置需要保留的数据
|
||||||
|
if (isAgreePrivacy != null) {
|
||||||
|
//退出登录不清除隐私协议同意状态
|
||||||
|
await setString(isAgreePrivacy, isAgreePrivacy);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<String?> getUid() async {
|
static Future<String?> getUid() async {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user