巡检管理页完成,命名规范化

hmxc
张萌 4 years ago
parent dfe149b8c9
commit 032bba7c7c

@ -22,6 +22,7 @@ class MyApp extends StatelessWidget {
ChangeNotifierProvider(create: (context) => AppProvider()), ChangeNotifierProvider(create: (context) => AppProvider()),
ChangeNotifierProvider(create: (context) => FixProvider()), ChangeNotifierProvider(create: (context) => FixProvider()),
ChangeNotifierProvider(create: (context)=> GreenManageProvider()), ChangeNotifierProvider(create: (context)=> GreenManageProvider()),
ChangeNotifierProvider(create: (context)=>InspectionManageProvider()),
], ],
child: GetMaterialApp( child: GetMaterialApp(
title: '小蜜蜂管家', title: '小蜜蜂管家',

@ -34,3 +34,24 @@ class GreenManageCardModel {
]; ];
} }
} }
class InspectionManageCardModel{
String title;
String date;
String cycle;
String time;
List<String> persons;
List<String> stations;
InspectionManageCardModel(this.title,this.date,this.cycle,this.time,this.persons,this.stations);
static List<InspectionManageCardModel> initList(){
return [
InspectionManageCardModel('1号巡检任务', '2020.1-2020.12', '每周一、三、五', '8:00-12:00', ['王珂','陈晖洁','凯尔希','王铁锤','李狗蛋','尼古拉斯'], [
'小区东门入口','1号南门','3号门站','3号闸门','3号门站'
]),
InspectionManageCardModel('2号巡检任务', '2020.1-2020.12', '每周二', '8:00-12:00',['史尔特尔'] , []),
InspectionManageCardModel('3号巡检任务', '2020.1-2020.12', '每周二、四、六', '8:00-12:00', ['叶莲娜'], []),
];
}
}

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

@ -1,4 +1,5 @@
import 'package:aku_community_manager/ui/manage_pages/green_manage_page.dart'; import 'package:aku_community_manager/ui/manage_pages/green_manage_page.dart';
import 'package:aku_community_manager/ui/manage_pages/inspection_manage_page.dart';
import 'package:aku_community_manager/ui/sub_pages/activity_manager/activity_manager_page.dart'; import 'package:aku_community_manager/ui/sub_pages/activity_manager/activity_manager_page.dart';
import 'package:aku_community_manager/ui/sub_pages/visitor_manager/visitor_manager_page.dart'; import 'package:aku_community_manager/ui/sub_pages/visitor_manager/visitor_manager_page.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart'; import 'package:aku_ui/common_widgets/aku_material_button.dart';
@ -51,6 +52,7 @@ class _ApplicationPageState extends State<ApplicationPage>
]; ];
List<AppApplication> _wisdomApplications=[ List<AppApplication> _wisdomApplications=[
AppApplication('绿化管理', R.ASSETS_HOME_IC_GREENING_PNG, GreenManagePage()), AppApplication('绿化管理', R.ASSETS_HOME_IC_GREENING_PNG, GreenManagePage()),
AppApplication('巡检管理', R.ASSETS_HOME_IC_PATROL_PNG, InspectionManagePage()),
]; ];
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -1,4 +1,4 @@
import 'package:aku_community_manager/mock_models/manage_models/green_manage_model.dart'; import 'package:aku_community_manager/mock_models/manage_models/manage_model.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/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
@ -7,10 +7,10 @@ import 'package:flutter/material.dart';
import 'package:aku_community_manager/const/resource.dart'; import 'package:aku_community_manager/const/resource.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
class GreenManageDetails extends StatelessWidget { class GreenManageDetailsPage extends StatelessWidget {
final GreenManageCardModel cardModel; final GreenManageCardModel cardModel;
GreenManageDetails(this.cardModel); GreenManageDetailsPage(this.cardModel);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -1,8 +1,8 @@
import 'package:aku_community_manager/mock_models/manage_models/green_manage_model.dart'; import 'package:aku_community_manager/mock_models/manage_models/manage_model.dart';
import 'package:aku_community_manager/provider/manage_provider.dart'; import 'package:aku_community_manager/provider/manage_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/manage_pages/green_manage_details.dart'; import 'package:aku_community_manager/ui/manage_pages/green_manage_details_page.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_ui/common_widgets/aku_common_widgets.dart'; import 'package:aku_ui/common_widgets/aku_common_widgets.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -42,7 +42,7 @@ class _GreenManagePageState extends State<GreenManagePage> {
// //
AkuButton( AkuButton(
onPressed: () { onPressed: () {
Get.to(GreenManageDetails(cardModel) Get.to(GreenManageDetailsPage(cardModel)
); );
}, },
child: Container( child: Container(

@ -0,0 +1,13 @@
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:flutter/material.dart';
class InspectionManageDetailsPage extends StatelessWidget {
const InspectionManageDetailsPage({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return AkuScaffold(
);
}
}

@ -0,0 +1,151 @@
import 'package:aku_community_manager/mock_models/manage_models/manage_model.dart';
import 'package:aku_community_manager/provider/manage_provider.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/widgets/common/aku_scaffold.dart';
import 'package:aku_ui/common_widgets/aku_common_widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:provider/provider.dart';
import 'package:aku_community_manager/const/resource.dart';
class InspectionManagePage extends StatefulWidget {
InspectionManagePage({Key key}) : super(key: key);
@override
_InspectionManagePageState createState() => _InspectionManagePageState();
}
class _InspectionManagePageState extends State<InspectionManagePage> {
@override
Widget build(BuildContext context) {
final _inspectionManageModel =
Provider.of<InspectionManageProvider>(context);
return AkuScaffold(
title: '巡检管理',
body: ListView(
padding: EdgeInsets.only(left: 32.w, right: 32.w),
children: _inspectionManageModel.inspectionManageModels
.map((e) => _inspectionManageCard(e))
.toList(),
),
);
}
Widget _inspectionManageCard(InspectionManageCardModel cardModel) {
TextStyle _textstyle =
TextStyle(color: AppStyle.minorTextColor, fontSize: 28.sp);
return Column(
children: [
AkuBox.h(16),
AkuButton(
onPressed: () {
},
child: Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 24.w, right: 24.w, bottom: 48.w),
width: 686.w,
height: 362.w,
color: Color(0xFFFFFFFF),
child: Column(children: [
Container(
height: 93.w,
width: double.infinity,
alignment: Alignment.centerLeft,
child: Text(
cardModel.title,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 32.sp,
fontWeight: FontWeight.bold),
)),
Divider(
height: 1.w,
),
AkuBox.h(24),
Row(
children: [
Image.asset(
R.ASSETS_MANAGE_IC_RENWU_PNG,
width: 40.w,
height: 40.w,
),
AkuBox.w(4),
Text(
'巡检日期',
style: _textstyle,
),
Spacer(),
Text(
cardModel.date,
style: AppStyle().primaryStyle,
)
],
),
Spacer(),
Row(
children: [
Image.asset(
R.ASSETS_HOME_IC_NEWS_PNG,
width: 40.w,
height: 40.w,
),
AkuBox.w(4),
Text('巡检周期', style: _textstyle),
Spacer(),
Text(
cardModel.cycle,
style: AppStyle().primaryStyle,
),
],
),
Spacer(),
Row(
children: [
Image.asset(
R.ASSETS_MANAGE_IC_TIME_PNG,
width: 40.w,
height: 40.w,
),
AkuBox.w(4),
Text(
'巡检时间',
style: _textstyle,
),
Spacer(),
Text(
cardModel.time,
style: AppStyle().primaryStyle,
),
],
),
Spacer(),
Row(
children: [
Image.asset(
R.ASSETS_MESSAGE_IC_PEOPLE_PNG,
width: 40.w,
height: 40.w,
),
AkuBox.w(4),
Text(
'巡检人员',
style: _textstyle,
),
Spacer(),
Text(
cardModel.persons.length > 2
? '${cardModel.persons[0]}${cardModel.persons[1]}'
: cardModel.persons[0],
style: AppStyle().primaryStyle,
),
],
),
]),
),
),
],
);
}
}
Loading…
Cancel
Save