重构 家政服务模块

hmxc
张萌 3 years ago
parent 7a6e052e75
commit 3dc4fa3783

@ -1,4 +1,5 @@
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/tools/user_tool.dart';
import 'package:aku_community_manager/ui/manage_pages/clock_in_out/clock_in_out_page.dart'; import 'package:aku_community_manager/ui/manage_pages/clock_in_out/clock_in_out_page.dart';
import 'package:aku_community_manager/ui/manage_pages/facilities/facilities_select_page.dart'; import 'package:aku_community_manager/ui/manage_pages/facilities/facilities_select_page.dart';
import 'package:aku_community_manager/ui/manage_pages/house_keeping/house_keeping_page.dart'; import 'package:aku_community_manager/ui/manage_pages/house_keeping/house_keeping_page.dart';
@ -69,6 +70,7 @@ class _ApplicationPageState extends State<ApplicationPage>
AppApplication('一键报警', R.ASSETS_HOME_IC_POLICE_PNG, () => WarningPage()), AppApplication('一键报警', R.ASSETS_HOME_IC_POLICE_PNG, () => WarningPage()),
AppApplication( AppApplication(
'访客管理', R.ASSETS_HOME_IC_VISITORS_PNG, () => VisitorManagerPage()), '访客管理', R.ASSETS_HOME_IC_VISITORS_PNG, () => VisitorManagerPage()),
if (UserTool.userProvider.infoModel!.manager)
AppApplication( AppApplication(
'报事报修', R.ASSETS_HOME_IC_SERVICE_PNG, () => BusinessAndFixPage()), '报事报修', R.ASSETS_HOME_IC_SERVICE_PNG, () => BusinessAndFixPage()),
AppApplication( AppApplication(
@ -91,9 +93,11 @@ class _ApplicationPageState extends State<ApplicationPage>
AppApplication('规程管理', R.ASSETS_HOME_RULES_PNG, () => RulesManagePage()), AppApplication('规程管理', R.ASSETS_HOME_RULES_PNG, () => RulesManagePage()),
AppApplication( AppApplication(
'卫生管理', R.ASSETS_HOME_HYGIENICE_PNG, () => HygienceManagePage()), '卫生管理', R.ASSETS_HOME_HYGIENICE_PNG, () => HygienceManagePage()),
AppApplication('考勤管理', R.ASSETS_HOME_CLOCK_IN_OUT_PNG, () => ClockInOutPage()), AppApplication(
'考勤管理', R.ASSETS_HOME_CLOCK_IN_OUT_PNG, () => ClockInOutPage()),
AppApplication('访谈管理', R.ASSETS_HOME_INTERVIEW_PNG, () => InterviewPage()), AppApplication('访谈管理', R.ASSETS_HOME_INTERVIEW_PNG, () => InterviewPage()),
AppApplication('家政服务', R.ASSETS_HOME_HOUSE_KEEPING_PNG, () => HouseKeepingPage()), AppApplication(
'家政服务', R.ASSETS_HOME_HOUSE_KEEPING_PNG, () => HouseKeepingPage()),
]; ];
@override @override

@ -1,4 +1,5 @@
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/tools/user_tool.dart';
import 'package:aku_community_manager/ui/manage_pages/clock_in_out/clock_in_out_page.dart'; import 'package:aku_community_manager/ui/manage_pages/clock_in_out/clock_in_out_page.dart';
import 'package:aku_community_manager/ui/manage_pages/facilities/facilities_select_page.dart'; import 'package:aku_community_manager/ui/manage_pages/facilities/facilities_select_page.dart';
import 'package:aku_community_manager/ui/manage_pages/house_keeping/house_keeping_page.dart'; import 'package:aku_community_manager/ui/manage_pages/house_keeping/house_keeping_page.dart';
@ -43,17 +44,24 @@ class SearchWorkOrderPage extends StatefulWidget {
class _SearchWorkOrderpageState extends State<SearchWorkOrderPage> { class _SearchWorkOrderpageState extends State<SearchWorkOrderPage> {
TextEditingController? _textController; TextEditingController? _textController;
List<AppApplication> _wisdomApplications = [ List<AppApplication> _wisdomApplications = [
AppApplication('一键报警', R.ASSETS_HOME_IC_POLICE_PNG, ()=>WarningPage()), AppApplication('一键报警', R.ASSETS_HOME_IC_POLICE_PNG, () => WarningPage()),
AppApplication('访客管理', R.ASSETS_HOME_IC_VISITORS_PNG, ()=>VisitorManagerPage()),
AppApplication('报事报修', R.ASSETS_HOME_IC_SERVICE_PNG, ()=>BusinessAndFixPage()),
AppApplication('物品出户', R.ASSETS_HOME_IC_ARTICLE_PNG,()=> ItemsOutdoorPage()),
AppApplication( AppApplication(
'装修管理', R.ASSETS_HOME_IC_DECORATION_PNG, ()=>NewRenovationPage()), '访客管理', R.ASSETS_HOME_IC_VISITORS_PNG, () => VisitorManagerPage()),
if (UserTool.userProvider.infoModel!.manager)
AppApplication( AppApplication(
'活动管理', R.ASSETS_HOME_IC_ACTIVITY_PNG, ()=>ActivityManagerPage()), '报事报修', R.ASSETS_HOME_IC_SERVICE_PNG, () => BusinessAndFixPage()),
AppApplication('借还管理', R.ASSETS_HOME_IC_BORROW_PNG,()=> BorrowManagerPage()), AppApplication(
AppApplication('巡检管理', R.ASSETS_HOME_IC_PATROL_PNG, ()=>InspectionManagePage()), '物品出户', R.ASSETS_HOME_IC_ARTICLE_PNG, () => ItemsOutdoorPage()),
AppApplication('绿化管理', R.ASSETS_HOME_IC_GREENING_PNG,()=> GreenManagePage()), AppApplication(
'装修管理', R.ASSETS_HOME_IC_DECORATION_PNG, () => NewRenovationPage()),
AppApplication(
'活动管理', R.ASSETS_HOME_IC_ACTIVITY_PNG, () => ActivityManagerPage()),
AppApplication(
'借还管理', R.ASSETS_HOME_IC_BORROW_PNG, () => BorrowManagerPage()),
AppApplication(
'巡检管理', R.ASSETS_HOME_IC_PATROL_PNG, () => InspectionManagePage()),
AppApplication(
'绿化管理', R.ASSETS_HOME_IC_GREENING_PNG, () => GreenManagePage()),
AppApplication( AppApplication(
'设施检查', R.ASSETS_HOME_IC_FACILITIES_PNG, () => FacilitiesSelectPage()), '设施检查', R.ASSETS_HOME_IC_FACILITIES_PNG, () => FacilitiesSelectPage()),
AppApplication( AppApplication(

@ -1,95 +1,350 @@
import 'package:aku_community_manager/models/manager/house_keeping/house_keeping_list_model.dart'; import 'package:aku_community_manager/const/api.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/aku_divider.dart'; import 'package:aku_community_manager/tools/user_tool.dart';
import 'package:aku_community_manager/ui/manage_pages/house_keeping/house_keeping_detail_page.dart'; import 'package:aku_community_manager/ui/manage_pages/house_keeping/house_keeping_detail_page.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_material_button.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_chip_box.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community_manager/tools/extensions/list_extension_tool.dart';
class HouseKeepingCard extends StatefulWidget { // class HouseKeepingCard extends StatefulWidget {
final HouseKeepingListModel model; // final HouseKeepingListModel model;
HouseKeepingCard({Key? key, required this.model}) : super(key: key); // HouseKeepingCard({Key? key, required this.model}) : super(key: key);
@override // @override
_HouseKeepingCardState createState() => _HouseKeepingCardState(); // _HouseKeepingCardState createState() => _HouseKeepingCardState();
} // }
// class _HouseKeepingCardState extends State<HouseKeepingCard> {
// @override
// Widget build(BuildContext context) {
// return MaterialButton(
// minWidth: double.infinity,
// color: Colors.white,
// shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.w)),
// elevation: 0,
// padding: EdgeInsets.all(24.w),
// onPressed: () {
// Get.to(() => HouseKeepingDetailPage(model:widget.model));
// },
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Row(
// children: [
// '家政服务'.text.size(32.sp).color(kTextPrimaryColor).bold.make(),
// Spacer(),
// ],
// ),
// 16.w.heightBox,
// AkuDivider.horizontal(),
// 24.w.heightBox,
// ...<Widget>[
// _rowTile(
// R.ASSETS_MANAGE_IC_RENWU_PNG,
// '房产名称',
// widget.model.roomName!.text
// .size(24.sp)
// .color(kTextSubColor)
// .make()),
// _rowTile(
// R.ASSETS_MANAGE_IC_RENWU_PNG,
// '人数',
// widget.model.num
// .toString()
// .text
// .size(24.sp)
// .color(kTextSubColor)
// .make()),
// _rowTile(
// R.ASSETS_MANAGE_IC_RENWU_PNG,
// '负责人姓名',
// widget.model.leaderName!.text
// .size(24.sp)
// .color(kTextSubColor)
// .make()),
// _rowTile(
// R.ASSETS_MESSAGE_IC_PHONE_PNG,
// '负责人手机',
// widget.model.leaderTel!.text
// .size(24.sp)
// .color(kTextSubColor)
// .make()),
// ].sepWidget(separate: 12.w.heightBox),
// ],
// ),
// );
// }
// Widget _rowTile(String iconPath, String title, Widget content) {
// return Row(
// children: [
// SizedBox(
// width: 40.w,
// height: 40.w,
// child: Image.asset(iconPath),
// ),
// 12.w.widthBox,
// title.text.size(24.sp).color(kTextSubColor).make(),
// Spacer(),
// content,
// ],
// );
// }
// }
class HouseKeepingCard extends StatelessWidget {
final VoidCallback callRefresh;
const HouseKeepingCard({Key? key, required this.callRefresh})
: super(key: key);
class _HouseKeepingCardState extends State<HouseKeepingCard> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialButton( return GestureDetector(
minWidth: double.infinity, onTap: () async {
color: Colors.white, await Get.to(() => HouseKeepingDetailPage());
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.w)), callRefresh();
elevation: 0,
padding: EdgeInsets.all(24.w),
onPressed: () {
Get.to(() => HouseKeepingDetailPage(model:widget.model));
}, },
child: Container(
padding: EdgeInsets.all(24.w),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [ children: [
Row( Row(
children: [ children: [
'家政服务'.text.size(32.sp).color(kTextPrimaryColor).bold.make(), AkuChipBox(title: '家政服务'),
Spacer(), 16.w.widthBox,
Expanded(
child: Text(
'dateStart',
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 22.sp,
),
),
),
Text(
// widget.hasFinished
// ? '已处理'
// : AkuMap.fixStatus(userInfoModel!.canSendTicket,
// userInfoModel!.canPickUpTicket, widget.model.status!),
'',
style:
// widget.hasFinished
true
? TextStyle(color: AppStyle.minorTextColor)
: TextStyle(
// color: widget.model.status! < 4
// ? Color(0XFFFF4501)
// : AppStyle.minorTextColor,
),
),
], ],
), ),
16.w.heightBox,
AkuDivider.horizontal(),
24.w.heightBox, 24.w.heightBox,
...<Widget>[ Text(
_rowTile( // widget.model.reportDetail!
R.ASSETS_MANAGE_IC_RENWU_PNG, '',
'房产名称', // maxLines: widget.homeDisplay ? 1 : null,
widget.model.roomName!.text // overflow: !widget.homeDisplay
.size(24.sp) // ? TextOverflow.visible
.color(kTextSubColor) // : TextOverflow.ellipsis,
.make()), style: TextStyle(
_rowTile( color: AppStyle.primaryTextColor,
R.ASSETS_MANAGE_IC_RENWU_PNG, fontSize: 28.sp,
'人数', fontWeight: FontWeight.bold,
widget.model.num ),
.toString() ),
.text 16.w.heightBox,
.size(24.sp) _buildImgs(),
.color(kTextSubColor) // !widget.canSeeBottomButton ? SizedBox() : _getBottomCard(),
.make()), _getBottomCard()
_rowTile(
R.ASSETS_MANAGE_IC_RENWU_PNG,
'负责人姓名',
widget.model.leaderName!.text
.size(24.sp)
.color(kTextSubColor)
.make()),
_rowTile(
R.ASSETS_MESSAGE_IC_PHONE_PNG,
'负责人手机',
widget.model.leaderTel!.text
.size(24.sp)
.color(kTextSubColor)
.make()),
].sepWidget(separate: 12.w.heightBox),
], ],
), ),
// margin:
// widget.homeDisplay ? EdgeInsets.zero : EdgeInsets.only(top: 16.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8.w),
),
),
); );
} }
Widget _rowTile(String iconPath, String title, Widget content) { _buildImgs() {
return Row( return Container(
height: 168.w,
child: ListView.builder(
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) {
// var imgObj = widget.model.imgUrls![index].url;
var imgObj = '';
return Container(
margin: EdgeInsets.symmetric(horizontal: 8.w),
height: 168.w,
width: 168.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.w),
),
clipBehavior: Clip.antiAlias,
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_WEBP, image: API.image('')),
);
},
// itemCount: widget.model.imgUrls!.length,
itemCount: 1,
),
);
}
_getBottomCard() {
return Column(
children: [ children: [
SizedBox( Divider(height: 48.w),
width: 40.w, Align(
height: 40.w, alignment: Alignment.centerRight,
child: Image.asset(iconPath), child: Row(
), mainAxisAlignment: MainAxisAlignment.end,
12.w.widthBox, children: _getButtons())),
title.text.size(24.sp).color(kTextSubColor).make(),
Spacer(),
content,
], ],
); );
} }
_getButtons() {
switch (1) {
case 1:
return [
AkuMaterialButton(
height: 64.w,
onPressed: () async {
// Get.to(() => BusinessAndFixDetailPage(model: widget.model));
// if (widget.callRefresh != null) {
// widget.callRefresh!();
// }
},
radius: 4,
color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text(
(UserTool.userProvider.infoModel!.canSendTicket
? '立即派单'
: '查看详情'),
style: TextStyle(
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold,
fontSize: 28.sp,
height: 40 / 28,
),
),
),
];
case 2:
return [
AkuMaterialButton(
height: 64.w,
onPressed: () async {
// Get.to(() => BusinessAndFixDetailPage(model: widget.model));
// if (widget.callRefresh != null) {
// widget.callRefresh!();
// }
},
radius: 4,
color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text(
(UserTool.userProvider.infoModel!.canSendTicket
? '改派'
: UserTool.userProvider.infoModel!.canPickUpTicket
? '立即接单'
: '查看详情'),
style: TextStyle(
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold,
fontSize: 28.sp,
height: 40 / 28,
),
),
),
];
case 3:
return [
UserTool.userProvider.infoModel!.canPickUpTicket
? AkuMaterialButton(
height: 64.w,
onPressed: () async {
// Get.to(() => Get.to(() =>
// FixMoreTimePage(dispatchId: widget.model.dispatchId!)));
// if (widget.callRefresh != null) {
// widget.callRefresh!();
// }
},
radius: 4,
color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text(
('申请延时'),
style: TextStyle(
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold,
fontSize: 28.sp,
height: 40 / 28,
),
),
)
: SizedBox(),
AkuMaterialButton(
height: 64.w,
onPressed: () async {
// Get.to(() => BusinessAndFixDetailPage(model: widget.model));
// if (widget.callRefresh != null) {
// widget.callRefresh!();
// }
},
radius: 4,
color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text(
(UserTool.userProvider.infoModel!.canPickUpTicket
? '处理完成'
: '查看详情'),
style: TextStyle(
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold,
fontSize: 28.sp,
height: 40 / 28,
),
),
),
];
case 4:
return [
AkuMaterialButton(
height: 64.w,
onPressed: () async {
// Get.to(() => BusinessAndFixDetailPage(model: widget.model));
// if (widget.callRefresh != null) {
// widget.callRefresh!();
// }
},
radius: 4,
color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text(
('查看详情'),
style: TextStyle(
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold,
fontSize: 28.sp,
height: 40 / 28,
),
),
),
];
default:
return [];
}
}
} }

@ -0,0 +1,167 @@
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_material_button.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:expandable/expandable.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community_manager/utils/extension/list_extension.dart';
class HouseKeepingDepartmentPage extends StatefulWidget {
HouseKeepingDepartmentPage({Key? key}) : super(key: key);
@override
_HouseKeepingDepartmentPageState createState() =>
_HouseKeepingDepartmentPageState();
}
class _HouseKeepingDepartmentPageState
extends State<HouseKeepingDepartmentPage> {
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '派单人员列表',
body: EasyRefresh(
firstRefresh: true,
header: MaterialHeader(),
onRefresh: () async {},
child: ListView(
children: [
_buildItem(1),
],
)),
);
}
_buildItem(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.name!',
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,
),
...[].map((e) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
AkuMaterialButton(
height: 96.w,
onPressed: () {
// if (_pickedFixers
// .indexWhere((element) => element.id == e.id) ==
// -1) {
// _pickedFixers.add(e);
// } else {
// _pickedFixers.remove(e);
// }
// _reportModel!.operato = e.id;
setState(() {});
},
child: Row(
children: [
72.w.widthBox,
Checkbox(
checkColor: AppStyle.primaryTextColor,
activeColor: AppStyle.primaryColor,
value: false,
onChanged: (state) {
// if (_pickedFixers.indexOf(e) == -1) {
// _pickedFixers.add(e);
// } else {
// _pickedFixers.remove(e);
// }
// if (_reportModel!.operato == e.id) {
// _reportModel!.operato = -1;
// } else {
// _reportModel!.operato = e.id;
// }
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.tel!,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.w,
fontWeight: FontWeight.bold,
),
),
100.w.widthBox,
],
),
),
].sepWidget(
separate: 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,15 +1,151 @@
import 'package:aku_community_manager/models/manager/house_keeping/house_keeping_list_model.dart'; import 'package:aku_community_manager/const/api.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/aku_divider.dart'; import 'package:aku_community_manager/tools/aku_divider.dart';
import 'package:aku_community_manager/ui/manage_pages/house_keeping/house_keeping_feed_back_page.dart';
import 'package:aku_community_manager/ui/widgets/app_widgets/bee_grid_image_view.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:common_utils/common_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community_manager/tools/extensions/list_extension_tool.dart'; import 'package:aku_community_manager/utils/extension/list_extension.dart';
// class HouseKeepingDetailPage extends StatefulWidget {
// final HouseKeepingListModel model;
// HouseKeepingDetailPage({Key? key, required this.model}) : super(key: key);
// @override
// _HouseKeepingDetailPageState createState() => _HouseKeepingDetailPageState();
// }
// class _HouseKeepingDetailPageState extends State<HouseKeepingDetailPage> {
// @override
// Widget build(BuildContext context) {
// return AkuScaffold(
// title: '服务详情',
// body: ListView(
// padding: EdgeInsets.all(32.w),
// children: [
// _interviewInfo(),
// 20.w.heightBox,
// _contentWidget(),
// ],
// ),
// );
// }
// Widget _interviewInfo() {
// return Container(
// width: double.infinity,
// decoration: BoxDecoration(
// color: Colors.white, borderRadius: BorderRadius.circular(8.w)),
// padding: EdgeInsets.all(24.w),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Row(
// children: [
// '家政服务'.text.size(32.sp).color(kTextPrimaryColor).bold.make(),
// Spacer(),
// ],
// ),
// 16.w.heightBox,
// AkuDivider.horizontal(),
// 24.w.heightBox,
// ...<Widget>[
// _rowTile(
// R.ASSETS_MANAGE_IC_RENWU_PNG,
// '房产名称',
// widget.model.roomName!.text
// .size(24.sp)
// .color(kTextSubColor)
// .make()),
// _rowTile(
// R.ASSETS_MANAGE_IC_RENWU_PNG,
// '人数',
// widget.model.num
// .toString()
// .text
// .size(24.sp)
// .color(kTextSubColor)
// .make()),
// _rowTile(
// R.ASSETS_MANAGE_IC_RENWU_PNG,
// '负责人姓名',
// widget.model.leaderName!.text
// .size(24.sp)
// .color(kTextSubColor)
// .make()),
// _rowTile(
// R.ASSETS_MESSAGE_IC_PHONE_PNG,
// '负责人手机',
// widget.model.leaderTel!.text
// .size(24.sp)
// .color(kTextSubColor)
// .make()),
// ].sepWidget(separate: 12.w.heightBox),
// // _getBottomButtons(widget.model.status),
// ],
// ),
// );
// }
// Widget _contentWidget() {
// return Container(
// width: double.infinity,
// decoration: BoxDecoration(
// color: Colors.white, borderRadius: BorderRadius.circular(8.w)),
// padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Row(
// children: [
// '访谈内容'.text.size(32.sp).color(kTextPrimaryColor).bold.make(),
// Spacer(),
// ],
// ),
// 16.w.heightBox,
// AkuDivider.horizontal(),
// 20.w.heightBox,
// widget.model.content!.text.size(28.sp).color(kTextPrimaryColor).make(),
// 40.w.heightBox,
// Row(
// children: [
// Spacer(),
// widget.model.createDate!.text
// .size(24.sp)
// .color(kTextSubColor)
// .make(),
// ],
// ),
// ],
// ),
// );
// }
// Widget _rowTile(String iconPath, String title, Widget content) {
// return Row(
// children: [
// SizedBox(
// width: 40.w,
// height: 40.w,
// child: Image.asset(iconPath),
// ),
// 12.w.widthBox,
// title.text.size(24.sp).color(kTextSubColor).make(),
// Spacer(),
// content,
// ],
// );
// }
// }
class HouseKeepingDetailPage extends StatefulWidget { class HouseKeepingDetailPage extends StatefulWidget {
final HouseKeepingListModel model; HouseKeepingDetailPage({Key? key}) : super(key: key);
HouseKeepingDetailPage({Key? key, required this.model}) : super(key: key);
@override @override
_HouseKeepingDetailPageState createState() => _HouseKeepingDetailPageState(); _HouseKeepingDetailPageState createState() => _HouseKeepingDetailPageState();
@ -18,121 +154,258 @@ class HouseKeepingDetailPage extends StatefulWidget {
class _HouseKeepingDetailPageState extends State<HouseKeepingDetailPage> { class _HouseKeepingDetailPageState extends State<HouseKeepingDetailPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var payfeePrice = Container(
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.w),
color: Colors.white,
child: Row(
children: [
'服务费用'.text.size(28.sp).black.make(),
Spacer(),
'¥ ${0}'.text.size(32.sp).color(Colors.red).make()
],
),
);
return AkuScaffold( return AkuScaffold(
title: '服务详情', title: '服务详情',
body: ListView( body: ListView(
padding: EdgeInsets.all(32.w), children: <Widget>[
children: [ _buildInfo(),
_interviewInfo(), _buildProcess(),
20.w.heightBox, _serviceFeedBack(),
_contentWidget(), payfeePrice,
], _buildEvaluate(),
].sepWidget(separate: 16.w.heightBox),
), ),
bottom: _getBottomButtons(1),
);
}
Widget _getBottomButtons(int status) {
switch (status) {
case 1:
return AkuBottomButton(
title: '立即提交',
onTap: () {
Get.to(() => HouseKeepingFeedBackPage());
},
);
case 2:
return AkuBottomButton(
title: '',
onTap: () {},
); );
default:
return SizedBox();
}
} }
Widget _interviewInfo() { Widget _serviceFeedBack() {
return Container( return Container(
width: double.infinity, width: double.infinity,
decoration: BoxDecoration( color: Colors.white,
color: Colors.white, borderRadius: BorderRadius.circular(8.w)), padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 24.w),
padding: EdgeInsets.all(24.w),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
'服务反馈'.text.size(36.sp).bold.black.make(),
40.w.heightBox,
Row(
children: [
'完成情况'.text.size(28.sp).color(kTextSubColor).make(),
Spacer(),
'widget.model.completionString'.text.size(32.sp).black.make()
],
),
40.w.heightBox,
Row(
children: [
Image.asset(
R.ASSETS_PLACEHOLDER_WEBP,
width: 40.w,
height: 40.w,
),
8.w.widthBox,
'维修人'.text.size(28.sp).color(kTextSubColor).make(),
Spacer(),
'widget.model.proposerName'.text.size(28.sp).black.make(),
],
),
16.w.heightBox,
Row( Row(
children: [ children: [
'家政服务'.text.size(32.sp).color(kTextPrimaryColor).bold.make(), Image.asset(
R.ASSETS_PLACEHOLDER_WEBP,
width: 40.w,
height: 40.w,
),
8.w.widthBox,
'联系电话'.text.size(28.sp).color(kTextSubColor).make(),
Spacer(), Spacer(),
'widget.model.proposerTel'.text.size(28.sp).black.make(),
], ],
), ),
16.w.heightBox, 16.w.heightBox,
AkuDivider.horizontal(), 40.w.heightBox,
'处理描述'.text.size(28.sp).color(kTextSubColor).make(),
24.w.heightBox, 24.w.heightBox,
...<Widget>[ ('widget.model.processDescription')
_rowTile(
R.ASSETS_MANAGE_IC_RENWU_PNG,
'房产名称',
widget.model.roomName!.text
.size(24.sp)
.color(kTextSubColor)
.make()),
_rowTile(
R.ASSETS_MANAGE_IC_RENWU_PNG,
'人数',
widget.model.num
.toString()
.text .text
.size(24.sp) .size(2)
.color(kTextSubColor) .black
.make()), .softWrap(true)
_rowTile( .make(),
R.ASSETS_MANAGE_IC_RENWU_PNG, BeeGridImageView(urls: [])
'负责人姓名',
widget.model.leaderName!.text
.size(24.sp)
.color(kTextSubColor)
.make()),
_rowTile(
R.ASSETS_MESSAGE_IC_PHONE_PNG,
'负责人手机',
widget.model.leaderTel!.text
.size(24.sp)
.color(kTextSubColor)
.make()),
].sepWidget(separate: 12.w.heightBox),
// _getBottomButtons(widget.model.status),
], ],
), ),
); );
} }
Widget _contentWidget() { Widget _buildEvaluate() {
return Container( return Container(
width: double.infinity, width: double.infinity,
decoration: BoxDecoration( padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 24.w),
color: Colors.white, borderRadius: BorderRadius.circular(8.w)), color: Colors.white,
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
'服务评价'.text.size(36.sp).bold.black.make(),
40.w.heightBox,
Row( Row(
children: [ children: [
'访谈内容'.text.size(32.sp).color(kTextPrimaryColor).bold.make(), '综合评价'.text.size(28.sp).color(kTextSubColor).make(),
Spacer(), 40.w.widthBox,
RatingBar(
ignoreGestures: true,
allowHalfRating: true,
itemPadding: EdgeInsets.symmetric(horizontal: 15.w),
itemSize: 32.w,
initialRating: (0).toDouble(),
ratingWidget: RatingWidget(
empty: Icon(
CupertinoIcons.star,
),
full: Icon(
CupertinoIcons.star_fill,
color: kPrimaryColor,
),
half: Icon(
CupertinoIcons.star_lefthalf_fill,
color: kPrimaryColor,
)),
onRatingUpdate: (value) {})
], ],
), ),
16.w.heightBox, 40.w.heightBox,
AkuDivider.horizontal(), AkuDivider.horizontal(),
20.w.heightBox,
widget.model.content!.text.size(28.sp).color(kTextPrimaryColor).make(),
40.w.heightBox, 40.w.heightBox,
Row( ('').text.size(28.sp).black.softWrap(true).make(),
children: [ BeeGridImageView(urls: [])
Spacer(),
widget.model.createDate!.text
.size(24.sp)
.color(kTextSubColor)
.make(),
], ],
), ),
], );
}
_buildInfo() {
return AkuTitleBox(
title: '报修信息',
suffix: ''.text.size(28.sp).black.make(),
children: [
16.w.heightBox,
_buildTile(R.ASSETS_MESSAGE_IC_PEOPLE_PNG, '报修人', ''),
_buildTile(R.ASSETS_MESSAGE_IC_PHONE_PNG, '联系电话', ''),
_buildTile(R.ASSETS_MESSAGE_IC_AREA_PNG, '报修区域', ''),
8.w.heightBox,
Text(
'',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold,
fontSize: 28.w,
),
), ),
GridView(
padding: EdgeInsets.only(top: 16.w),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
crossAxisSpacing: 16.w,
mainAxisSpacing: 16.w,
),
children: [].map((e) {
return ClipRRect(
borderRadius: BorderRadius.circular(4.w),
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_WEBP, image: API.image('')),
);
}).toList(),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
),
],
); );
} }
Widget _rowTile(String iconPath, String title, Widget content) { Widget _buildTile(String asset, String title, String subTitle) {
return Row( return Row(
children: [ children: [
SizedBox( 56.w.heightBox,
width: 40.w, Image.asset(
asset,
height: 40.w, height: 40.w,
child: Image.asset(iconPath), width: 40.w,
),
4.w.widthBox,
Text(
title,
style: TextStyle(
fontSize: 28.sp,
color: AppStyle.minorTextColor,
),
),
Spacer(),
Text(
subTitle,
style: TextStyle(
fontSize: 28.sp,
color: AppStyle.primaryTextColor,
),
),
],
);
}
_buildProcess() {
return AkuTitleBox(
title: '报修进程',
children: [].map((e) {
return _buildProcessTile(
'',
DateUtil.formatDateStr(e.operationDate!,
format: 'yyyy-MM-dd HH:mm:ss'),
);
}).toList(),
);
}
Widget _buildProcessTile(String title, String date) {
return Row(
children: [
56.w.heightBox,
Text(
title,
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 28.w,
),
), ),
12.w.widthBox,
title.text.size(24.sp).color(kTextSubColor).make(),
Spacer(), Spacer(),
content, Text(
date,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.w,
),
),
], ],
); );
} }

@ -0,0 +1,191 @@
import 'dart:io';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/aku_divider.dart';
import 'package:aku_community_manager/ui/widgets/app_widgets/aku_pick_image_widget.dart';
import 'package:aku_community_manager/ui/widgets/app_widgets/aku_single_check_button.dart';
import 'package:aku_community_manager/ui/widgets/app_widgets/bee_grid_image_view.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class HouseKeepingFeedBackPage extends StatefulWidget {
HouseKeepingFeedBackPage({Key? key}) : super(key: key);
@override
_HouseKeepingFeedBackPageState createState() =>
_HouseKeepingFeedBackPageState();
}
class _HouseKeepingFeedBackPageState extends State<HouseKeepingFeedBackPage> {
int _feedBackStatus = 0;
late TextEditingController _editingController;
late TextEditingController _priceController;
List<File> _files = [];
@override
void initState() {
super.initState();
_editingController = TextEditingController();
_priceController = TextEditingController();
}
@override
void dispose() {
_editingController.dispose();
_priceController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '工作汇报',
body: ListView(
padding: EdgeInsets.symmetric(vertical: 16.w),
children: <Widget>[
_buidlInfo(),
16.w.heightBox,
_buildFeedBack(),
16.w.heightBox,
_payTile(),
],
),
);
}
Widget _buidlInfo() {
return Container(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 32.w),
color: Colors.white,
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'服务信息'.text.size(36.sp).black.bold.make(),
40.w.heightBox,
''.text.size(28.sp).black.make(),
16.w.heightBox,
BeeGridImageView(urls: []),
],
),
);
}
Widget _buildFeedBack() {
return Container(
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 24.w),
width: double.infinity,
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'服务反馈'.text.size(36.sp).black.bold.make(),
40.w.heightBox,
'完成情况'.text.size(28.sp).black.make(),
24.w.heightBox,
Row(
children: [
AkuSingleCheckButton(
text: '未完成',
value: 1,
gropValue: _feedBackStatus,
onPressed: () {
_feedBackStatus = 1;
setState(() {});
}),
40.w.widthBox,
AkuSingleCheckButton(
text: '已完成',
value: 2,
gropValue: _feedBackStatus,
onPressed: () {
_feedBackStatus = 2;
setState(() {});
}),
],
),
40.w.heightBox,
'处理描述'.text.size(28.sp).black.make(),
24.w.heightBox,
Container(
padding: EdgeInsets.all(24.w),
width: double.infinity,
decoration: BoxDecoration(
border: Border.all(color: Colors.black, width: 1.w),
borderRadius: BorderRadius.circular(22.w)),
child: TextField(
controller: _editingController,
decoration: InputDecoration(
contentPadding: EdgeInsets.zero,
isDense: true,
border: InputBorder.none,
hintText: '请输入处理描述',
hintStyle: TextStyle(
fontSize: 28.sp,
color: kTextSubColor,
fontWeight: FontWeight.bold,
)),
style: TextStyle(
fontSize: 28.sp,
color: Colors.black,
),
maxLines: 10,
minLines: 5,
),
),
40.w.heightBox,
'上传服务完成照片'.text.size(28.sp).black.make(),
24.w.heightBox,
AkuPickImageWidget(onChanged: (files) {
_files = files;
})
],
),
);
}
Widget _payTile() {
return Container(
width: double.infinity,
padding: EdgeInsets.symmetric(vertical: 32.w, horizontal: 32.w),
color: Colors.white,
child: Column(
children: [
Row(
children: [
'支付费用'.text.size(28.sp).black.make(),
350.w.widthBox,
'¥'.text.size(32.sp).bold.color(Colors.red).make(),
24.w.widthBox,
TextField(
controller: _editingController,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(r'^[0-9][\.\d]*(,\d+)?$'))
],
keyboardType: TextInputType.number,
decoration: InputDecoration(
contentPadding: EdgeInsets.zero,
isDense: true,
border: InputBorder.none,
hintText: '请输入金额',
hintStyle: TextStyle(
fontSize: 32.sp,
color: kTextSubColor,
fontWeight: FontWeight.bold)),
style: TextStyle(
fontSize: 32.sp,
color: Colors.black,
),
).expand(),
],
),
24.w.heightBox,
AkuDivider.horizontal()
],
),
);
}
}

@ -1,6 +1,7 @@
import 'package:aku_community_manager/ui/manage_pages/house_keeping/house_keeping_add_page.dart'; import 'package:aku_community_manager/ui/manage_pages/house_keeping/house_keeping_add_page.dart';
import 'package:aku_community_manager/ui/manage_pages/house_keeping/house_keeping_view.dart'; import 'package:aku_community_manager/ui/manage_pages/house_keeping/house_keeping_view.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_tab_bar.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';
@ -15,7 +16,7 @@ class HouseKeepingPage extends StatefulWidget {
class _HouseKeepingPageState extends State<HouseKeepingPage> class _HouseKeepingPageState extends State<HouseKeepingPage>
with TickerProviderStateMixin { with TickerProviderStateMixin {
List<String> _tabs = ['未处理', '已处理']; List<String> _tabs = ['全部', '待派单', '已派单', '处理中', '待支付', '待评价', '已完成'];
late TabController _tabController; late TabController _tabController;
@override @override
void initState() { void initState() {
@ -33,27 +34,34 @@ class _HouseKeepingPageState extends State<HouseKeepingPage>
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AkuScaffold( return AkuScaffold(
title: '家政服务', title: '家政服务',
// appBarBottom: PreferredSize( appBarBottom: PreferredSize(
// preferredSize: Size.fromHeight(88.w), preferredSize: Size.fromHeight(88.w),
// child: AkuTabBar(controller: _tabController, tabs: _tabs), child: AkuTabBar(controller: _tabController, tabs: _tabs,isScrollable: true,),
// ), ),
// body: TabBarView( body: TabBarView(
// children: List.generate( controller: _tabController,
// _tabs.length, children: List.generate(
// (index) => HouseKeepingView( _tabs.length,
// index:index, (index) => HouseKeepingView(
// ), index: index,
// ), ),
// ), ),
),
actions: [ actions: [
IconButton( IconButton(
iconSize: 40.w, iconSize: 40.w,
icon: Icon(CupertinoIcons.plus_circle,size: 40.w,color: Colors.black,), icon: Icon(
CupertinoIcons.plus_circle,
size: 40.w,
color: Colors.black,
),
onPressed: () { onPressed: () {
Get.to(() => HouseKeepingAddPage()); Get.to(() => HouseKeepingAddPage());
}) })
], ],
body: HouseKeepingView(index: 0,), // body: HouseKeepingView(
// index: 0,
// ),
); );
} }
} }

@ -26,7 +26,7 @@ class _HouseKeepingViewState extends State<HouseKeepingView> {
@override @override
void dispose() { void dispose() {
_refreshController!.dispose(); _refreshController?.dispose();
super.dispose(); super.dispose();
} }
@ -34,6 +34,7 @@ class _HouseKeepingViewState extends State<HouseKeepingView> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeListView( return BeeListView(
path: API.manage.houseKeepingList, path: API.manage.houseKeepingList,
// extraParams: {"status": widget.index == 0 ? null : widget.index},
controller: _refreshController, controller: _refreshController,
convert: (models) { convert: (models) {
return models.tableList! return models.tableList!
@ -44,7 +45,11 @@ class _HouseKeepingViewState extends State<HouseKeepingView> {
return ListView.separated( return ListView.separated(
padding: EdgeInsets.all(24.w), padding: EdgeInsets.all(24.w),
itemBuilder: (context, index) { itemBuilder: (context, index) {
return HouseKeepingCard(model: items[index]); return HouseKeepingCard(
callRefresh: () {
_refreshController!.callRefresh();
},
);
}, },
separatorBuilder: (_, __) { separatorBuilder: (_, __) {
return 24.w.heightBox; return 24.w.heightBox;

@ -0,0 +1,51 @@
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/ui/widgets/inner/bee_image_preview.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class BeeGridImageView extends StatelessWidget {
final List<String> urls;
final EdgeInsetsGeometry padding;
const BeeGridImageView({
Key? key,
required this.urls,
this.padding = EdgeInsets.zero,
}) : super(key: key);
@override
Widget build(BuildContext context) {
if (urls.isEmpty) return SizedBox();
return GridView.builder(
padding: padding,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
crossAxisSpacing: 16.w,
mainAxisSpacing: 16.w,
),
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
BeeImagePreview.toPath(path: urls[index], tag: urls[index]);
},
child: Hero(
tag: urls[index],
child: ClipRRect(
borderRadius: BorderRadius.circular(8.w),
child: FadeInImage.assetNetwork(
height: 184.w,
width: 184.w,
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: API.image(urls[index]),
fit: BoxFit.cover,
),
),
),
);
},
itemCount: urls.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
);
}
}

@ -5,12 +5,10 @@ import 'package:aku_community_manager/ui/widgets/common/aku_material_button.dart
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class AkuButton extends StatefulWidget { class AkuButton extends StatefulWidget {
@required
final Widget child; final Widget child;
final double height; final double height;
final double radius; final double radius;
final EdgeInsets padding; final EdgeInsets padding;
@required
final VoidCallback? onPressed; final VoidCallback? onPressed;
final Color color; final Color color;
final double width; final double width;

@ -63,10 +63,10 @@ class BeeListView<T> extends StatefulWidget {
final Map<String, dynamic>? extraParams; final Map<String, dynamic>? extraParams;
BeeListView({ BeeListView({
Key? key, Key? key,
/*required*/ required this.path, required this.path,
/*required*/ required this.controller, required this.controller,
/*required*/ required this.convert, required this.convert,
/*required*/ required this.builder, required this.builder,
this.size = 10, this.size = 10,
this.extraParams, this.extraParams,
}) : super(key: key); }) : super(key: key);

@ -8,7 +8,8 @@ import 'package:aku_community_manager/tools/screen_tool.dart';
class AkuTabBar extends StatefulWidget { class AkuTabBar extends StatefulWidget {
final TabController controller; final TabController controller;
final List<String> tabs; final List<String> tabs;
AkuTabBar({Key? key, /*required*/ required this.controller, /*required*/ required this.tabs}) final bool isScrollable;
AkuTabBar({Key? key, required this.controller, required this.tabs, this.isScrollable=false})
: super(key: key); : super(key: key);
@override @override
@ -19,7 +20,7 @@ class _AkuTabBarState extends State<AkuTabBar> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return TabBar( return TabBar(
// isScrollable: true, isScrollable: widget.isScrollable,
labelColor: AppStyle.primaryTextColor, labelColor: AppStyle.primaryTextColor,
unselectedLabelColor: AppStyle.minorTextColor, unselectedLabelColor: AppStyle.minorTextColor,
labelStyle: TextStyle( labelStyle: TextStyle(

@ -0,0 +1,92 @@
import 'dart:io';
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/const/resource.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class BeeImagePreview extends StatefulWidget {
static Future<T?> toFile<T>({required File file, String? tag}) async {
return await navigator!.push(
PageRouteBuilder(
opaque: false,
fullscreenDialog: true,
pageBuilder: (context, animation, secondAnimation) {
return FadeTransition(
opacity: animation,
child: BeeImagePreview.file(file: file, tag: tag),
);
},
transitionsBuilder: (context, animation, secondaryAnimation, child) {
return child;
},
),
);
}
static toPath({required String? path, String? tag}) {
navigator!.push(
PageRouteBuilder(
opaque: false,
fullscreenDialog: true,
pageBuilder: (context, animation, secondAnimation) {
return BeeImagePreview.path(path: path, tag: tag);
},
transitionsBuilder: (context, animation, secondaryAnimation, child) {
return FadeTransition(
opacity: animation,
child: child,
);
},
),
);
}
final File? file;
final String? path;
final String? tag;
BeeImagePreview.file({Key? key, required this.file, this.tag})
: path = null,
super(key: key);
BeeImagePreview.path({Key? key, required this.path, this.tag})
: file = null,
super(key: key);
@override
_BeeImagePreviewState createState() => _BeeImagePreviewState();
}
class _BeeImagePreviewState extends State<BeeImagePreview> {
Widget get image {
if (widget.file == null)
return Hero(
tag: widget.tag ?? widget.path!,
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: API.image(widget.path!),
),
);
else
return Hero(
tag: widget.tag ?? widget.file.hashCode,
child: Image.file(widget.file!),
);
}
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: Get.back,
child: Scaffold(
backgroundColor: Colors.black54,
body: InteractiveViewer(
boundaryMargin: EdgeInsets.all(48),
minScale: 0.2,
maxScale: 10,
child: Center(child: image),
),
),
);
}
}

@ -3,7 +3,7 @@ class Config {
static const String homeDir = '/users/zhangmeng'; static const String homeDir = '/users/zhangmeng';
/// ///
static const String packageName = 'aku_community'; static const String packageName = 'aku_community_manager';
/// ///
static String get buildPath => static String get buildPath =>

Loading…
Cancel
Save