Merge branch 'canary_release' into develop_liyi
This commit is contained in:
commit
bc34c36c13
@ -37,7 +37,7 @@ class ApmHelper {
|
||||
UmengHelper.instance.initSdk();
|
||||
//</cn>
|
||||
//<com>
|
||||
FirebaseHelper.instance.initSdk();
|
||||
// FirebaseHelper.instance.initSdk();
|
||||
//</com>
|
||||
}
|
||||
|
||||
|
||||
@ -60,6 +60,8 @@ FutureOr<void> main() async {
|
||||
ChangeNotifierProvider(create: (_) => DebugInfoModel()),
|
||||
], child: MyApp(isLogin: isLogin)));
|
||||
// runApp(MyApp(isLogin: isLogin));
|
||||
}, onException: (FlutterErrorDetails details) async {
|
||||
debugPrint("FlutterErrorDetails $details");
|
||||
});
|
||||
|
||||
if (AppPlatform.isAndroid) {
|
||||
|
||||
@ -129,6 +129,7 @@ class LockMainLogic extends BaseGetXController {
|
||||
state.dataLength.value = 2;
|
||||
}
|
||||
state.lockListInfoGroupEntity.value = entity;
|
||||
state.lockListInfoGroupEntity.refresh();
|
||||
// AppLog.log('entity:$entity state.lockListInfoGroupEntity.value.groupList!.length:${state.lockListInfoGroupEntity.value.groupList![0].lockList!.length}');
|
||||
//检测控制器是否存在
|
||||
if (Get.isRegistered<LockListLogic>()) {
|
||||
|
||||
@ -18,8 +18,8 @@ class GroupEditLockLogic extends BaseGetXController {
|
||||
var entity = await ApiRepository.to.lockGroupAddLock(
|
||||
lockIds: lockIds, groupId: state.selectGroupListItem.keyGroupId!);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
eventBus.fire(LockGroupEditGroupLockRefreshEvent()); // 调整到外部页面退出后统一刷新
|
||||
showToast('添加成功'.tr, something: () {
|
||||
eventBus.fire(LockGroupEditGroupLockRefreshEvent());
|
||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
Get.close(2);
|
||||
});
|
||||
@ -34,8 +34,8 @@ class GroupEditLockLogic extends BaseGetXController {
|
||||
}
|
||||
var entity = await ApiRepository.to.lockGroupDeletLock(lockIds: lockIds);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
eventBus.fire(LockGroupEditGroupLockRefreshEvent()); // 调整到外部页面退出后统一刷新
|
||||
showToast('删除成功'.tr, something: () {
|
||||
eventBus.fire(LockGroupEditGroupLockRefreshEvent());
|
||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
Get.close(2);
|
||||
});
|
||||
@ -47,5 +47,4 @@ class GroupEditLockLogic extends BaseGetXController {
|
||||
state.isVip.value = isVip ?? false;
|
||||
state.isVip.refresh();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
@ -35,9 +34,7 @@ class _GroupEditLockPageState extends State<GroupEditLockPage> {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: state.type == 0
|
||||
? '添加'.tr
|
||||
: '删除'.tr,
|
||||
barTitle: state.type == 0 ? '添加'.tr : '删除'.tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: Column(
|
||||
@ -50,8 +47,7 @@ class _GroupEditLockPageState extends State<GroupEditLockPage> {
|
||||
margin: EdgeInsets.all(15.w),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'选择要加入分组的锁'.tr,
|
||||
Text(state.type == 0 ? '选择要加入分组的锁'.tr : '选择要从分组中删除的锁'.tr,
|
||||
style: TextStyle(fontSize: 25.sp)),
|
||||
],
|
||||
),
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
@ -14,21 +13,26 @@ class LockGroupListLogic extends BaseGetXController {
|
||||
|
||||
//分组列表请求
|
||||
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.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.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//创建锁分组请求
|
||||
Future<void> addLockGroupRequest() async {
|
||||
final MassSendLockGroupListEntity entity =
|
||||
await ApiRepository.to.addLockGroup(state.changeNameController.text, '0');
|
||||
final MassSendLockGroupListEntity entity = await ApiRepository.to
|
||||
.addLockGroup(state.changeNameController.text, '0');
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast('创建成功'.tr, something: (){
|
||||
showToast('创建成功'.tr, something: () {
|
||||
mockNetworkDataRequest();
|
||||
});
|
||||
}
|
||||
@ -36,9 +40,11 @@ class LockGroupListLogic extends BaseGetXController {
|
||||
|
||||
//编辑锁名字
|
||||
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) {
|
||||
showToast('编辑成功'.tr, something: (){
|
||||
showToast('编辑成功'.tr, something: () {
|
||||
mockNetworkDataRequest();
|
||||
});
|
||||
}
|
||||
@ -46,9 +52,10 @@ class LockGroupListLogic extends BaseGetXController {
|
||||
|
||||
//删除组
|
||||
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) {
|
||||
showToast('删除成功'.tr, something: (){
|
||||
showToast('删除成功'.tr, something: () {
|
||||
mockNetworkDataRequest();
|
||||
});
|
||||
}
|
||||
@ -56,8 +63,11 @@ class LockGroupListLogic extends BaseGetXController {
|
||||
|
||||
// 监听修改完详情之后刷新列表
|
||||
late StreamSubscription _teamEvent;
|
||||
|
||||
void _initRefreshAction() {
|
||||
_teamEvent = eventBus.on<LockGroupEditGroupLockRefreshEvent>().listen((LockGroupEditGroupLockRefreshEvent event) {
|
||||
_teamEvent = eventBus
|
||||
.on<LockGroupEditGroupLockRefreshEvent>()
|
||||
.listen((LockGroupEditGroupLockRefreshEvent event) {
|
||||
mockNetworkDataRequest();
|
||||
});
|
||||
}
|
||||
@ -74,5 +84,4 @@ class LockGroupListLogic extends BaseGetXController {
|
||||
void onClose() {
|
||||
_teamEvent.cancel();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
@ -45,9 +44,7 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
state.changeNameController.text = '';
|
||||
// showCupertinoAlertDialog(context, true, 0);
|
||||
ShowTipView().showTFViewAlertDialog(
|
||||
state.changeNameController,
|
||||
'创建新分组'.tr,
|
||||
'请输入姓名'.tr, () {
|
||||
state.changeNameController, '创建新分组'.tr, '请输入姓名'.tr, () {
|
||||
//发送编辑钥匙名称请求
|
||||
if (state.changeNameController.text.isNotEmpty) {
|
||||
Navigator.of(context).pop();
|
||||
@ -66,19 +63,20 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Obx(() =>
|
||||
state.itemDataList.isEmpty ? NoData() : _buildMainUI())),
|
||||
Expanded(child: Obx(_buildMainUI)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildMainUI() {
|
||||
for (int i = 0; i < state.itemDataList.length; i++) {
|
||||
final GroupListItem itemData = state.itemDataList[i];
|
||||
state.lockNum += itemData.lockList!.length;
|
||||
if (state.itemDataList.isEmpty) {
|
||||
return NoData();
|
||||
}
|
||||
// for (int i = 0; i < state.itemDataList.length; i++) {
|
||||
// final GroupListItem itemData = state.itemDataList[i];
|
||||
// state.lockNum += itemData.lockList!.length;
|
||||
// }
|
||||
return SlidableAutoCloseBehavior(
|
||||
child: ListView.separated(
|
||||
itemCount: state.itemDataList.length + 1,
|
||||
@ -95,7 +93,8 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
child: Text(
|
||||
'${'锁数量'.tr}:${state.lockNum.toString()}',
|
||||
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) {
|
||||
return Slidable(
|
||||
key: ValueKey(itemData.keyGroupId),
|
||||
// key: ValueKey(itemData.keyGroupId),
|
||||
endActionPane: ActionPane(
|
||||
extentRatio: 0.4,
|
||||
motion: const ScrollMotion(),
|
||||
@ -119,13 +118,13 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
),
|
||||
child: lockDataListItem(
|
||||
'${itemData.keyGroupName}(${itemData.lockList?.length})',
|
||||
() {
|
||||
Get.toNamed(Routers.lockItemListPage,
|
||||
arguments: <String, GroupListItem>{
|
||||
'groupListItem': itemData,
|
||||
'ungrouped': state.ungrouped
|
||||
});
|
||||
}),
|
||||
() {
|
||||
Get.toNamed(Routers.lockItemListPage,
|
||||
arguments: <String, GroupListItem>{
|
||||
'groupListItem': itemData,
|
||||
'ungrouped': state.ungrouped
|
||||
});
|
||||
}),
|
||||
);
|
||||
|
||||
// return LeftSlideActions(
|
||||
@ -174,7 +173,7 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
width: 1.sw*0.2,
|
||||
width: 1.sw * 0.2,
|
||||
color: const Color(0xFFF20101),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
@ -197,8 +196,8 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
state.changeNameController.text = groupListItem.keyGroupName!;
|
||||
// showCupertinoAlertDialog(context, false, groupListItem.keyGroupId!);
|
||||
|
||||
ShowTipView().showTFViewAlertDialog(state.changeNameController,
|
||||
'修改名称'.tr, '请输入姓名'.tr, () {
|
||||
ShowTipView().showTFViewAlertDialog(
|
||||
state.changeNameController, '修改名称'.tr, '请输入姓名'.tr, () {
|
||||
if (state.changeNameController.text.isNotEmpty) {
|
||||
Get.back();
|
||||
logic.editLockGroupRequest(groupListItem.keyGroupId!);
|
||||
@ -212,7 +211,7 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
||||
}, isShowSuffixIcon: true);
|
||||
},
|
||||
child: Container(
|
||||
width: 1.sw*0.2,
|
||||
width: 1.sw * 0.2,
|
||||
color: AppColors.mainColor,
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
@ -56,9 +57,11 @@ class BaseProvider extends GetConnect with Api {
|
||||
query: query,
|
||||
decoder: decoder,
|
||||
uploadProgress: uploadProgress);
|
||||
debugPrint("====1===$url---> ${res.bodyString}");
|
||||
if (EasyLoading.isShow && !isUnShowLoading!) {
|
||||
await EasyLoading.dismiss(animation: true);
|
||||
}
|
||||
debugPrint("===2====$url---> ${res.bodyString}");
|
||||
if (res.body == null) {
|
||||
// EasyLoading.showToast("Network Error!", duration: 2000.milliseconds);
|
||||
if (res.statusCode == null && isShowErrMsg!) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user