remove mock models

hmxc
张萌 4 years ago
parent 27fd4e306c
commit 5fa0586230

@ -13,8 +13,6 @@ import 'package:provider/provider.dart';
// Project imports:
import 'package:aku_community_manager/provider/app_provider.dart';
import 'package:aku_community_manager/provider/fix_provider.dart';
import 'package:aku_community_manager/provider/manage_provider.dart';
import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/style/apptheme.dart';
import 'package:aku_community_manager/ui/splash/splash_page.dart';
@ -64,13 +62,13 @@ class MyApp extends StatelessWidget {
providers: [
ChangeNotifierProvider(create: (context) => UserProvider()),
ChangeNotifierProvider(create: (context) => AppProvider()),
ChangeNotifierProvider(create: (context) => FixProvider()),
ChangeNotifierProvider(create: (context) => GreenManageProvider()),
ChangeNotifierProvider(
create: (context) => InspectionManageProvider()),
ChangeNotifierProvider(create: (context) => GreenManageProvider()),
ChangeNotifierProvider(
create: (context) => InspectionManageProvider()),
// ChangeNotifierProvider(create: (context) => FixProvider()),
// ChangeNotifierProvider(create: (context) => GreenManageProvider()),
// ChangeNotifierProvider(
// create: (context) => InspectionManageProvider()),
// ChangeNotifierProvider(create: (context) => GreenManageProvider()),
// ChangeNotifierProvider(
// create: (context) => InspectionManageProvider()),
],
child: GestureDetector(
onTap: () {

@ -1,55 +0,0 @@
// Flutter imports:
import 'package:flutter/material.dart';
// Package imports:
import 'package:provider/provider.dart';
// Project imports:
import 'package:aku_community_manager/mock_models/decoration/decoration_data.dart';
import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart';
import 'package:aku_community_manager/mock_models/fix/fix_model.dart';
import 'package:aku_community_manager/provider/fix_provider.dart';
@Deprecated('this mock model should be removed')
class AllModel {
BuildContext context;
AllModel(this.context);
List get allThings {
final fixProvider = Provider.of<FixProvider>(context, listen: false);
return [
...fixProvider.fixModels,
...DecorationData.allModels,
];
}
List get waitThings {
final fixProvider = Provider.of<FixProvider>(context, listen: false);
return [
...fixProvider.fixModels.where((element) {
return element.type == FIX_ENUM.WAIT_PICKUP;
}).toList(),
...DecorationData.getModels(DecorationType.WAIT_HAND_OUT),
];
}
List get processingThings {
final fixProvider = Provider.of<FixProvider>(context, listen: false);
return [
...fixProvider.fixModels.where((element) {
return element.type == FIX_ENUM.PROCESSING;
}).toList(),
...DecorationData.getModels(DecorationType.HAND_OUT),
];
}
List get doneThings {
final fixProvider = Provider.of<FixProvider>(context, listen: false);
return [
...fixProvider.fixModels.where((element) {
return element.type == FIX_ENUM.DONE;
}).toList(),
...DecorationData.getModels(DecorationType.DONE),
];
}
}

@ -1,95 +0,0 @@
// Project imports:
import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/mock_models/borrow/borrow_model.dart';
//TODO CLEAN BOTTOM CODES.
@Deprecated("borrow_data need to be cleaned.")
class BorrowData {
static List<BorrowModel> get checkModels => models.where((e) {
return e.borrowGoods.status == BORROW_STATUS.WAIT_CHECK;
}).toList();
static List<BorrowModel> get borrowModels => models.where((e) {
return e.borrowGoods.status == BORROW_STATUS.BORROWING;
}).toList();
static List<BorrowModel> get doneModels => models.where((e) {
return e.borrowGoods.status == BORROW_STATUS.DONE;
}).toList();
static List<BorrowModel> models = [
BorrowModel(
title: '归还梯子一个',
borrowPerson: '李慧珍',
borrowTime: 5,
goodsStatus: GOODS_STATUS.BROKEN,
phone: '19981712931',
borrowGoods: SingleBorrowGoods(
name: '梯子',
assetpath: R.ASSETS_STATIC_TEMP_LADDER_PNG,
code: '3193713894',
status: BORROW_STATUS.WAIT_CHECK,
),
date: DateTime(2020, 5, 5, 12, 35, 45),
),
BorrowModel(
title: '归还梯子一个',
borrowPerson: '李慧珍',
borrowTime: 5,
goodsStatus: GOODS_STATUS.BROKEN,
phone: '19981712931',
borrowGoods: SingleBorrowGoods(
name: '梯子',
assetpath: R.ASSETS_STATIC_TEMP_LADDER_PNG,
code: '3193713894',
status: BORROW_STATUS.DONE,
),
date: DateTime(2020, 5, 5, 12, 35, 45),
),
BorrowModel(
title: '借用电钻一把',
borrowPerson: '刘虎门',
borrowTime: 12,
goodsStatus: GOODS_STATUS.NORMAL,
phone: '19981738879',
borrowGoods: SingleBorrowGoods(
name: '电钻',
assetpath: R.ASSETS_STATIC_TEMP_DRILL_PNG,
code: '31937293841',
status: BORROW_STATUS.BORROWING,
),
date: DateTime(2020, 4, 5, 12, 35, 45),
),
BorrowModel(
borrowPerson: '刘海保',
borrowTime: 5,
title: '借用榔头一把',
goodsStatus: GOODS_STATUS.NORMAL,
phone: '19981738879',
borrowGoods: SingleBorrowGoods(
name: '榔头',
assetpath: R.ASSETS_STATIC_TEMP_HAMMER_PNG,
code: '3193794102481',
status: BORROW_STATUS.BORROWING,
),
date: DateTime(2020, 3, 5, 12, 35, 45),
),
];
static List<BorrowObject> borrowObjects = [
BorrowObject.init(
name: '电钻',
assetPath: R.ASSETS_STATIC_TEMP_DRILL_PNG,
allNumber: 5,
),
BorrowObject.init(
name: '梯子',
assetPath: R.ASSETS_STATIC_TEMP_LADDER_PNG,
allNumber: 3,
),
BorrowObject.init(
name: '三角榔头',
assetPath: R.ASSETS_STATIC_TEMP_HAMMER_PNG,
allNumber: 8,
),
];
}

@ -1,92 +0,0 @@
// Dart imports:
import 'dart:math';
// Package imports:
import 'package:meta/meta.dart';
enum BORROW_STATUS {
///
BORROWING,
///
WAIT_CHECK,
///
NOT_BORROW,
///
DONE,
}
enum GOODS_STATUS {
NORMAL,
BROKEN,
LOST,
}
//TODO CLEAN BOTTOM CODES.
@Deprecated(" borrow_model need to be cleaned.")
class BorrowModel {
String borrowPerson;
String phone;
int borrowTime;
GOODS_STATUS goodsStatus;
String title;
SingleBorrowGoods borrowGoods;
DateTime date;
BorrowModel({
@required this.borrowPerson,
@required this.phone,
@required this.borrowTime,
@required this.goodsStatus,
@required this.borrowGoods,
@required this.title,
@required this.date,
});
}
class BorrowObject {
String name;
int allNumber;
dynamic assetPath;
int borrowNumber;
int get restNumber => allNumber - borrowNumber;
List<SingleBorrowGoods> items;
BorrowObject.init({
this.name,
this.allNumber,
this.assetPath,
}) {
this.borrowNumber = 0;
items = List.generate(
this.allNumber,
(index) => SingleBorrowGoods(
name: '${this.name}${index + 1}',
code: (179264234 + Random().nextInt(999999)).toString(),
status: BORROW_STATUS.NOT_BORROW,
assetpath: this.assetPath,
),
);
}
}
class SingleBorrowGoods {
String name;
String code;
dynamic assetpath;
BORROW_STATUS status;
String get borrowValue => {
BORROW_STATUS.BORROWING: '出借中',
BORROW_STATUS.DONE: '已归还',
BORROW_STATUS.NOT_BORROW: '未出借',
BORROW_STATUS.WAIT_CHECK: '待检查',
}[status];
SingleBorrowGoods({
this.name,
this.code,
this.assetpath,
this.status,
});
}

@ -1,230 +0,0 @@
// Project imports:
import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart';
import 'package:aku_community_manager/mock_models/fix/fixer_model.dart';
@Deprecated('this should be removed')
class DecorationData {
static List<DecorationModel> allModels = [
DecorationModel(
type: DecorationType.WAIT_HAND_OUT,
statusType: DecorationStatusType.PROGRESS,
decorationDate: DateTime(2020, 1, 23, 12, 23, 0),
userHomeModel: UserHomeModel(
userName: '林居明',
plot: '深圳华茂悦峰',
detailAddr: '2幢-2单元-501室',
phone: '19995430126',
),
decorationTeamModel: DecorationTeamModel(
name: '深圳莫川装修有限公司',
userName: '李惠政',
phone: '19298540192',
),
cycleCheck: CycleCheck(),
),
DecorationModel(
decorationDate: DateTime(2020, 1, 23, 12, 23, 0),
type: DecorationType.HAND_OUT,
statusType: DecorationStatusType.DONE,
userHomeModel: UserHomeModel(
userName: '李慧珍',
plot: '深圳华茂悦峰',
detailAddr: '1幢-1单元-302室',
phone: '18201939840',
),
decorationTeamModel: DecorationTeamModel(
name: '深圳莫川装修有限公司',
userName: '李惠政',
phone: '19298540192',
),
cycleCheck: CycleCheck(
authPerson: FixerModel(name: '林鸿章', phone: '18294859301'),
startDate: DateTime(2020, 1, 23, 20, 23, 0),
checkCycle: 7,
checkDetails: [
CHECK_TYPE.ELECTRIC,
CHECK_TYPE.WATER,
CHECK_TYPE.WALL,
CHECK_TYPE.DOOR_AND_WINDOWS,
],
),
workFinishCheck: WorkFinishCheck(
authPerson: FixerModel(name: '林鸿章', phone: '18294859301'),
startDate: DateTime(2020, 1, 23, 20, 23, 0),
checkDetails: [
CHECK_TYPE.ELECTRIC,
CHECK_TYPE.WATER,
CHECK_TYPE.WALL,
CHECK_TYPE.DOOR_AND_WINDOWS,
CHECK_TYPE.SECURITY,
],
),
checkInfomations: [
CheckInfomation(
checkDate: DateTime(2020, 3, 20, 12, 00),
info: '正常',
checkType: '完工检查',
details: [
CheckDetail(type: CHECK_TYPE.ELECTRIC),
CheckDetail(type: CHECK_TYPE.WATER),
CheckDetail(type: CHECK_TYPE.WALL),
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
],
),
CheckInfomation(
checkDate: DateTime(2020, 2, 14, 12, 00),
info: '正常',
checkType: '周期检查',
details: [
CheckDetail(type: CHECK_TYPE.ELECTRIC),
CheckDetail(type: CHECK_TYPE.WATER),
CheckDetail(type: CHECK_TYPE.WALL),
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
],
),
CheckInfomation(
checkDate: DateTime(2020, 2, 7, 12, 00),
info: '厨房水路异常',
checkType: '周期检查',
details: [
CheckDetail(type: CHECK_TYPE.ELECTRIC),
CheckDetail(type: CHECK_TYPE.WATER, status: false),
CheckDetail(type: CHECK_TYPE.WALL),
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
],
),
CheckInfomation(
checkDate: DateTime(2020, 1, 30, 12, 00),
info: '正常',
checkType: '周期检查',
details: [
CheckDetail(type: CHECK_TYPE.ELECTRIC),
CheckDetail(type: CHECK_TYPE.WATER),
CheckDetail(type: CHECK_TYPE.WALL),
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
],
),
CheckInfomation(
checkDate: DateTime(2020, 1, 23, 12, 00),
info: '正常',
checkType: '周期检查',
details: [
CheckDetail(type: CHECK_TYPE.ELECTRIC),
CheckDetail(type: CHECK_TYPE.WATER),
CheckDetail(type: CHECK_TYPE.WALL),
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
],
),
],
),
DecorationModel(
decorationDate: DateTime(2020, 1, 23, 12, 23, 0),
type: DecorationType.DONE,
statusType: DecorationStatusType.DONE,
userHomeModel: UserHomeModel(
userName: '李慧珍',
plot: '深圳华茂悦峰',
detailAddr: '1幢-1单元-302室',
phone: '18201939840',
),
decorationTeamModel: DecorationTeamModel(
name: '深圳莫川装修有限公司',
userName: '李惠政',
phone: '19298540192',
),
cycleCheck: CycleCheck(
authPerson: FixerModel(name: '林鸿章', phone: '18294859301'),
startDate: DateTime(2020, 1, 23, 20, 23, 0),
checkCycle: 7,
checkDetails: [
CHECK_TYPE.ELECTRIC,
CHECK_TYPE.WATER,
CHECK_TYPE.WALL,
CHECK_TYPE.DOOR_AND_WINDOWS,
],
),
workFinishCheck: WorkFinishCheck(
authPerson: FixerModel(name: '林鸿章', phone: '18294859301'),
startDate: DateTime(2020, 1, 23, 20, 23, 0),
checkDetails: [
CHECK_TYPE.ELECTRIC,
CHECK_TYPE.WATER,
CHECK_TYPE.WALL,
CHECK_TYPE.DOOR_AND_WINDOWS,
CHECK_TYPE.SECURITY,
],
),
checkInfomations: [
CheckInfomation(
checkDate: DateTime(2020, 3, 20, 12, 00),
info: '正常',
checkType: '完工检查',
details: [
CheckDetail(type: CHECK_TYPE.ELECTRIC),
CheckDetail(type: CHECK_TYPE.WATER),
CheckDetail(type: CHECK_TYPE.WALL),
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
],
),
CheckInfomation(
checkDate: DateTime(2020, 2, 14, 12, 00),
info: '正常',
checkType: '周期检查',
details: [
CheckDetail(type: CHECK_TYPE.ELECTRIC),
CheckDetail(type: CHECK_TYPE.WATER),
CheckDetail(type: CHECK_TYPE.WALL),
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
],
),
CheckInfomation(
checkDate: DateTime(2020, 2, 7, 12, 00),
info: '厨房水路异常',
checkType: '周期检查',
details: [
CheckDetail(type: CHECK_TYPE.ELECTRIC),
CheckDetail(type: CHECK_TYPE.WATER, status: false),
CheckDetail(type: CHECK_TYPE.WALL),
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
],
),
CheckInfomation(
checkDate: DateTime(2020, 1, 30, 12, 00),
info: '正常',
checkType: '周期检查',
details: [
CheckDetail(type: CHECK_TYPE.ELECTRIC),
CheckDetail(type: CHECK_TYPE.WATER),
CheckDetail(type: CHECK_TYPE.WALL),
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
],
),
CheckInfomation(
checkDate: DateTime(2020, 1, 23, 12, 00),
info: '正常',
checkType: '周期检查',
details: [
CheckDetail(type: CHECK_TYPE.ELECTRIC),
CheckDetail(type: CHECK_TYPE.WATER),
CheckDetail(type: CHECK_TYPE.WALL),
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
],
),
],
),
];
static List<DecorationModel> getModels(DecorationType type) {
return allModels.where((element) => element.type == type).toList();
}
static List<DecorationModel> getTypeModels(DecorationStatusType type) {
return allModels.where((element) => element.statusType == type).toList();
}
static List<DecorationModel> get allPropertyModels {
return allModels
.where((element) => element.type != DecorationType.WAIT_HAND_OUT)
.toList();
}
}

@ -1,186 +1,185 @@
// Flutter imports:
import 'package:flutter/material.dart';
// Project imports:
import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/mock_models/fix/fixer_model.dart';
enum DecorationType {
///
WAIT_HAND_OUT,
///&
HAND_OUT,
///
DONE,
}
enum DecorationStatusType {
PROGRESS,
DONE,
}
enum CHECK_TYPE {
ELECTRIC,
WATER,
WALL,
DOOR_AND_WINDOWS,
SECURITY,
}
Map<CHECK_TYPE, String> checkTypeMap = {
CHECK_TYPE.ELECTRIC: '电路',
CHECK_TYPE.WATER: '水路',
CHECK_TYPE.WALL: '墙面',
CHECK_TYPE.DOOR_AND_WINDOWS: '门窗',
CHECK_TYPE.SECURITY: '安防',
};
Map<String, CHECK_TYPE> checkTypeStringMap = {
'电路': CHECK_TYPE.ELECTRIC,
'水路': CHECK_TYPE.WATER,
'墙面': CHECK_TYPE.WALL,
'门窗': CHECK_TYPE.DOOR_AND_WINDOWS,
'安防': CHECK_TYPE.SECURITY,
};
Map<CHECK_TYPE, String> checkAssetMap = {
CHECK_TYPE.ELECTRIC: R.ASSETS_MANAGE_CIRCUIT_PNG,
CHECK_TYPE.WATER: R.ASSETS_MANAGE_WATERWAY_PNG,
CHECK_TYPE.WALL: R.ASSETS_MANAGE_WALL_PNG,
CHECK_TYPE.DOOR_AND_WINDOWS: R.ASSETS_MANAGE_WINDOW_PNG,
CHECK_TYPE.SECURITY: R.ASSETS_MANAGE_SECURITY_PNG,
};
@Deprecated('under should be removed')
class DecorationModel {
DecorationType type;
DecorationStatusType statusType;
DateTime decorationDate;
UserHomeModel userHomeModel;
DecorationTeamModel decorationTeamModel;
CycleCheck cycleCheck;
WorkFinishCheck workFinishCheck;
List<CheckInfomation> checkInfomations;
String get statusTypeValue {
if (statusType == DecorationStatusType.PROGRESS)
return '装修中';
else
return '装修完成';
}
DecorationModel({
@required this.type,
@required this.statusType,
@required this.userHomeModel,
@required this.decorationTeamModel,
@required this.decorationDate,
this.cycleCheck,
this.workFinishCheck,
this.checkInfomations,
});
}
@Deprecated('under should be removed')
///
class UserHomeModel {
String plot;
String detailAddr;
String userName;
String phone;
UserHomeModel({
this.plot,
this.detailAddr,
this.userName,
this.phone,
});
}
@Deprecated('under should be removed')
///
class DecorationTeamModel {
String name;
String userName;
String phone;
DecorationTeamModel({
this.name,
this.userName,
this.phone,
});
}
@Deprecated('under should be removed')
///
class CycleCheck {
FixerModel authPerson;
DateTime startDate;
///check cycle in days
int checkCycle;
List<CHECK_TYPE> checkDetails = [
CHECK_TYPE.ELECTRIC,
CHECK_TYPE.WATER,
CHECK_TYPE.WALL,
CHECK_TYPE.DOOR_AND_WINDOWS,
CHECK_TYPE.SECURITY,
];
CycleCheck({
this.authPerson,
this.startDate,
this.checkCycle,
this.checkDetails,
});
}
@Deprecated('under should be removed')
class WorkFinishCheck {
FixerModel authPerson;
DateTime startDate;
List<CHECK_TYPE> checkDetails;
WorkFinishCheck({
this.authPerson,
this.startDate,
this.checkDetails,
});
}
@Deprecated('under should be removed')
///
class CheckInfomation {
DateTime checkDate;
List<CheckDetail> details;
String info;
String checkType;
CheckInfomation({
this.checkDate,
this.info,
this.details,
this.checkType,
});
///
bool get checkAllResult {
for (var item in details) {
if (!item.status) return false;
}
return true;
}
}
@Deprecated('under should be removed')
class CheckDetail {
CHECK_TYPE type;
bool status;
String get assetpath => checkAssetMap[type];
CheckDetail({
@required this.type,
this.status = true,
});
String get typeValue => checkTypeMap[type];
}
// // Flutter imports:
// import 'package:flutter/material.dart';
// // Project imports:
// import 'package:aku_community_manager/const/resource.dart';
// enum DecorationType {
// ///
// WAIT_HAND_OUT,
// ///&
// HAND_OUT,
// ///
// DONE,
// }
// enum DecorationStatusType {
// PROGRESS,
// DONE,
// }
// enum CHECK_TYPE {
// ELECTRIC,
// WATER,
// WALL,
// DOOR_AND_WINDOWS,
// SECURITY,
// }
// Map<CHECK_TYPE, String> checkTypeMap = {
// CHECK_TYPE.ELECTRIC: '电路',
// CHECK_TYPE.WATER: '水路',
// CHECK_TYPE.WALL: '墙面',
// CHECK_TYPE.DOOR_AND_WINDOWS: '门窗',
// CHECK_TYPE.SECURITY: '安防',
// };
// Map<String, CHECK_TYPE> checkTypeStringMap = {
// '电路': CHECK_TYPE.ELECTRIC,
// '水路': CHECK_TYPE.WATER,
// '墙面': CHECK_TYPE.WALL,
// '门窗': CHECK_TYPE.DOOR_AND_WINDOWS,
// '安防': CHECK_TYPE.SECURITY,
// };
// Map<CHECK_TYPE, String> checkAssetMap = {
// CHECK_TYPE.ELECTRIC: R.ASSETS_MANAGE_CIRCUIT_PNG,
// CHECK_TYPE.WATER: R.ASSETS_MANAGE_WATERWAY_PNG,
// CHECK_TYPE.WALL: R.ASSETS_MANAGE_WALL_PNG,
// CHECK_TYPE.DOOR_AND_WINDOWS: R.ASSETS_MANAGE_WINDOW_PNG,
// CHECK_TYPE.SECURITY: R.ASSETS_MANAGE_SECURITY_PNG,
// };
// @Deprecated('under should be removed')
// class DecorationModel {
// DecorationType type;
// DecorationStatusType statusType;
// DateTime decorationDate;
// UserHomeModel userHomeModel;
// DecorationTeamModel decorationTeamModel;
// CycleCheck cycleCheck;
// WorkFinishCheck workFinishCheck;
// List<CheckInfomation> checkInfomations;
// String get statusTypeValue {
// if (statusType == DecorationStatusType.PROGRESS)
// return '装修中';
// else
// return '装修完成';
// }
// DecorationModel({
// @required this.type,
// @required this.statusType,
// @required this.userHomeModel,
// @required this.decorationTeamModel,
// @required this.decorationDate,
// this.cycleCheck,
// this.workFinishCheck,
// this.checkInfomations,
// });
// }
// @Deprecated('under should be removed')
// ///
// class UserHomeModel {
// String plot;
// String detailAddr;
// String userName;
// String phone;
// UserHomeModel({
// this.plot,
// this.detailAddr,
// this.userName,
// this.phone,
// });
// }
// @Deprecated('under should be removed')
// ///
// class DecorationTeamModel {
// String name;
// String userName;
// String phone;
// DecorationTeamModel({
// this.name,
// this.userName,
// this.phone,
// });
// }
// @Deprecated('under should be removed')
// ///
// class CycleCheck {
// FixerModel authPerson;
// DateTime startDate;
// ///check cycle in days
// int checkCycle;
// List<CHECK_TYPE> checkDetails = [
// CHECK_TYPE.ELECTRIC,
// CHECK_TYPE.WATER,
// CHECK_TYPE.WALL,
// CHECK_TYPE.DOOR_AND_WINDOWS,
// CHECK_TYPE.SECURITY,
// ];
// CycleCheck({
// this.authPerson,
// this.startDate,
// this.checkCycle,
// this.checkDetails,
// });
// }
// @Deprecated('under should be removed')
// class WorkFinishCheck {
// FixerModel authPerson;
// DateTime startDate;
// List<CHECK_TYPE> checkDetails;
// WorkFinishCheck({
// this.authPerson,
// this.startDate,
// this.checkDetails,
// });
// }
// @Deprecated('under should be removed')
// ///
// class CheckInfomation {
// DateTime checkDate;
// List<CheckDetail> details;
// String info;
// String checkType;
// CheckInfomation({
// this.checkDate,
// this.info,
// this.details,
// this.checkType,
// });
// ///
// bool get checkAllResult {
// for (var item in details) {
// if (!item.status) return false;
// }
// return true;
// }
// }
// @Deprecated('under should be removed')
// class CheckDetail {
// CHECK_TYPE type;
// bool status;
// String get assetpath => checkAssetMap[type];
// CheckDetail({
// @required this.type,
// this.status = true,
// });
// String get typeValue => checkTypeMap[type];
// }

@ -1,286 +0,0 @@
// Flutter imports:
import 'package:flutter/material.dart';
// Project imports:
import 'package:aku_community_manager/const/resource.dart';
enum FIX_ENUM {
///
HAND_OUT,
///&&
WAIT_PICKUP,
///
PROCESSING,
///
DONE,
}
@deprecated
class FixModel {
static Map<FIX_ENUM, String> managerRoleMap = {
FIX_ENUM.HAND_OUT: '待派单',
FIX_ENUM.WAIT_PICKUP: '已派单',
FIX_ENUM.PROCESSING: '处理中',
FIX_ENUM.DONE: '已处理',
};
static Map<FIX_ENUM, String> otherRoleMap = {
FIX_ENUM.HAND_OUT: '',
FIX_ENUM.WAIT_PICKUP: '待接单',
FIX_ENUM.PROCESSING: '处理中',
FIX_ENUM.DONE: '已处理',
};
String title;
DateTime dateStart;
FIX_ENUM type;
///dynamic type
///
///img Stringassetimg File File
List imgs;
FixDetailModel detail;
FixModel({
@required this.title,
@required this.dateStart,
@required this.type,
@required this.imgs,
@required this.detail,
});
static List<FixModel> initList() {
return [
FixModel(
title: '小区大道路灯坏了。',
dateStart: DateTime(2020, 10, 25, 14, 28, 56),
type: FIX_ENUM.HAND_OUT,
imgs: [
R.ASSETS_STATIC_FIX_LIGHT1_PNG,
R.ASSETS_STATIC_FIX_LIGHT2_PNG,
R.ASSETS_STATIC_FIX_LIGHT3_PNG,
],
detail: FixDetailModel(
userName: '杨建',
userPhoneNumber: '18882928888',
fixArea: 'C区',
fixStatuses: [
FixStatus(title: '申请保修', date: DateTime(2020, 10, 23, 10, 28, 56)),
],
),
),
FixModel(
title: '小区西大门车栏坏了,请物业尽快修理更换。',
dateStart: DateTime(2020, 10, 21, 7, 28, 56),
type: FIX_ENUM.WAIT_PICKUP,
imgs: [R.ASSETS_STATIC_FIX_AIR1_PNG, R.ASSETS_STATIC_FIX_AIR2_PNG],
detail: FixDetailModel(
userName: '杨建',
userPhoneNumber: '18882928888',
fixArea: 'B区',
type: FIX_PAYMENT_TYPE.FREE,
limit: FIX_DATE_LIMIT.HOUR_24,
subType: FIX_SUB_TYPE.NORMAL,
fixStatuses: [
FixStatus(title: '申请保修', date: DateTime(2020, 10, 23, 10, 28, 56)),
FixStatus(
title: '分派给李保国师傅', date: DateTime(2020, 10, 23, 10, 32, 14)),
FixStatus(title: '师傅已接单', date: DateTime(2020, 10, 23, 10, 38, 26)),
],
result: FixResult(
detail: '电饭煲插头没插',
material: '',
imgs: [R.ASSETS_STATIC_FIX_FOOD_PNG],
),
),
),
FixModel(
title: '家里空调坏了,请师傅抓紧时间尽快维修。',
dateStart: DateTime(2020, 10, 21, 7, 28, 56),
type: FIX_ENUM.PROCESSING,
imgs: [R.ASSETS_STATIC_FIX_AIR1_PNG, R.ASSETS_STATIC_FIX_AIR2_PNG],
detail: FixDetailModel(
userName: '杨建',
userPhoneNumber: '18882929292',
fixArea: 'A区',
type: FIX_PAYMENT_TYPE.FREE,
limit: FIX_DATE_LIMIT.HOUR_24,
subType: FIX_SUB_TYPE.NORMAL,
fixStatuses: [
FixStatus(title: '申请保修', date: DateTime(2020, 10, 23, 10, 28, 56)),
FixStatus(
title: '分派给李保国师傅', date: DateTime(2020, 10, 23, 10, 32, 14)),
FixStatus(title: '师傅已接单', date: DateTime(2020, 10, 23, 10, 38, 26)),
],
),
),
FixModel(
title: '家中电饭煲出问题了,请师傅速来。',
dateStart: DateTime(2020, 10, 22, 9, 28, 56),
type: FIX_ENUM.DONE,
imgs: [R.ASSETS_STATIC_FIX_FOOD2_PNG, R.ASSETS_STATIC_FIX_FOOD_PNG],
detail: FixDetailModel(
userName: '杨建',
userPhoneNumber: '18882929292',
fixArea: 'A区',
type: FIX_PAYMENT_TYPE.PAY,
limit: FIX_DATE_LIMIT.HOUR_24,
subType: FIX_SUB_TYPE.NORMAL,
fixStatuses: [
FixStatus(title: '申请保修', date: DateTime(2020, 10, 23, 10, 28, 56)),
FixStatus(
title: '分派给李保国师傅', date: DateTime(2020, 10, 23, 10, 32, 14)),
FixStatus(title: '师傅已接单', date: DateTime(2020, 10, 23, 10, 38, 26)),
FixStatus(title: '处理完成', date: DateTime(2020, 10, 23, 11, 01, 08)),
],
result: FixResult(
detail: '电饭煲插头没插',
material: '',
imgs: [R.ASSETS_STATIC_FIX_FOOD_PNG],
),
review: UserReviewInfo(
rate: 5,
content: '师傅太用心了',
),
priceDetail: FixPriceDetail(
humanPrice: 10,
materialPrice: 0,
),
),
),
];
}
}
///
enum FIX_PAYMENT_TYPE {
FREE,
PAY,
}
Map<FIX_PAYMENT_TYPE, String> fixPaymentMap = {
FIX_PAYMENT_TYPE.FREE: '无偿服务',
FIX_PAYMENT_TYPE.PAY: '有偿服务',
};
Map<String, FIX_PAYMENT_TYPE> fixPaymentStringMap = {
'无偿服务': FIX_PAYMENT_TYPE.FREE,
'有偿服务': FIX_PAYMENT_TYPE.PAY,
};
///
enum FIX_SUB_TYPE {
///
NORMAL,
///
HURRY,
}
Map<FIX_SUB_TYPE, String> fixSubTypeMap = {
FIX_SUB_TYPE.NORMAL: '一般单',
FIX_SUB_TYPE.HURRY: '加急单',
};
Map<String, FIX_SUB_TYPE> fixSubTypeStringMap = {
'一般单': FIX_SUB_TYPE.NORMAL,
'加急单': FIX_SUB_TYPE.HURRY,
};
///
enum FIX_DATE_LIMIT {
HOUR_24,
HOUR_12,
HOUR_8,
}
Map<FIX_DATE_LIMIT, String> fixDateLimitMap = {
FIX_DATE_LIMIT.HOUR_24: '24小时内处理',
FIX_DATE_LIMIT.HOUR_12: '12小时内处理',
FIX_DATE_LIMIT.HOUR_8: '8小时内处理',
};
Map<String, FIX_DATE_LIMIT> fixDateLimitStringMap = {
'24小时内处理': FIX_DATE_LIMIT.HOUR_24,
'12小时内处理': FIX_DATE_LIMIT.HOUR_12,
'8小时内处理': FIX_DATE_LIMIT.HOUR_8,
};
@deprecated
class FixDetailModel {
///
String userName;
String userPhoneNumber;
String fixArea;
FIX_PAYMENT_TYPE type;
FIX_DATE_LIMIT limit;
FIX_SUB_TYPE subType;
List<FixStatus> fixStatuses;
FixResult result;
UserReviewInfo review;
FixPriceDetail priceDetail;
FixDetailModel({
this.userName,
this.userPhoneNumber,
this.fixArea,
this.type,
this.limit,
this.subType,
this.fixStatuses,
this.result,
this.review,
this.priceDetail,
});
}
class FixStatus {
String title;
DateTime date;
FixStatus({
this.title,
this.date,
});
}
class FixResult {
String detail;
String material;
///dynamic img
List imgs;
FixResult({
this.detail,
this.material,
this.imgs,
});
}
class UserReviewInfo {
double rate;
String content;
UserReviewInfo({
this.rate,
this.content,
});
}
class FixPriceDetail {
double humanPrice;
double materialPrice;
FixPriceDetail({
this.humanPrice,
this.materialPrice,
});
double get allPrice => humanPrice + materialPrice;
}

@ -13,74 +13,74 @@ enum FIXER_TYPE {
}
//TODO CLEAN BOTTOM CODES.
@Deprecated("fixer_model need to be cleaned.")
class FixerModel {
String name;
String phone;
FixerModel({this.name, this.phone});
}
// @Deprecated("fixer_model need to be cleaned.")
// class FixerModel {
// String name;
// String phone;
// FixerModel({this.name, this.phone});
// }
class FixerTypedModel {
FIXER_TYPE type;
String get typeName {
switch (type) {
case FIXER_TYPE.AIR_CONDITION:
return '空调组';
break;
case FIXER_TYPE.ELECTRIC:
return '电力组';
break;
case FIXER_TYPE.CEMENT:
return '水泥组';
break;
case FIXER_TYPE.PROPERTY:
return '物业组';
default:
return '';
}
}
// class FixerTypedModel {
// FIXER_TYPE type;
// String get typeName {
// switch (type) {
// case FIXER_TYPE.AIR_CONDITION:
// return '空调组';
// break;
// case FIXER_TYPE.ELECTRIC:
// return '电力组';
// break;
// case FIXER_TYPE.CEMENT:
// return '水泥组';
// break;
// case FIXER_TYPE.PROPERTY:
// return '物业组';
// default:
// return '';
// }
// }
List<FixerModel> fixers;
FixerTypedModel({
this.type,
this.fixers,
});
// List<FixerModel> fixers;
// FixerTypedModel({
// this.type,
// this.fixers,
// });
static List<FixerTypedModel> models = [
FixerTypedModel(
type: FIXER_TYPE.AIR_CONDITION,
fixers: [
FixerModel(name: '刘能建师傅', phone: '18923747283'),
FixerModel(name: '李惠政师傅', phone: '18910298345'),
FixerModel(name: '李慧珍师傅', phone: '17872342382'),
FixerModel(name: '林 芝师傅', phone: '18292847752'),
],
),
FixerTypedModel(
type: FIXER_TYPE.CEMENT,
fixers: [
FixerModel(name: '李雷师傅', phone: '18923747283'),
FixerModel(name: '林智师傅', phone: '18910298345'),
FixerModel(name: '刘凯欣师傅', phone: '17872342382'),
FixerModel(name: '张亮师傅', phone: '18292847752'),
],
),
FixerTypedModel(
type: FIXER_TYPE.ELECTRIC,
fixers: [
FixerModel(name: '李建国师傅', phone: '18923747283'),
FixerModel(name: '李历程师傅', phone: '18910298345'),
],
),
];
// static List<FixerTypedModel> models = [
// FixerTypedModel(
// type: FIXER_TYPE.AIR_CONDITION,
// fixers: [
// FixerModel(name: '刘能建师傅', phone: '18923747283'),
// FixerModel(name: '李惠政师傅', phone: '18910298345'),
// FixerModel(name: '李慧珍师傅', phone: '17872342382'),
// FixerModel(name: '林 芝师傅', phone: '18292847752'),
// ],
// ),
// FixerTypedModel(
// type: FIXER_TYPE.CEMENT,
// fixers: [
// FixerModel(name: '李雷师傅', phone: '18923747283'),
// FixerModel(name: '林智师傅', phone: '18910298345'),
// FixerModel(name: '刘凯欣师傅', phone: '17872342382'),
// FixerModel(name: '张亮师傅', phone: '18292847752'),
// ],
// ),
// FixerTypedModel(
// type: FIXER_TYPE.ELECTRIC,
// fixers: [
// FixerModel(name: '李建国师傅', phone: '18923747283'),
// FixerModel(name: '李历程师傅', phone: '18910298345'),
// ],
// ),
// ];
static List<FixerTypedModel> propertyModels = [
FixerTypedModel(
type: FIXER_TYPE.PROPERTY,
fixers: [
FixerModel(name: '李国师傅', phone: '18923747283'),
FixerModel(name: '章则林师傅', phone: '18910298345'),
],
),
];
}
// static List<FixerTypedModel> propertyModels = [
// FixerTypedModel(
// type: FIXER_TYPE.PROPERTY,
// fixers: [
// FixerModel(name: '李国师傅', phone: '18923747283'),
// FixerModel(name: '章则林师傅', phone: '18910298345'),
// ],
// ),
// ];
// }

@ -1,59 +0,0 @@
class GreenManageCardModel {
String title;
String task;
String timestart;
String timeend;
String name;
String body;
GreenManageCardModel(this.title, this.task, this.timestart, this.timeend,
this.name, this.body);
static List<GreenManageCardModel> initList() {
return [
GreenManageCardModel(
'中部广场周围绿化调整', '除杂草、松土、培土', '2020-10-08', '2020-10-18', '陈晖洁', '''详细描述
1.
使
2.绿
绿'''),
GreenManageCardModel(
'东区周围绿化调整', '修剪、造型', '2020-10-08', '2020-10-18', '刘小青', ''),
GreenManageCardModel(
'西区周围绿化调整', '修剪、造型', '2020-10-10', '2020-10-20', '张空间', ''),
GreenManageCardModel(
'北区周围绿化调整', '修剪造型', '2020-10-15', '2020-10-25', '凯尔希', ''),
];
}
}
class InspectionManageCardModel {
String title;
String date;
String cycle;
String time;
List<String> persons;
List<String> stations;
InspectionManageCardModel(this.title, this.date, this.cycle, this.time,
this.persons, this.stations);
static List<InspectionManageCardModel> initList() {
return [
InspectionManageCardModel(
'1号巡检任务',
'2020.1-2020.12',
'每周一、三、五',
'8:00-12:00',
['王珂', '陈晖洁', '凯尔希', '王铁锤', '李狗蛋', '尼古拉斯'],
['小区东门入口', '1号南门', '3号门站', '3号闸门', '4号门站']),
InspectionManageCardModel(
'2号巡检任务', '2020.1-2020.12', '每周二', '8:00-12:00', ['史尔特尔'], []),
InspectionManageCardModel(
'3号巡检任务', '2020.1-2020.12', '每周二、四、六', '8:00-12:00', ['叶莲娜'], []),
];
}
}

@ -1,84 +0,0 @@
// Dart imports:
import 'dart:io';
@Deprecated('use canOpertion/canSendTicket/canPickUpTicke/canPass instead')
enum USER_ROLE {
///
MANAGER,
///
FIXER,
///
SECURITY,
///
PROPERTY,
///
EMPTY,
}
@Deprecated('use infoModel instead')
class UserInfoModel {
String nickName;
File avatar;
USER_ROLE role;
String phone;
String get securePhone {
if (phone.length < 8)
return phone;
else
return '${phone.substring(0, 3)}****${phone.substring(7)}';
}
UserInfoModel({
this.nickName,
this.avatar,
this.role,
this.phone,
});
UserInfoModel.empty({
this.nickName = '',
this.avatar,
this.role = USER_ROLE.MANAGER,
this.phone = '',
});
///
///password 000000
UserInfoModel.manager({
this.nickName = '李管家',
this.avatar,
this.role = USER_ROLE.MANAGER,
this.phone = '18819289976',
});
///
///password 000001
UserInfoModel.fixer({
this.nickName = '王师傅',
this.avatar,
this.role = USER_ROLE.FIXER,
this.phone = '18927139123',
});
///
///password 000002
UserInfoModel.security({
this.nickName = '林保安',
this.avatar,
this.role = USER_ROLE.SECURITY,
this.phone = '13918237877',
});
///
///password 000003
UserInfoModel.property({
this.nickName = '刘物业',
this.avatar,
this.role = USER_ROLE.PROPERTY,
this.phone = '18965438676',
});
}

@ -1,71 +0,0 @@
// Flutter imports:
import 'package:flutter/material.dart';
// Package imports:
import 'package:provider/provider.dart';
// Project imports:
import 'package:aku_community_manager/mock_models/fix/fix_model.dart';
import 'package:aku_community_manager/mock_models/fix/fixer_model.dart';
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
import 'package:aku_community_manager/provider/user_provider.dart';
//TODO CLEAN BOTTOM CODES.
@Deprecated("fix_provider need to be cleaned.")
class FixProvider extends ChangeNotifier {
List<FixModel> _fixModels = FixModel.initList();
List<FixModel> get fixModels => _fixModels;
addFixModel(FixModel model) {
_fixModels.insert(0, model);
notifyListeners();
}
List<FixModel> getFixModel(int index, BuildContext context) {
final userProvider = Provider.of<UserProvider>(context, listen: false);
USER_ROLE role = userProvider.userInfoModel.role;
List<FixModel> _doneModels =
_fixModels.where((element) => element.type == FIX_ENUM.DONE).toList();
List<FixModel> _processingModels = _fixModels
.where((element) => element.type == FIX_ENUM.PROCESSING)
.toList();
List<FixModel> _handOutModels = _fixModels
.where((element) => element.type == FIX_ENUM.HAND_OUT)
.toList();
List<FixModel> _waitPickUpModels = _fixModels
.where((element) => element.type == FIX_ENUM.WAIT_PICKUP)
.toList();
List<FixModel> _fixerModels = _fixModels
.where((element) => element.type != FIX_ENUM.HAND_OUT)
.toList();
switch (role) {
case USER_ROLE.MANAGER:
return [
_handOutModels,
_waitPickUpModels,
_processingModels,
_doneModels,
_fixModels,
][index];
break;
default:
return [
_waitPickUpModels,
_processingModels,
_doneModels,
_fixerModels,
][index];
break;
}
}
List<FixerTypedModel> _fixerModels = FixerTypedModel.models;
List<FixerTypedModel> _propertyModels = FixerTypedModel.propertyModels;
List<FixerTypedModel> get fixerModels => _fixerModels;
List<FixerTypedModel> get propertyModels => _propertyModels;
}

@ -1,20 +0,0 @@
// Flutter imports:
import 'package:flutter/material.dart';
// Project imports:
import 'package:aku_community_manager/mock_models/manage_models/manage_model.dart';
class GreenManageProvider extends ChangeNotifier {
List<GreenManageCardModel> _greenManageModel =
GreenManageCardModel.initList();
List<GreenManageCardModel> get greenManageModels => _greenManageModel;
notifyListeners();
}
class InspectionManageProvider extends ChangeNotifier {
List<InspectionManageCardModel> _inspectionManageModel =
InspectionManageCardModel.initList();
List<InspectionManageCardModel> get inspectionManageModels =>
_inspectionManageModel;
notifyListeners();
}

@ -2,6 +2,7 @@
import 'dart:io';
// Flutter imports:
import 'package:aku_community_manager/models/user/user_info_model.dart';
import 'package:flutter/material.dart';
// Package imports:
@ -12,7 +13,6 @@ import 'package:provider/provider.dart';
// Project imports:
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
import 'package:aku_community_manager/models/user/user_profile_model.dart';
import 'package:aku_community_manager/provider/app_provider.dart';
import 'package:aku_community_manager/utils/hive_store.dart';
@ -20,9 +20,7 @@ import 'package:aku_community_manager/utils/network/base_file_model.dart';
import 'package:aku_community_manager/utils/network/base_model.dart';
import 'package:aku_community_manager/utils/network/net_util.dart';
import 'package:aku_community_manager/models/user/user_info_model.dart'
as USER_INFO;
//
class UserProvider extends ChangeNotifier {
bool _isLogin = false;
@ -45,8 +43,8 @@ class UserProvider extends ChangeNotifier {
UserProfileModel _profileModel;
UserProfileModel get profileModel => _profileModel;
USER_INFO.UserInfoModel _infoModel;
USER_INFO.UserInfoModel get infoModel => _infoModel;
UserInfoModel _infoModel;
UserInfoModel get infoModel => _infoModel;
///profile
Future<UserProfileModel> updateProfile() async {
@ -59,13 +57,13 @@ class UserProvider extends ChangeNotifier {
return UserProfileModel.fromJson(model.data);
}
Future<USER_INFO.UserInfoModel> updateUserInfo() async {
Future<UserInfoModel> updateUserInfo() async {
BaseModel model = await NetUtil().get(API.user.info);
if (model == null)
return null;
else {
var userModel = USER_INFO.UserInfoModel.fromJson(model.data);
var userModel = UserInfoModel.fromJson(model.data);
JPush().setAlias(userModel.id.toString());
return userModel;
}
@ -92,15 +90,9 @@ class UserProvider extends ChangeNotifier {
notifyListeners();
}
UserInfoModel _userInfoModel = UserInfoModel.empty();
UserInfoModel get userInfoModel => _userInfoModel;
setUserInfo(UserInfoModel model) {
_userInfoModel = model;
_isSigned = true;
notifyListeners();
}
///
setNickName(String name) {

@ -21,7 +21,8 @@ class ClockInOutMainPage extends StatefulWidget {
_ClockInOutMainPageState createState() => _ClockInOutMainPageState();
}
class _ClockInOutMainPageState extends State<ClockInOutMainPage> with AutomaticKeepAliveClientMixin {
class _ClockInOutMainPageState extends State<ClockInOutMainPage>
with AutomaticKeepAliveClientMixin {
EasyRefreshController _refreshController;
Timer _clockSetState;
DateTime _lastPressed;
@ -57,6 +58,7 @@ class _ClockInOutMainPageState extends State<ClockInOutMainPage> with AutomaticK
@override
Widget build(BuildContext context) {
super.build(context);
return EasyRefresh(
firstRefresh: true,
header: MaterialHeader(),

@ -144,7 +144,6 @@ class _BorrowManagerCardState extends State<BorrowManagerCard> {
color: AppStyle.primaryColor,
radius: 4.w,
onPressed: () async {
//TODO unknown param `butlerMessage`
Function cancel = BotToast.showLoading();
await NetUtil().post(
API.manage.remindUserReturn,

@ -6,7 +6,6 @@ import 'package:get/get.dart';
import 'package:provider/provider.dart';
// Project imports:
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/sub_pages/borrow_manager/all_borrow_goods.dart';
@ -23,8 +22,7 @@ class BorrowManagerPage extends StatefulWidget {
class _BorrowManagerPageState extends State<BorrowManagerPage>
with TickerProviderStateMixin {
USER_ROLE get role =>
Provider.of<UserProvider>(context, listen: false).userInfoModel.role;
TabController _tabController;
List<String> get _tabs {
final userProvider = Provider.of<UserProvider>(context, listen: false);

@ -60,7 +60,6 @@ class _BusinessAndFixPageState extends State<BusinessAndFixPage>
@override
Widget build(BuildContext context) {
final userProvider = Provider.of<UserProvider>(context, listen: false);
return AkuScaffold(
title: '报事报修',
appBarBottom: PreferredSize(

@ -1,50 +1,49 @@
// Flutter imports:
import 'package:flutter/material.dart';
// // Flutter imports:
// import 'package:flutter/material.dart';
// Project imports:
import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
// // Project imports:
// import 'package:aku_community_manager/style/app_style.dart';
// import 'package:aku_community_manager/tools/screen_tool.dart';
// import 'package:aku_community_manager/tools/widget_tool.dart';
class DecorationCheckCardWidget extends StatelessWidget {
final CHECK_TYPE type;
final bool checked;
const DecorationCheckCardWidget(
{Key key, @required this.type, this.checked = false})
: super(key: key);
// class DecorationCheckCardWidget extends StatelessWidget {
// final CHECK_TYPE type;
// final bool checked;
// const DecorationCheckCardWidget(
// {Key key, @required this.type, this.checked = false})
// : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
height: 160.w,
width: 124.w,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
checkAssetMap[type],
height: 56.w,
width: 56.w,
),
AkuBox.h(4),
Text(
checkTypeMap[type],
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 24.sp,
),
),
],
),
decoration: BoxDecoration(
border: Border.all(
color: checked ? AppStyle.primaryTextColor : Color(0xFFE8E8E8),
width: 3.w,
),
borderRadius: BorderRadius.circular(8.w),
color: checked ? Color(0xFFFFF3CC) : Colors.white,
),
);
}
}
// @override
// Widget build(BuildContext context) {
// return Container(
// height: 160.w,
// width: 124.w,
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Image.asset(
// checkAssetMap[type],
// height: 56.w,
// width: 56.w,
// ),
// AkuBox.h(4),
// Text(
// checkTypeMap[type],
// style: TextStyle(
// color: AppStyle.primaryTextColor,
// fontSize: 24.sp,
// ),
// ),
// ],
// ),
// decoration: BoxDecoration(
// border: Border.all(
// color: checked ? AppStyle.primaryTextColor : Color(0xFFE8E8E8),
// width: 3.w,
// ),
// borderRadius: BorderRadius.circular(8.w),
// color: checked ? Color(0xFFFFF3CC) : Colors.white,
// ),
// );
// }
// }

@ -1,70 +1,70 @@
// Flutter imports:
import 'package:flutter/material.dart';
// // Flutter imports:
// import 'package:flutter/material.dart';
// Project imports:
import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart';
import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_check_card_widget.dart';
// // Project imports:
// import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart';
// import 'package:aku_community_manager/tools/screen_tool.dart';
// import 'package:aku_community_manager/tools/widget_tool.dart';
// import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_check_card_widget.dart';
class DecorationCheckRow extends StatefulWidget {
final List<CHECK_TYPE> details;
final Function(List<CHECK_TYPE> details) onChange;
final bool canTap;
DecorationCheckRow(
{Key key, @required this.details, this.onChange, this.canTap = false})
: super(key: key);
// class DecorationCheckRow extends StatefulWidget {
// final List<CHECK_TYPE> details;
// final Function(List<CHECK_TYPE> details) onChange;
// final bool canTap;
// DecorationCheckRow(
// {Key key, @required this.details, this.onChange, this.canTap = false})
// : super(key: key);
@override
_DecorationCheckRowState createState() => _DecorationCheckRowState();
}
// @override
// _DecorationCheckRowState createState() => _DecorationCheckRowState();
// }
class _DecorationCheckRowState extends State<DecorationCheckRow> {
List<CHECK_TYPE> _tempCheckDetails = [];
List<CHECK_TYPE> _checkedDetails = [];
@override
void initState() {
super.initState();
_tempCheckDetails = widget.details;
widget.details.forEach((element) {
_checkedDetails.add(element);
});
}
// class _DecorationCheckRowState extends State<DecorationCheckRow> {
// List<CHECK_TYPE> _tempCheckDetails = [];
// List<CHECK_TYPE> _checkedDetails = [];
// @override
// void initState() {
// super.initState();
// _tempCheckDetails = widget.details;
// widget.details.forEach((element) {
// _checkedDetails.add(element);
// });
// }
@override
Widget build(BuildContext context) {
return SizedBox(
height: 160.w,
child: ListView.separated(
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) {
return GestureDetector(
onTap: !widget.canTap
? null
: () {
widget.onChange(_checkedDetails);
setState(() {
_checkedDetails.indexOf(_tempCheckDetails[index]) != -1
? _checkedDetails.remove(_tempCheckDetails[index])
: _checkedDetails.add(_tempCheckDetails[index]);
});
},
child: Material(
color: Colors.transparent,
child: DecorationCheckCardWidget(
type: _tempCheckDetails[index],
checked: !widget.canTap
? false
: _checkedDetails.indexOf(_tempCheckDetails[index]) != -1,
),
),
);
},
itemCount: _tempCheckDetails.length,
separatorBuilder: (context, index) {
return AkuBox.w(16);
},
),
);
}
}
// @override
// Widget build(BuildContext context) {
// return SizedBox(
// height: 160.w,
// child: ListView.separated(
// scrollDirection: Axis.horizontal,
// itemBuilder: (context, index) {
// return GestureDetector(
// onTap: !widget.canTap
// ? null
// : () {
// widget.onChange(_checkedDetails);
// setState(() {
// _checkedDetails.indexOf(_tempCheckDetails[index]) != -1
// ? _checkedDetails.remove(_tempCheckDetails[index])
// : _checkedDetails.add(_tempCheckDetails[index]);
// });
// },
// child: Material(
// color: Colors.transparent,
// child: DecorationCheckCardWidget(
// type: _tempCheckDetails[index],
// checked: !widget.canTap
// ? false
// : _checkedDetails.indexOf(_tempCheckDetails[index]) != -1,
// ),
// ),
// );
// },
// itemCount: _tempCheckDetails.length,
// separatorBuilder: (context, index) {
// return AkuBox.w(16);
// },
// ),
// );
// }
// }

@ -1,192 +1,190 @@
// Flutter imports:
import 'package:aku_community_manager/ui/widgets/common/aku_material_button.dart';
import 'package:flutter/material.dart';
// // Flutter imports:
// import 'package:aku_community_manager/ui/widgets/common/aku_material_button.dart';
// import 'package:flutter/material.dart';
// Package imports:
import 'package:expandable/expandable.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
// // Package imports:
// import 'package:expandable/expandable.dart';
// import 'package:get/get.dart';
// Project imports:
import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart';
import 'package:aku_community_manager/mock_models/fix/fixer_model.dart';
import 'package:aku_community_manager/provider/fix_provider.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
// // Project imports:
// import 'package:aku_community_manager/const/resource.dart';
// import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart';
// import 'package:aku_community_manager/mock_models/fix/fixer_model.dart';
// import 'package:aku_community_manager/style/app_style.dart';
// import 'package:aku_community_manager/tools/screen_tool.dart';
// import 'package:aku_community_manager/tools/widget_tool.dart';
// import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
class DecorationDepartmentPage extends StatefulWidget {
final DecorationModel model;
DecorationDepartmentPage({Key key, @required this.model}) : super(key: key);
// class DecorationDepartmentPage extends StatefulWidget {
// final DecorationModel model;
// DecorationDepartmentPage({Key key, @required this.model}) : super(key: key);
@override
_DecorationDepartmentPageState createState() =>
_DecorationDepartmentPageState();
}
// @override
// _DecorationDepartmentPageState createState() =>
// _DecorationDepartmentPageState();
// }
class _DecorationDepartmentPageState extends State<DecorationDepartmentPage> {
FixerModel _pickedFixer;
@override
Widget build(BuildContext context) {
final fixProvider = Provider.of<FixProvider>(context);
// class _DecorationDepartmentPageState extends State<DecorationDepartmentPage> {
// FixerModel _pickedFixer;
// @override
// Widget build(BuildContext context) {
// // final fixProvider = Provider.of<FixProvider>(context);
return AkuScaffold(
title: '装修指派',
body: ListView.builder(
padding: EdgeInsets.symmetric(vertical: 16.w),
itemBuilder: (context, index) {
return _buildItem(fixProvider.propertyModels[index], index);
},
itemCount: fixProvider.propertyModels.length,
),
bottom: AkuMaterialButton(
height: 96.w,
onPressed: _pickedFixer == null
? null
: () {
widget.model.cycleCheck.authPerson = _pickedFixer;
Get.back();
},
color: AppStyle.primaryColor,
nullColor: AppStyle.primaryColor.withOpacity(0.5),
child: Text(
'选择完成',
style: TextStyle(
color: _pickedFixer == null
? AppStyle.minorTextColor
: AppStyle.primaryTextColor,
fontSize: 32.w,
fontWeight: FontWeight.bold,
),
),
),
);
}
// return AkuScaffold(
// title: '装修指派',
// // body: ListView.builder(
// // padding: EdgeInsets.symmetric(vertical: 16.w),
// // itemBuilder: (context, index) {
// // return _buildItem(fixProvider.propertyModels[index], index);
// // },
// // itemCount: fixProvider.propertyModels.length,
// // ),
// bottom: AkuMaterialButton(
// height: 96.w,
// onPressed: _pickedFixer == null
// ? null
// : () {
// widget.model.cycleCheck.authPerson = _pickedFixer;
// Get.back();
// },
// color: AppStyle.primaryColor,
// nullColor: AppStyle.primaryColor.withOpacity(0.5),
// child: Text(
// '选择完成',
// style: TextStyle(
// color: _pickedFixer == null
// ? AppStyle.minorTextColor
// : AppStyle.primaryTextColor,
// fontSize: 32.w,
// fontWeight: FontWeight.bold,
// ),
// ),
// ),
// );
// }
_buildItem(FixerTypedModel model, int index) {
return Container(
decoration: BoxDecoration(
border: Border(
top: index == 0
? BorderSide.none
: BorderSide(color: Color(0xFFE8E8E8), width: 1.w),
bottom: BorderSide(color: Color(0xFFE8E8E8), width: 1.w),
),
),
child: Material(
color: Colors.white,
child: ExpandablePanel(
controller: ExpandableController(initialExpanded: true),
header: Container(
height: 96.w,
alignment: Alignment.centerLeft,
padding: EdgeInsets.symmetric(horizontal: 32.w),
child: Text(
model.typeName,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 32.sp,
fontWeight: FontWeight.bold,
),
),
),
collapsed: SizedBox(),
expanded: Column(
mainAxisSize: MainAxisSize.min,
children: [
Divider(
color: Color(0xFFE8E8E8),
height: 1.w,
thickness: 1.w,
),
...model.fixers.map((e) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
AkuMaterialButton(
height: 96.w,
onPressed: () {
if (_pickedFixer?.name != e.name) {
_pickedFixer = e;
} else {
_pickedFixer = null;
}
setState(() {});
},
child: Row(
children: [
AkuBox.w(72),
Checkbox(
checkColor: AppStyle.primaryTextColor,
activeColor: AppStyle.primaryColor,
value: _pickedFixer?.name == e.name,
onChanged: (state) {
if (_pickedFixer == null) {
_pickedFixer = e;
} else {
_pickedFixer = null;
}
setState(() {});
},
materialTapTargetSize:
MaterialTapTargetSize.shrinkWrap,
),
Image.asset(
R.ASSETS_MESSAGE_IC_PEOPLE_PNG,
height: 40.w,
width: 40.w,
),
Text(
e.name,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.w,
fontWeight: FontWeight.bold,
),
),
Spacer(),
Image.asset(
R.ASSETS_MESSAGE_IC_PHONE_PNG,
height: 40.w,
width: 40.w,
),
Text(
e.phone,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.w,
fontWeight: FontWeight.bold,
),
),
AkuBox.w(101),
],
),
),
model.fixers.last == e
? SizedBox()
: Divider(
indent: 32.w,
endIndent: 32.w,
height: 1.w,
thickness: 1.w,
color: Color(0xFFE8E8E8),
),
],
);
}).toList()
],
),
theme: ExpandableThemeData(
tapHeaderToExpand: true,
iconPlacement: ExpandablePanelIconPlacement.right,
iconPadding: EdgeInsets.only(top: 32.w, right: 32.w),
iconSize: 32.w,
iconColor: AppStyle.minorTextColor,
),
),
),
);
}
}
// _buildItem(FixerTypedModel model, int index) {
// return Container(
// decoration: BoxDecoration(
// border: Border(
// top: index == 0
// ? BorderSide.none
// : BorderSide(color: Color(0xFFE8E8E8), width: 1.w),
// bottom: BorderSide(color: Color(0xFFE8E8E8), width: 1.w),
// ),
// ),
// child: Material(
// color: Colors.white,
// child: ExpandablePanel(
// controller: ExpandableController(initialExpanded: true),
// header: Container(
// height: 96.w,
// alignment: Alignment.centerLeft,
// padding: EdgeInsets.symmetric(horizontal: 32.w),
// child: Text(
// model.typeName,
// style: TextStyle(
// color: AppStyle.primaryTextColor,
// fontSize: 32.sp,
// fontWeight: FontWeight.bold,
// ),
// ),
// ),
// collapsed: SizedBox(),
// expanded: Column(
// mainAxisSize: MainAxisSize.min,
// children: [
// Divider(
// color: Color(0xFFE8E8E8),
// height: 1.w,
// thickness: 1.w,
// ),
// ...model.fixers.map((e) {
// return Column(
// mainAxisSize: MainAxisSize.min,
// children: [
// AkuMaterialButton(
// height: 96.w,
// onPressed: () {
// if (_pickedFixer?.name != e.name) {
// _pickedFixer = e;
// } else {
// _pickedFixer = null;
// }
// setState(() {});
// },
// child: Row(
// children: [
// AkuBox.w(72),
// Checkbox(
// checkColor: AppStyle.primaryTextColor,
// activeColor: AppStyle.primaryColor,
// value: _pickedFixer?.name == e.name,
// onChanged: (state) {
// if (_pickedFixer == null) {
// _pickedFixer = e;
// } else {
// _pickedFixer = null;
// }
// setState(() {});
// },
// materialTapTargetSize:
// MaterialTapTargetSize.shrinkWrap,
// ),
// Image.asset(
// R.ASSETS_MESSAGE_IC_PEOPLE_PNG,
// height: 40.w,
// width: 40.w,
// ),
// Text(
// e.name,
// style: TextStyle(
// color: AppStyle.primaryTextColor,
// fontSize: 28.w,
// fontWeight: FontWeight.bold,
// ),
// ),
// Spacer(),
// Image.asset(
// R.ASSETS_MESSAGE_IC_PHONE_PNG,
// height: 40.w,
// width: 40.w,
// ),
// Text(
// e.phone,
// style: TextStyle(
// color: AppStyle.primaryTextColor,
// fontSize: 28.w,
// fontWeight: FontWeight.bold,
// ),
// ),
// AkuBox.w(101),
// ],
// ),
// ),
// model.fixers.last == e
// ? SizedBox()
// : Divider(
// indent: 32.w,
// endIndent: 32.w,
// height: 1.w,
// thickness: 1.w,
// color: Color(0xFFE8E8E8),
// ),
// ],
// );
// }).toList()
// ],
// ),
// theme: ExpandableThemeData(
// tapHeaderToExpand: true,
// iconPlacement: ExpandablePanelIconPlacement.right,
// iconPadding: EdgeInsets.only(top: 32.w, right: 32.w),
// iconSize: 32.w,
// iconColor: AppStyle.minorTextColor,
// ),
// ),
// ),
// );
// }
// }

@ -1,275 +1,275 @@
// Flutter imports:
import 'package:flutter/material.dart';
// // Flutter imports:
// import 'package:flutter/material.dart';
// Package imports:
import 'package:common_utils/common_utils.dart';
import 'package:get/get.dart';
// // Package imports:
// import 'package:common_utils/common_utils.dart';
// import 'package:get/get.dart';
// Project imports:
import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_checkbox.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_success_page.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_bottom_button.dart';
// // Project imports:
// import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart';
// import 'package:aku_community_manager/style/app_style.dart';
// import 'package:aku_community_manager/tools/widget_tool.dart';
// import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_checkbox.dart';
// import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_success_page.dart';
// import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
// import 'package:aku_community_manager/ui/widgets/inner/aku_bottom_button.dart';
class DecorationFollowCheck extends StatefulWidget {
final DecorationModel model;
DecorationFollowCheck({Key key, @required this.model}) : super(key: key);
// class DecorationFollowCheck extends StatefulWidget {
// final DecorationModel model;
// DecorationFollowCheck({Key key, @required this.model}) : super(key: key);
@override
_DecorationFollowCheckState createState() => _DecorationFollowCheckState();
}
// @override
// _DecorationFollowCheckState createState() => _DecorationFollowCheckState();
// }
class _DecorationFollowCheckState extends State<DecorationFollowCheck> {
Map<CHECK_TYPE, bool> checkStatus = {
CHECK_TYPE.ELECTRIC: true,
CHECK_TYPE.WATER: true,
CHECK_TYPE.WALL: true,
CHECK_TYPE.DOOR_AND_WINDOWS: true,
CHECK_TYPE.SECURITY: true,
};
// class _DecorationFollowCheckState extends State<DecorationFollowCheck> {
// Map<CHECK_TYPE, bool> checkStatus = {
// CHECK_TYPE.ELECTRIC: true,
// CHECK_TYPE.WATER: true,
// CHECK_TYPE.WALL: true,
// CHECK_TYPE.DOOR_AND_WINDOWS: true,
// CHECK_TYPE.SECURITY: true,
// };
bool get success {
for (var item in checkStatus.keys) {
if (checkStatus[item] == false) return false;
}
return true;
}
// bool get success {
// for (var item in checkStatus.keys) {
// if (checkStatus[item] == false) return false;
// }
// return true;
// }
TextEditingController _textEditingController = TextEditingController();
@override
void dispose() {
_textEditingController?.dispose();
super.dispose();
}
// TextEditingController _textEditingController = TextEditingController();
// @override
// void dispose() {
// _textEditingController?.dispose();
// super.dispose();
// }
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '跟踪检查',
body: ListView(
padding: EdgeInsets.symmetric(vertical: 16.w),
children: [
Container(
color: Colors.white,
padding: EdgeInsets.symmetric(
horizontal: 32.w,
vertical: 16.w,
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
child: Row(
children: [
Container(
height: 56.w,
width: 56.w,
alignment: Alignment.center,
child: Text(
'',
style: TextStyle(
color: AppStyle.secondaryColor,
fontSize: 24.sp,
fontWeight: FontWeight.bold,
),
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(28.w),
color: Color(0xFFE9F2FF),
),
),
AkuBox.w(30),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget.model.userHomeModel.plot,
style: TextStyle(
fontWeight: FontWeight.bold,
color: AppStyle.primaryTextColor,
fontSize: 24.sp,
),
),
Text(
widget.model.userHomeModel.detailAddr,
style: TextStyle(
fontWeight: FontWeight.bold,
color: AppStyle.primaryTextColor,
fontSize: 24.sp,
),
),
],
),
),
],
),
padding: EdgeInsets.symmetric(
vertical: 26.w,
horizontal: 32.w,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
color: Color(0xFFF9F9F9),
),
),
AkuBox.h(16),
Container(
child: Row(
children: [
Container(
height: 56.w,
width: 56.w,
alignment: Alignment.center,
child: Text(
'',
style: TextStyle(
color: AppStyle.secondaryColor,
fontSize: 24.sp,
fontWeight: FontWeight.bold,
),
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(28.w),
color: Color(0xFFE9F2FF),
),
),
AkuBox.w(30),
Expanded(
child: Text(
widget.model.decorationTeamModel.name,
style: TextStyle(
fontWeight: FontWeight.bold,
color: AppStyle.primaryTextColor,
fontSize: 24.sp,
),
),
),
],
),
padding: EdgeInsets.symmetric(
vertical: 26.w,
horizontal: 32.w,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
color: Color(0xFFF9F9F9),
),
),
AkuBox.h(16),
Row(
children: [
Text(
'${DateUtil.formatDate(
DateTime.now(),
format: 'yyyy-MM-dd',
)} ',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.w,
fontWeight: FontWeight.bold,
),
),
Spacer(),
AkuBox.h(96),
Text(
success ? '正常' : '异常',
style: TextStyle(
color: success
? AppStyle.successColor
: AppStyle.failColor,
fontSize: 28.w,
fontWeight: FontWeight.bold,
),
),
],
),
_buildRow(CHECK_TYPE.ELECTRIC),
_buildRow(CHECK_TYPE.WATER),
_buildRow(CHECK_TYPE.WALL),
_buildRow(CHECK_TYPE.DOOR_AND_WINDOWS),
_buildRow(CHECK_TYPE.SECURITY),
TextField(
minLines: 3,
maxLines: 99,
controller: _textEditingController,
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(
vertical: 16.w,
horizontal: 24.w,
),
hintText: '请输入检查描述',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.w),
borderSide: BorderSide(
width: 2.w,
color: Color(0xFFE8E8E8),
),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.w),
borderSide: BorderSide(
width: 2.w,
color: Color(0xFFE8E8E8),
),
),
),
),
],
),
),
],
),
bottom: AkuBottomButton(
onTap: () {
widget.model.checkInfomations.add(
CheckInfomation(
checkDate: DateTime.now(),
checkType: '周期检查',
info: _textEditingController.text,
details: checkStatus.entries.map((e) {
return CheckDetail(type: e.key, status: e.value);
}).toList(),
),
);
widget.model.type = DecorationType.DONE;
Get.off(DecorationSuccessPage());
},
title: '确认提交',
),
);
}
// @override
// Widget build(BuildContext context) {
// return AkuScaffold(
// title: '跟踪检查',
// body: ListView(
// padding: EdgeInsets.symmetric(vertical: 16.w),
// children: [
// Container(
// color: Colors.white,
// padding: EdgeInsets.symmetric(
// horizontal: 32.w,
// vertical: 16.w,
// ),
// child: Column(
// mainAxisSize: MainAxisSize.min,
// children: [
// Container(
// child: Row(
// children: [
// Container(
// height: 56.w,
// width: 56.w,
// alignment: Alignment.center,
// child: Text(
// '',
// style: TextStyle(
// color: AppStyle.secondaryColor,
// fontSize: 24.sp,
// fontWeight: FontWeight.bold,
// ),
// ),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(28.w),
// color: Color(0xFFE9F2FF),
// ),
// ),
// AkuBox.w(30),
// Expanded(
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Text(
// widget.model.userHomeModel.plot,
// style: TextStyle(
// fontWeight: FontWeight.bold,
// color: AppStyle.primaryTextColor,
// fontSize: 24.sp,
// ),
// ),
// Text(
// widget.model.userHomeModel.detailAddr,
// style: TextStyle(
// fontWeight: FontWeight.bold,
// color: AppStyle.primaryTextColor,
// fontSize: 24.sp,
// ),
// ),
// ],
// ),
// ),
// ],
// ),
// padding: EdgeInsets.symmetric(
// vertical: 26.w,
// horizontal: 32.w,
// ),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(8.w),
// color: Color(0xFFF9F9F9),
// ),
// ),
// AkuBox.h(16),
// Container(
// child: Row(
// children: [
// Container(
// height: 56.w,
// width: 56.w,
// alignment: Alignment.center,
// child: Text(
// '',
// style: TextStyle(
// color: AppStyle.secondaryColor,
// fontSize: 24.sp,
// fontWeight: FontWeight.bold,
// ),
// ),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(28.w),
// color: Color(0xFFE9F2FF),
// ),
// ),
// AkuBox.w(30),
// Expanded(
// child: Text(
// widget.model.decorationTeamModel.name,
// style: TextStyle(
// fontWeight: FontWeight.bold,
// color: AppStyle.primaryTextColor,
// fontSize: 24.sp,
// ),
// ),
// ),
// ],
// ),
// padding: EdgeInsets.symmetric(
// vertical: 26.w,
// horizontal: 32.w,
// ),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(8.w),
// color: Color(0xFFF9F9F9),
// ),
// ),
// AkuBox.h(16),
// Row(
// children: [
// Text(
// '${DateUtil.formatDate(
// DateTime.now(),
// format: 'yyyy-MM-dd',
// )} ',
// style: TextStyle(
// color: AppStyle.primaryTextColor,
// fontSize: 28.w,
// fontWeight: FontWeight.bold,
// ),
// ),
// Spacer(),
// AkuBox.h(96),
// Text(
// success ? '正常' : '异常',
// style: TextStyle(
// color: success
// ? AppStyle.successColor
// : AppStyle.failColor,
// fontSize: 28.w,
// fontWeight: FontWeight.bold,
// ),
// ),
// ],
// ),
// _buildRow(CHECK_TYPE.ELECTRIC),
// _buildRow(CHECK_TYPE.WATER),
// _buildRow(CHECK_TYPE.WALL),
// _buildRow(CHECK_TYPE.DOOR_AND_WINDOWS),
// _buildRow(CHECK_TYPE.SECURITY),
// TextField(
// minLines: 3,
// maxLines: 99,
// controller: _textEditingController,
// decoration: InputDecoration(
// contentPadding: EdgeInsets.symmetric(
// vertical: 16.w,
// horizontal: 24.w,
// ),
// hintText: '请输入检查描述',
// border: OutlineInputBorder(
// borderRadius: BorderRadius.circular(8.w),
// borderSide: BorderSide(
// width: 2.w,
// color: Color(0xFFE8E8E8),
// ),
// ),
// focusedBorder: OutlineInputBorder(
// borderRadius: BorderRadius.circular(8.w),
// borderSide: BorderSide(
// width: 2.w,
// color: Color(0xFFE8E8E8),
// ),
// ),
// ),
// ),
// ],
// ),
// ),
// ],
// ),
// bottom: AkuBottomButton(
// onTap: () {
// widget.model.checkInfomations.add(
// CheckInfomation(
// checkDate: DateTime.now(),
// checkType: '周期检查',
// info: _textEditingController.text,
// details: checkStatus.entries.map((e) {
// return CheckDetail(type: e.key, status: e.value);
// }).toList(),
// ),
// );
// widget.model.type = DecorationType.DONE;
// Get.off(DecorationSuccessPage());
// },
// title: '确认提交',
// ),
// );
// }
_buildRow(
CHECK_TYPE type,
) {
return Row(
children: [
Image.asset(
checkAssetMap[type],
height: 40.w,
width: 40.w,
),
Text(
checkTypeMap[type],
style: TextStyle(
fontSize: 28.w,
color: AppStyle.primaryTextColor,
),
),
Spacer(),
DecorationCheckBox(
initValue: checkStatus[type],
onChange: (state) {
checkStatus[type] = state;
setState(() {});
},
),
Spacer(),
],
);
}
}
// _buildRow(
// CHECK_TYPE type,
// ) {
// return Row(
// children: [
// Image.asset(
// checkAssetMap[type],
// height: 40.w,
// width: 40.w,
// ),
// Text(
// checkTypeMap[type],
// style: TextStyle(
// fontSize: 28.w,
// color: AppStyle.primaryTextColor,
// ),
// ),
// Spacer(),
// DecorationCheckBox(
// initValue: checkStatus[type],
// onChange: (state) {
// checkStatus[type] = state;
// setState(() {});
// },
// ),
// Spacer(),
// ],
// );
// }
// }

@ -1,140 +1,140 @@
// Flutter imports:
import 'package:aku_community_manager/ui/widgets/common/aku_material_button.dart';
import 'package:flutter/material.dart';
// // Flutter imports:
// import 'package:aku_community_manager/ui/widgets/common/aku_material_button.dart';
// import 'package:flutter/material.dart';
// Package imports:
import 'package:common_utils/common_utils.dart';
import 'package:get/get.dart';
// // Package imports:
// import 'package:common_utils/common_utils.dart';
// import 'package:get/get.dart';
// Project imports:
import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/models/manager/decoration/decoration_list_model.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_util.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_chip_box.dart';
// // Project imports:
// import 'package:aku_community_manager/const/resource.dart';
// import 'package:aku_community_manager/models/manager/decoration/decoration_list_model.dart';
// import 'package:aku_community_manager/style/app_style.dart';
// import 'package:aku_community_manager/tools/screen_tool.dart';
// import 'package:aku_community_manager/tools/widget_tool.dart';
// import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart';
// import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_util.dart';
// import 'package:aku_community_manager/ui/widgets/inner/aku_chip_box.dart';
class DecorationManagerCard extends StatefulWidget {
final DecorationListModel model;
DecorationManagerCard({Key key, @required this.model}) : super(key: key);
// class DecorationManagerCard extends StatefulWidget {
// final DecorationListModel model;
// DecorationManagerCard({Key key, @required this.model}) : super(key: key);
@override
_DecorationManagerCardState createState() => _DecorationManagerCardState();
}
// @override
// _DecorationManagerCardState createState() => _DecorationManagerCardState();
// }
class _DecorationManagerCardState extends State<DecorationManagerCard> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(top: 16.w),
padding: EdgeInsets.all(24.w),
child: Column(
children: [
Row(
children: [
AkuChipBox(title: '装修管理'),
AkuBox.w(16),
Text(
DateUtil.formatDateStr(widget.model.applicationDate,
format: 'yyyy-MM-dd HH:mm:ss'),
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 22.w,
),
),
Spacer(),
Text(
DecorationUIUtil(context).getTagName(
widget.model.operationStatus, widget.model.status,
tracker: widget.model.tracker),
style: TextStyle(
color: DecorationUIUtil(context)
.getTagColor(widget.model.operationStatus),
fontSize: 24.w,
),
),
],
),
AkuBox.h(24),
_buildTile(R.ASSETS_MANAGE_HOME_PNG, '小区名称', kEstateName),
AkuBox.h(12),
_buildTile(
R.ASSETS_MANAGE_ADDRESS_PNG,
'详细地址',
widget.model.roomName,
),
AkuBox.h(12),
_buildTile(
R.ASSETS_MANAGE_DECORATION_PNG,
'装修公司',
widget.model.constructionUnit,
),
AkuBox.h(12),
_buildTile(
R.ASSETS_MANAGE_STATUS_PNG,
'装修状态',
DecorationUIUtil(context).getDecorationStatus(widget.model.status),
),
Divider(
height: 48.w,
),
Align(
alignment: Alignment.centerRight,
child: AkuMaterialButton(
onPressed: () {
Get.to(
DecorationManagerDetailPage(id: widget.model.id,status: widget.model.status,operationStatus: widget.model.operationStatus,));
},
height: 64.w,
minWidth: 160.w,
color: AppStyle.primaryColor,
child: Text(
'查看详情',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold,
fontSize: 28.w,
),
),
radius: 4.w,
),
),
],
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8.w),
),
);
}
// class _DecorationManagerCardState extends State<DecorationManagerCard> {
// @override
// Widget build(BuildContext context) {
// return Container(
// margin: EdgeInsets.only(top: 16.w),
// padding: EdgeInsets.all(24.w),
// child: Column(
// children: [
// Row(
// children: [
// AkuChipBox(title: '装修管理'),
// AkuBox.w(16),
// Text(
// DateUtil.formatDateStr(widget.model.applicationDate,
// format: 'yyyy-MM-dd HH:mm:ss'),
// style: TextStyle(
// color: AppStyle.minorTextColor,
// fontSize: 22.w,
// ),
// ),
// Spacer(),
// Text(
// DecorationUIUtil(context).getTagName(
// widget.model.operationStatus, widget.model.status,
// tracker: widget.model.tracker),
// style: TextStyle(
// color: DecorationUIUtil(context)
// .getTagColor(widget.model.operationStatus),
// fontSize: 24.w,
// ),
// ),
// ],
// ),
// AkuBox.h(24),
// _buildTile(R.ASSETS_MANAGE_HOME_PNG, '小区名称', kEstateName),
// AkuBox.h(12),
// _buildTile(
// R.ASSETS_MANAGE_ADDRESS_PNG,
// '详细地址',
// widget.model.roomName,
// ),
// AkuBox.h(12),
// _buildTile(
// R.ASSETS_MANAGE_DECORATION_PNG,
// '装修公司',
// widget.model.constructionUnit,
// ),
// AkuBox.h(12),
// _buildTile(
// R.ASSETS_MANAGE_STATUS_PNG,
// '装修状态',
// DecorationUIUtil(context).getDecorationStatus(widget.model.status),
// ),
// Divider(
// height: 48.w,
// ),
// Align(
// alignment: Alignment.centerRight,
// child: AkuMaterialButton(
// onPressed: () {
// Get.to(
// DecorationManagerDetailPage(id: widget.model.id,status: widget.model.status,operationStatus: widget.model.operationStatus,));
// },
// height: 64.w,
// minWidth: 160.w,
// color: AppStyle.primaryColor,
// child: Text(
// '查看详情',
// style: TextStyle(
// color: AppStyle.primaryTextColor,
// fontWeight: FontWeight.bold,
// fontSize: 28.w,
// ),
// ),
// radius: 4.w,
// ),
// ),
// ],
// ),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(8.w),
// ),
// );
// }
_buildTile(String path, String title, String subTitle) {
return Row(
children: [
Image.asset(
path,
height: 40.w,
width: 40.w,
),
Text(
title,
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 28.sp,
),
),
Spacer(),
Text(
subTitle,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.sp,
fontWeight: FontWeight.bold,
),
),
],
);
}
}
// _buildTile(String path, String title, String subTitle) {
// return Row(
// children: [
// Image.asset(
// path,
// height: 40.w,
// width: 40.w,
// ),
// Text(
// title,
// style: TextStyle(
// color: AppStyle.minorTextColor,
// fontSize: 28.sp,
// ),
// ),
// Spacer(),
// Text(
// subTitle,
// style: TextStyle(
// color: AppStyle.primaryTextColor,
// fontSize: 28.sp,
// fontWeight: FontWeight.bold,
// ),
// ),
// ],
// );
// }
// }

@ -1,128 +1,128 @@
// Flutter imports:
import 'package:flutter/material.dart';
// // Flutter imports:
// import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:provider/provider.dart';
// // Package imports:
// import 'package:flutter_easyrefresh/easy_refresh.dart';
// import 'package:provider/provider.dart';
// Project imports:
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/models/manager/decoration/decoration_list_model.dart';
import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_manager_card.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_tab_bar.dart';
// // Project imports:
// import 'package:aku_community_manager/const/api.dart';
// import 'package:aku_community_manager/models/manager/decoration/decoration_list_model.dart';
// import 'package:aku_community_manager/provider/user_provider.dart';
// import 'package:aku_community_manager/tools/screen_tool.dart';
// import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_manager_card.dart';
// import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
// import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart';
// import 'package:aku_community_manager/ui/widgets/inner/aku_tab_bar.dart';
class DecorationManagerPage extends StatefulWidget {
DecorationManagerPage({Key key}) : super(key: key);
// class DecorationManagerPage extends StatefulWidget {
// DecorationManagerPage({Key key}) : super(key: key);
@override
_DecorationManagerPageState createState() => _DecorationManagerPageState();
}
// @override
// _DecorationManagerPageState createState() => _DecorationManagerPageState();
// }
class _DecorationManagerPageState extends State<DecorationManagerPage>
with TickerProviderStateMixin {
TabController _tabController;
EasyRefreshController _refreshController;
// class _DecorationManagerPageState extends State<DecorationManagerPage>
// with TickerProviderStateMixin {
// TabController _tabController;
// EasyRefreshController _refreshController;
List<String> get tabs {
final userProvider = Provider.of<UserProvider>(context, listen: false);
if (userProvider?.infoModel?.canSendTicket != null &&
userProvider.infoModel.canSendTicket) {
return ['待指派', '已指派', '已执行', '全部'];
} else {
return ['待执行', '已执行', '全部'];
}
}
// List<String> get tabs {
// final userProvider = Provider.of<UserProvider>(context, listen: false);
// if (userProvider?.infoModel?.canSendTicket != null &&
// userProvider.infoModel.canSendTicket) {
// return ['待指派', '已指派', '已执行', '全部'];
// } else {
// return ['待执行', '已执行', '全部'];
// }
// }
@override
void initState() {
super.initState();
// @override
// void initState() {
// super.initState();
_tabController = TabController(length: tabs.length, vsync: this);
_refreshController = EasyRefreshController();
}
// _tabController = TabController(length: tabs.length, vsync: this);
// _refreshController = EasyRefreshController();
// }
@override
void dispose() {
_refreshController?.dispose();
super.dispose();
}
// @override
// void dispose() {
// _refreshController?.dispose();
// super.dispose();
// }
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '装修管理',
appBarBottom: PreferredSize(
child: AkuTabBar(
controller: _tabController,
tabs: tabs,
),
preferredSize: Size.fromHeight(96.w),
),
body: TabBarView(
controller: _tabController,
children: _getViews(),
),
);
}
// @override
// Widget build(BuildContext context) {
// return AkuScaffold(
// title: '装修管理',
// appBarBottom: PreferredSize(
// child: AkuTabBar(
// controller: _tabController,
// tabs: tabs,
// ),
// preferredSize: Size.fromHeight(96.w),
// ),
// body: TabBarView(
// controller: _tabController,
// children: _getViews(),
// ),
// );
// }
List<Widget> _getViews() {
final userProvider = Provider.of<UserProvider>(context);
if (userProvider?.infoModel?.canSendTicket != null &&
userProvider.infoModel.canSendTicket) {
return [...List.generate(4, (index) => _getSingleListView(index))];
} else {
return [...List.generate(3, (index) => _getSingleListView(index))];
}
// switch (role) {
// case USER_ROLE.MANAGER:
// return [
// _getSingleListView(
// DecorationData.getModels(DecorationType.WAIT_HAND_OUT)),
// _getSingleListView(DecorationData.getModels(DecorationType.HAND_OUT)),
// _getSingleListView(DecorationData.getModels(DecorationType.DONE)),
// _getSingleListView(DecorationData.allModels),
// ];
// break;
// case USER_ROLE.PROPERTY:
// return [
// _getSingleListView(DecorationData.getModels(DecorationType.HAND_OUT)),
// _getSingleListView(DecorationData.getModels(DecorationType.DONE)),
// _getSingleListView(DecorationData.allPropertyModels),
// ];
// default:
// return [
// _getSingleListView(
// DecorationData.getTypeModels(DecorationStatusType.PROGRESS)),
// _getSingleListView(
// DecorationData.getTypeModels(DecorationStatusType.DONE)),
// _getSingleListView(DecorationData.allPropertyModels),
// ];
// break;
// }
}
// List<Widget> _getViews() {
// final userProvider = Provider.of<UserProvider>(context);
// if (userProvider?.infoModel?.canSendTicket != null &&
// userProvider.infoModel.canSendTicket) {
// return [...List.generate(4, (index) => _getSingleListView(index))];
// } else {
// return [...List.generate(3, (index) => _getSingleListView(index))];
// }
// // switch (role) {
// // case USER_ROLE.MANAGER:
// // return [
// // _getSingleListView(
// // DecorationData.getModels(DecorationType.WAIT_HAND_OUT)),
// // _getSingleListView(DecorationData.getModels(DecorationType.HAND_OUT)),
// // _getSingleListView(DecorationData.getModels(DecorationType.DONE)),
// // _getSingleListView(DecorationData.allModels),
// // ];
// // break;
// // case USER_ROLE.PROPERTY:
// // return [
// // _getSingleListView(DecorationData.getModels(DecorationType.HAND_OUT)),
// // _getSingleListView(DecorationData.getModels(DecorationType.DONE)),
// // _getSingleListView(DecorationData.allPropertyModels),
// // ];
// // default:
// // return [
// // _getSingleListView(
// // DecorationData.getTypeModels(DecorationStatusType.PROGRESS)),
// // _getSingleListView(
// // DecorationData.getTypeModels(DecorationStatusType.DONE)),
// // _getSingleListView(DecorationData.allPropertyModels),
// // ];
// // break;
// // }
// }
_getSingleListView(int index) {
return BeeListView(
extraParams: {'operationStatus': index},
path: API.manage.decorationList,
controller: _refreshController,
convert: (models) {
return models.tableList
.map((e) => DecorationListModel.fromJson(e))
.toList();
},
builder: (items) {
return ListView.builder(
itemBuilder: (context, index) {
return DecorationManagerCard(model: items[index]);
},
itemCount: items.length,
padding: EdgeInsets.symmetric(horizontal: 32.w),
);
});
}
}
// _getSingleListView(int index) {
// return BeeListView(
// extraParams: {'operationStatus': index},
// path: API.manage.decorationList,
// controller: _refreshController,
// convert: (models) {
// return models.tableList
// .map((e) => DecorationListModel.fromJson(e))
// .toList();
// },
// builder: (items) {
// return ListView.builder(
// itemBuilder: (context, index) {
// return DecorationManagerCard(model: items[index]);
// },
// itemCount: items.length,
// padding: EdgeInsets.symmetric(horizontal: 32.w),
// );
// });
// }
// }

@ -32,6 +32,7 @@ class _NewRenovationState extends State<NewRenovationView>
@override
Widget build(BuildContext context) {
super.build(context);
return BeeListView(
path: API.manage.newRenovationList,
controller: _refreshController,

@ -150,7 +150,6 @@ class NetUtil {
}
_parseErr(DioError err) {
final userProvider = Provider.of<UserProvider>(Get.context, listen: false);
LoggerData.addData(err);
_makeToast(String message) {
BotToast.showText(text: '$message\_${err?.response?.statusCode ?? ''}');

Loading…
Cancel
Save