添加设施检查功能框架

hmxc
张萌 4 years ago
parent 9535d7664c
commit 4ccef5d0b4

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@ -0,0 +1,40 @@
import 'package:aku_community_manager/models/manager/facilities/facilities_map.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class FacilitiesCard extends StatefulWidget {
FacilitiesCard({Key key}) : super(key: key);
@override
_FacilitiesCardState createState() => _FacilitiesCardState();
}
class _FacilitiesCardState extends State<FacilitiesCard> {
@override
Widget build(BuildContext context) {
return Column(
children: [
Row(
children: [
'户外2号篮球场'.text.color(kTextPrimaryColor).size(32.sp).bold.make(),
Spacer(),
'待检查'
.text
.color(FacilitiesMap.insepectColor[0])
.size(28.sp)
.bold
.make(),
],
),
],
)
.box
.width(double.infinity)
.withRounded(value: 8.w)
.color(Colors.white)
.padding(EdgeInsets.all(24.w))
.make();
}
}

@ -0,0 +1,12 @@
import 'package:flutter/material.dart';
///map
class FacilitiesMap {
///
static Map<int, String> inspectStatus = {1: '待检查', 2: '未完成', 3: '已检查'};
///
static Map<int, Color> insepectColor = {
1: Color(0xFFF49F02),
2: Color(0xFF666666),
3: Color(0xFF999999)
};
}

@ -0,0 +1,51 @@
import 'package:aku_community_manager/models/manager/facilities/facilities_view.dart';
import 'package:aku_community_manager/tools/user_tool.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/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class FacilitiesPage extends StatefulWidget {
FacilitiesPage({Key key}) : super(key: key);
@override
_FacilitiesPageState createState() => _FacilitiesPageState();
}
class _FacilitiesPageState extends State<FacilitiesPage>
with TickerProviderStateMixin {
List<String> get _tabs {
return UserTool.userProvider.infoModel.canOperation
? ['待检查', '未完成', '已完成']
: ['待检查', '已完成'];
}
TabController _tabController;
@override
void initState() {
super.initState();
_tabController = TabController(length: _tabs.length, vsync: this);
}
@override
void dispose() {
_tabController?.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '设施检查',
appBarBottom: PreferredSize(
child: AkuTabBar(controller: _tabController, tabs: _tabs),
preferredSize: Size.fromHeight(88.w),
),
body: TabBarView(
children: List.generate(_tabs.length, (index) => FacilitiesView()),
),
);
}
}

@ -0,0 +1,15 @@
import 'package:flutter/material.dart';
class FacilitiesView extends StatefulWidget {
FacilitiesView({Key key}) : super(key: key);
@override
_FacilitiesViewState createState() => _FacilitiesViewState();
}
class _FacilitiesViewState extends State<FacilitiesView> {
@override
Widget build(BuildContext context) {
return ListView();
}
}

@ -0,0 +1,15 @@
import 'package:aku_community_manager/provider/app_provider.dart';
import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
///
class UserTool {
///
static AppProvider get appProvider =>
Provider.of<AppProvider>(Get.context, listen: false);
///
static UserProvider get userProvider =>
Provider.of<UserProvider>(Get.context, listen: false);
UserTool();
}

@ -1,4 +1,5 @@
// Flutter imports:
import 'package:aku_community_manager/models/manager/facilities/facilities_page.dart';
import 'package:flutter/material.dart';
// Package imports:
@ -67,6 +68,7 @@ class _ApplicationPageState extends State<ApplicationPage>
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('设施检查', R.ASSETS_HOME_IC_FACILITIES_PNG,FacilitiesPage() )
];
@override

@ -76,6 +76,7 @@ class _InspectionManageDetailsPageState
bool _onload = true;
EasyRefreshController _refreshController;
bool _exit = false;
List<LatLng> _points = [];
@override
void initState() {
super.initState();
@ -215,6 +216,7 @@ class _InspectionManageDetailsPageState
child: '确认'.text.size(28.sp).black.isIntrinsic.bold.make(),
onPressed: () {
_exit = true;
_stopTimer();
Get.back();
},
),
@ -512,7 +514,7 @@ class _InspectionManageDetailsPageState
icon: BitmapDescriptor.defaultMarkerWithHue(210)),
onLocationChanged: (argument) async {
_aMapController.moveCamera(CameraUpdate.newCameraPosition(
CameraPosition(target: argument.latLng,zoom: 19)));
CameraPosition(target: argument.latLng, zoom: 19)));
if (_canUploadLocation) {
BaseModel baseModel = await _uploadLocation(widget.executeId,
argument.latLng.longitude, argument.latLng.latitude);
@ -520,6 +522,7 @@ class _InspectionManageDetailsPageState
BotToast.showText(text: baseModel.message);
} else {
_canUploadLocation = false;
//TODO:线
}
}
},

Loading…
Cancel
Save