Merge branch 'canary_release' into develop_liyi

This commit is contained in:
Liuyf 2025-02-18 20:18:36 +08:00
commit bc34c36c13
8 changed files with 55 additions and 46 deletions

View File

@ -37,7 +37,7 @@ class ApmHelper {
UmengHelper.instance.initSdk(); UmengHelper.instance.initSdk();
//</cn> //</cn>
//<com> //<com>
FirebaseHelper.instance.initSdk(); // FirebaseHelper.instance.initSdk();
//</com> //</com>
} }

View File

@ -60,6 +60,8 @@ FutureOr<void> main() async {
ChangeNotifierProvider(create: (_) => DebugInfoModel()), ChangeNotifierProvider(create: (_) => DebugInfoModel()),
], child: MyApp(isLogin: isLogin))); ], child: MyApp(isLogin: isLogin)));
// runApp(MyApp(isLogin: isLogin)); // runApp(MyApp(isLogin: isLogin));
}, onException: (FlutterErrorDetails details) async {
debugPrint("FlutterErrorDetails $details");
}); });
if (AppPlatform.isAndroid) { if (AppPlatform.isAndroid) {

View File

@ -129,6 +129,7 @@ class LockMainLogic extends BaseGetXController {
state.dataLength.value = 2; state.dataLength.value = 2;
} }
state.lockListInfoGroupEntity.value = entity; state.lockListInfoGroupEntity.value = entity;
state.lockListInfoGroupEntity.refresh();
// AppLog.log('entity:$entity state.lockListInfoGroupEntity.value.groupList!.length:${state.lockListInfoGroupEntity.value.groupList![0].lockList!.length}'); // AppLog.log('entity:$entity state.lockListInfoGroupEntity.value.groupList!.length:${state.lockListInfoGroupEntity.value.groupList![0].lockList!.length}');
// //
if (Get.isRegistered<LockListLogic>()) { if (Get.isRegistered<LockListLogic>()) {

View File

@ -18,8 +18,8 @@ class GroupEditLockLogic extends BaseGetXController {
var entity = await ApiRepository.to.lockGroupAddLock( var entity = await ApiRepository.to.lockGroupAddLock(
lockIds: lockIds, groupId: state.selectGroupListItem.keyGroupId!); lockIds: lockIds, groupId: state.selectGroupListItem.keyGroupId!);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
eventBus.fire(LockGroupEditGroupLockRefreshEvent()); // 退
showToast('添加成功'.tr, something: () { showToast('添加成功'.tr, something: () {
eventBus.fire(LockGroupEditGroupLockRefreshEvent());
eventBus.fire(RefreshLockListInfoDataEvent()); eventBus.fire(RefreshLockListInfoDataEvent());
Get.close(2); Get.close(2);
}); });
@ -34,8 +34,8 @@ class GroupEditLockLogic extends BaseGetXController {
} }
var entity = await ApiRepository.to.lockGroupDeletLock(lockIds: lockIds); var entity = await ApiRepository.to.lockGroupDeletLock(lockIds: lockIds);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
eventBus.fire(LockGroupEditGroupLockRefreshEvent()); // 退
showToast('删除成功'.tr, something: () { showToast('删除成功'.tr, something: () {
eventBus.fire(LockGroupEditGroupLockRefreshEvent());
eventBus.fire(RefreshLockListInfoDataEvent()); eventBus.fire(RefreshLockListInfoDataEvent());
Get.close(2); Get.close(2);
}); });
@ -47,5 +47,4 @@ class GroupEditLockLogic extends BaseGetXController {
state.isVip.value = isVip ?? false; state.isVip.value = isVip ?? false;
state.isVip.refresh(); state.isVip.refresh();
} }
} }

View File

@ -1,4 +1,3 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@ -35,9 +34,7 @@ class _GroupEditLockPageState extends State<GroupEditLockPage> {
return Scaffold( return Scaffold(
backgroundColor: AppColors.mainBackgroundColor, backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar( appBar: TitleAppBar(
barTitle: state.type == 0 barTitle: state.type == 0 ? '添加'.tr : '删除'.tr,
? '添加'.tr
: '删除'.tr,
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor), backgroundColor: AppColors.mainColor),
body: Column( body: Column(
@ -50,8 +47,7 @@ class _GroupEditLockPageState extends State<GroupEditLockPage> {
margin: EdgeInsets.all(15.w), margin: EdgeInsets.all(15.w),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Text( Text(state.type == 0 ? '选择要加入分组的锁'.tr : '选择要从分组中删除的锁'.tr,
'选择要加入分组的锁'.tr,
style: TextStyle(fontSize: 25.sp)), style: TextStyle(fontSize: 25.sp)),
], ],
), ),

View File

@ -1,4 +1,3 @@
import 'dart:async'; import 'dart:async';
import 'package:get/get.dart'; import 'package:get/get.dart';
@ -14,21 +13,26 @@ class LockGroupListLogic extends BaseGetXController {
// //
Future<void> mockNetworkDataRequest() async { Future<void> mockNetworkDataRequest() async {
final MassSendLockGroupListEntity entity = await ApiRepository.to.lockGroupList('0'); final MassSendLockGroupListEntity entity =
await ApiRepository.to.lockGroupList('0');
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
if (entity.data != null) { if (entity.data != null) {
state.lockNum = 0; state.lockNum = entity.data!.groupList!.fold(
0,
(int previousValue, GroupListItem element) =>
previousValue + element.lockNum!);
state.itemDataList.value = entity.data!.groupList!; state.itemDataList.value = entity.data!.groupList!;
state.itemDataList.refresh();
} }
} }
} }
// //
Future<void> addLockGroupRequest() async { Future<void> addLockGroupRequest() async {
final MassSendLockGroupListEntity entity = final MassSendLockGroupListEntity entity = await ApiRepository.to
await ApiRepository.to.addLockGroup(state.changeNameController.text, '0'); .addLockGroup(state.changeNameController.text, '0');
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast('创建成功'.tr, something: (){ showToast('创建成功'.tr, something: () {
mockNetworkDataRequest(); mockNetworkDataRequest();
}); });
} }
@ -36,9 +40,11 @@ class LockGroupListLogic extends BaseGetXController {
// //
Future<void> editLockGroupRequest(int groupId) async { Future<void> editLockGroupRequest(int groupId) async {
final MassSendLockGroupListEntity entity = await ApiRepository.to.editLockGroupRequest(groupId:groupId, groupName:state.changeNameController.text); final MassSendLockGroupListEntity entity = await ApiRepository.to
.editLockGroupRequest(
groupId: groupId, groupName: state.changeNameController.text);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast('编辑成功'.tr, something: (){ showToast('编辑成功'.tr, something: () {
mockNetworkDataRequest(); mockNetworkDataRequest();
}); });
} }
@ -46,9 +52,10 @@ class LockGroupListLogic extends BaseGetXController {
// //
Future<void> deleteLockGroupRequest(int groupId) async { Future<void> deleteLockGroupRequest(int groupId) async {
final MassSendLockGroupListEntity entity = await ApiRepository.to.deleteGroup(groupId); final MassSendLockGroupListEntity entity =
await ApiRepository.to.deleteGroup(groupId);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast('删除成功'.tr, something: (){ showToast('删除成功'.tr, something: () {
mockNetworkDataRequest(); mockNetworkDataRequest();
}); });
} }
@ -56,8 +63,11 @@ class LockGroupListLogic extends BaseGetXController {
// //
late StreamSubscription _teamEvent; late StreamSubscription _teamEvent;
void _initRefreshAction() { void _initRefreshAction() {
_teamEvent = eventBus.on<LockGroupEditGroupLockRefreshEvent>().listen((LockGroupEditGroupLockRefreshEvent event) { _teamEvent = eventBus
.on<LockGroupEditGroupLockRefreshEvent>()
.listen((LockGroupEditGroupLockRefreshEvent event) {
mockNetworkDataRequest(); mockNetworkDataRequest();
}); });
} }
@ -74,5 +84,4 @@ class LockGroupListLogic extends BaseGetXController {
void onClose() { void onClose() {
_teamEvent.cancel(); _teamEvent.cancel();
} }
}
}

View File

@ -1,4 +1,3 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -45,9 +44,7 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
state.changeNameController.text = ''; state.changeNameController.text = '';
// showCupertinoAlertDialog(context, true, 0); // showCupertinoAlertDialog(context, true, 0);
ShowTipView().showTFViewAlertDialog( ShowTipView().showTFViewAlertDialog(
state.changeNameController, state.changeNameController, '创建新分组'.tr, '请输入姓名'.tr, () {
'创建新分组'.tr,
'请输入姓名'.tr, () {
// //
if (state.changeNameController.text.isNotEmpty) { if (state.changeNameController.text.isNotEmpty) {
Navigator.of(context).pop(); Navigator.of(context).pop();
@ -66,19 +63,20 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
backgroundColor: AppColors.mainColor), backgroundColor: AppColors.mainColor),
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(child: Obx(_buildMainUI)),
child: Obx(() =>
state.itemDataList.isEmpty ? NoData() : _buildMainUI())),
], ],
), ),
); );
} }
Widget _buildMainUI() { Widget _buildMainUI() {
for (int i = 0; i < state.itemDataList.length; i++) { if (state.itemDataList.isEmpty) {
final GroupListItem itemData = state.itemDataList[i]; return NoData();
state.lockNum += itemData.lockList!.length;
} }
// for (int i = 0; i < state.itemDataList.length; i++) {
// final GroupListItem itemData = state.itemDataList[i];
// state.lockNum += itemData.lockList!.length;
// }
return SlidableAutoCloseBehavior( return SlidableAutoCloseBehavior(
child: ListView.separated( child: ListView.separated(
itemCount: state.itemDataList.length + 1, itemCount: state.itemDataList.length + 1,
@ -95,7 +93,8 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
child: Text( child: Text(
'${'锁数量'.tr}${state.lockNum.toString()}', '${'锁数量'.tr}${state.lockNum.toString()}',
style: TextStyle( style: TextStyle(
color: AppColors.darkGrayTextColor, fontSize: 20.sp), color: AppColors.darkGrayTextColor,
fontSize: 20.sp),
), ),
) )
], ],
@ -108,7 +107,7 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
} }
if (index < state.itemDataList.length) { if (index < state.itemDataList.length) {
return Slidable( return Slidable(
key: ValueKey(itemData.keyGroupId), // key: ValueKey(itemData.keyGroupId),
endActionPane: ActionPane( endActionPane: ActionPane(
extentRatio: 0.4, extentRatio: 0.4,
motion: const ScrollMotion(), motion: const ScrollMotion(),
@ -119,13 +118,13 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
), ),
child: lockDataListItem( child: lockDataListItem(
'${itemData.keyGroupName}(${itemData.lockList?.length})', '${itemData.keyGroupName}(${itemData.lockList?.length})',
() { () {
Get.toNamed(Routers.lockItemListPage, Get.toNamed(Routers.lockItemListPage,
arguments: <String, GroupListItem>{ arguments: <String, GroupListItem>{
'groupListItem': itemData, 'groupListItem': itemData,
'ungrouped': state.ungrouped 'ungrouped': state.ungrouped
}); });
}), }),
); );
// return LeftSlideActions( // return LeftSlideActions(
@ -174,7 +173,7 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
}); });
}, },
child: Container( child: Container(
width: 1.sw*0.2, width: 1.sw * 0.2,
color: const Color(0xFFF20101), color: const Color(0xFFF20101),
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
@ -197,8 +196,8 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
state.changeNameController.text = groupListItem.keyGroupName!; state.changeNameController.text = groupListItem.keyGroupName!;
// showCupertinoAlertDialog(context, false, groupListItem.keyGroupId!); // showCupertinoAlertDialog(context, false, groupListItem.keyGroupId!);
ShowTipView().showTFViewAlertDialog(state.changeNameController, ShowTipView().showTFViewAlertDialog(
'修改名称'.tr, '请输入姓名'.tr, () { state.changeNameController, '修改名称'.tr, '请输入姓名'.tr, () {
if (state.changeNameController.text.isNotEmpty) { if (state.changeNameController.text.isNotEmpty) {
Get.back(); Get.back();
logic.editLockGroupRequest(groupListItem.keyGroupId!); logic.editLockGroupRequest(groupListItem.keyGroupId!);
@ -212,7 +211,7 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
}, isShowSuffixIcon: true); }, isShowSuffixIcon: true);
}, },
child: Container( child: Container(
width: 1.sw*0.2, width: 1.sw * 0.2,
color: AppColors.mainColor, color: AppColors.mainColor,
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(

View File

@ -1,3 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@ -56,9 +57,11 @@ class BaseProvider extends GetConnect with Api {
query: query, query: query,
decoder: decoder, decoder: decoder,
uploadProgress: uploadProgress); uploadProgress: uploadProgress);
debugPrint("====1===$url---> ${res.bodyString}");
if (EasyLoading.isShow && !isUnShowLoading!) { if (EasyLoading.isShow && !isUnShowLoading!) {
await EasyLoading.dismiss(animation: true); await EasyLoading.dismiss(animation: true);
} }
debugPrint("===2====$url---> ${res.bodyString}");
if (res.body == null) { if (res.body == null) {
// EasyLoading.showToast("Network Error!", duration: 2000.milliseconds); // EasyLoading.showToast("Network Error!", duration: 2000.milliseconds);
if (res.statusCode == null && isShowErrMsg!) { if (res.statusCode == null && isShowErrMsg!) {