parent
27fd4e306c
commit
5fa0586230
@ -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,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();
|
||||
}
|
@ -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,
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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),
|
||||
// );
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
Loading…
Reference in new issue