parent
9535d7664c
commit
4ccef5d0b4
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();
|
||||||
|
}
|
Loading…
Reference in new issue