装修添加底部按钮

hmxc
小赖 4 years ago
parent 67c7d51447
commit 96a5588bc0

@ -112,7 +112,13 @@ class CycleCheck {
///check cycle in days ///check cycle in days
int checkCycle; int checkCycle;
List<CHECK_TYPE> checkDetails; List<CHECK_TYPE> checkDetails = [
CHECK_TYPE.ELECTRIC,
CHECK_TYPE.WATER,
CHECK_TYPE.WALL,
CHECK_TYPE.DOOR_AND_WINDOWS,
CHECK_TYPE.SECURITY,
];
CycleCheck({ CycleCheck({
this.authPerson, this.authPerson,
this.startDate, this.startDate,

@ -1,4 +1,6 @@
import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart';
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/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart'; import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_check_row.dart'; import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_check_row.dart';
@ -7,6 +9,7 @@ import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_util.dart'; import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_util.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_bottom_button.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_title_box.dart'; import 'package:aku_community_manager/ui/widgets/inner/aku_title_box.dart';
import 'package:aku_community_manager/tools/screen_tool.dart'; import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:aku_community_manager/const/resource.dart'; import 'package:aku_community_manager/const/resource.dart';
@ -17,6 +20,7 @@ import 'package:expandable/expandable.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:provider/provider.dart';
class DecorationManagerDetailPage extends StatefulWidget { class DecorationManagerDetailPage extends StatefulWidget {
final DecorationModel model; final DecorationModel model;
@ -31,6 +35,8 @@ class DecorationManagerDetailPage extends StatefulWidget {
class _DecorationManagerDetailStatePage class _DecorationManagerDetailStatePage
extends State<DecorationManagerDetailPage> { extends State<DecorationManagerDetailPage> {
bool get isWaitHandOut => widget.model.type == DecorationType.WAIT_HAND_OUT; bool get isWaitHandOut => widget.model.type == DecorationType.WAIT_HAND_OUT;
USER_ROLE get role =>
Provider.of<UserProvider>(context, listen: false).userInfoModel.role;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AkuScaffold( return AkuScaffold(
@ -43,11 +49,40 @@ class _DecorationManagerDetailStatePage
? SizedBox() ? SizedBox()
: _buildFinishWorkCheck(), : _buildFinishWorkCheck(),
_buildCycleCheck(), _buildCycleCheck(),
widget.model.type == DecorationType.WAIT_HAND_OUT widget.model.type == DecorationType.WAIT_HAND_OUT ||
widget.model.type == DecorationType.HAND_OUT
? SizedBox() ? SizedBox()
: _buildCheckDetail(), : _buildCheckDetail(),
], ],
), ),
bottom: Builder(builder: (context) {
final CycleCheck cycleCheck = widget.model.cycleCheck;
if (role == USER_ROLE.MANAGER) {
switch (widget.model.type) {
case DecorationType.WAIT_HAND_OUT:
return AkuBottomButton(
title: '立即安排',
onTap: cycleCheck.authPerson != null &&
cycleCheck.checkCycle != null &&
cycleCheck.startDate != null
? () {
widget.model.type = DecorationType.HAND_OUT;
setState(() {});
}
: null,
);
break;
default:
return SizedBox();
break;
}
// else if(widget.model.type)
} else if (role == USER_ROLE.PROPERTY) {
// return
}
// return
}),
); );
} }

@ -0,0 +1,34 @@
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:flutter/material.dart';
class AkuBottomButton extends StatefulWidget {
final VoidCallback onTap;
final String title;
AkuBottomButton({Key key, this.onTap, @required this.title})
: super(key: key);
@override
_AkuBottomButtonState createState() => _AkuBottomButtonState();
}
class _AkuBottomButtonState extends State<AkuBottomButton> {
@override
Widget build(BuildContext context) {
return AkuMaterialButton(
height: 98.w,
color: AppStyle.primaryColor,
nullColor: AppStyle.minorColor,
onPressed: widget.onTap,
child: Text(
widget.title,
style: TextStyle(
fontWeight: FontWeight.bold,
color: widget.onTap == null
? AppStyle.minorTextColor
: AppStyle.primaryTextColor,
),
),
);
}
}
Loading…
Cancel
Save