|
|
@ -17,7 +17,8 @@ class VisitorCardsModel {
|
|
|
|
String plate;
|
|
|
|
String plate;
|
|
|
|
String time;
|
|
|
|
String time;
|
|
|
|
VisitorStatus status;
|
|
|
|
VisitorStatus status;
|
|
|
|
VisitorCardsModel(this.adress,this.name, this.status,{this.plate,this.time});
|
|
|
|
VisitorCardsModel(this.adress, this.name, this.status,
|
|
|
|
|
|
|
|
{this.plate, this.time});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class VisitorManagerPage extends StatefulWidget {
|
|
|
|
class VisitorManagerPage extends StatefulWidget {
|
|
|
@ -30,10 +31,16 @@ class VisitorManagerPage extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
|
|
class _VisitorManagerPageState extends State<VisitorManagerPage>
|
|
|
|
class _VisitorManagerPageState extends State<VisitorManagerPage>
|
|
|
|
with TickerProviderStateMixin {
|
|
|
|
with TickerProviderStateMixin {
|
|
|
|
List<String> tabs = ['全部', '未到访', '已到访', '已过期'];
|
|
|
|
List<String> _tabs = ['全部', '未到访', '已到访', '已过期'];
|
|
|
|
|
|
|
|
|
|
|
|
List<VisitorCardsModel> cards=[
|
|
|
|
List<VisitorCardsModel> _cards = [
|
|
|
|
VisitorCardsModel('深圳华悦茂峰1幢1单元702', '马泽城',VisitorStatus.VISIT_DONE, plate:'浙BA9899',time:'2020-10-24 12:00',),
|
|
|
|
VisitorCardsModel(
|
|
|
|
|
|
|
|
'深圳华悦茂峰1幢1单元702',
|
|
|
|
|
|
|
|
'马泽城',
|
|
|
|
|
|
|
|
VisitorStatus.VISIT_DONE,
|
|
|
|
|
|
|
|
plate: '浙BA9899',
|
|
|
|
|
|
|
|
time: '2020-10-24 12:00',
|
|
|
|
|
|
|
|
),
|
|
|
|
VisitorCardsModel('深圳华悦茂峰2幢2单元702', '刘揪心', VisitorStatus.NOT_VISIT),
|
|
|
|
VisitorCardsModel('深圳华悦茂峰2幢2单元702', '刘揪心', VisitorStatus.NOT_VISIT),
|
|
|
|
VisitorCardsModel('深圳华悦茂峰3幢3单元602', '刘揪心', VisitorStatus.OUTDATE),
|
|
|
|
VisitorCardsModel('深圳华悦茂峰3幢3单元602', '刘揪心', VisitorStatus.OUTDATE),
|
|
|
|
];
|
|
|
|
];
|
|
|
@ -46,22 +53,85 @@ class _VisitorManagerPageState extends State<VisitorManagerPage>
|
|
|
|
TabController(length: 4, vsync: this, initialIndex: widget.initIndex);
|
|
|
|
TabController(length: 4, vsync: this, initialIndex: widget.initIndex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
|
|
void dispose() {
|
|
|
|
|
|
|
|
_tabController?.dispose();
|
|
|
|
|
|
|
|
super.dispose();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return AkuScaffold(
|
|
|
|
return AkuScaffold(
|
|
|
|
title: '访客管理',
|
|
|
|
title: '访客管理',
|
|
|
|
appBarBottom: PreferredSize(
|
|
|
|
appBarBottom: PreferredSize(
|
|
|
|
child: AkuTabBar(
|
|
|
|
child: AkuTabBar(
|
|
|
|
tabs: tabs,
|
|
|
|
tabs: _tabs,
|
|
|
|
controller: _tabController,
|
|
|
|
controller: _tabController,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
preferredSize: Size.fromHeight(88.w)),
|
|
|
|
preferredSize: Size.fromHeight(88.w)),
|
|
|
|
body: ListView(
|
|
|
|
body: TabBarView(
|
|
|
|
|
|
|
|
controller: _tabController,
|
|
|
|
|
|
|
|
// children: _tabs.map((e) => _buildTabView(_tabs.indexOf(e))).toList(),)
|
|
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
|
|
// ListView(
|
|
|
|
|
|
|
|
// padding: EdgeInsets.only(left: 32.w, right: 32.w),
|
|
|
|
|
|
|
|
// children: _cards
|
|
|
|
|
|
|
|
// .map((e) => VisitorManagerCard(
|
|
|
|
|
|
|
|
// adress: e.adress,
|
|
|
|
|
|
|
|
// name: e.name,
|
|
|
|
|
|
|
|
// plate: e.plate,
|
|
|
|
|
|
|
|
// time: e.time,
|
|
|
|
|
|
|
|
// ))
|
|
|
|
|
|
|
|
// .toList(),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ListView(
|
|
|
|
|
|
|
|
// padding: EdgeInsets.only(left: 32.w, right: 32.w),
|
|
|
|
|
|
|
|
// children: _cards
|
|
|
|
|
|
|
|
// .where((element) => element.status == VisitorStatus.NOT_VISIT)
|
|
|
|
|
|
|
|
// .map((e) => VisitorManagerCard(
|
|
|
|
|
|
|
|
// adress: e.adress,
|
|
|
|
|
|
|
|
// name: e.name,
|
|
|
|
|
|
|
|
// plate: e.plate,
|
|
|
|
|
|
|
|
// time: e.time,
|
|
|
|
|
|
|
|
// ))
|
|
|
|
|
|
|
|
// .toList(),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ListView(),
|
|
|
|
|
|
|
|
// ListView(),
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
children: _tabs.map((e) => _buildListView(_tabs.indexOf(e))).toList(),
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Widget _buildListView(int index) {
|
|
|
|
|
|
|
|
List<VisitorCardsModel> _selectCards;
|
|
|
|
|
|
|
|
switch (index) {
|
|
|
|
|
|
|
|
case 0:
|
|
|
|
|
|
|
|
_selectCards = _cards;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
|
|
_selectCards = _cards
|
|
|
|
|
|
|
|
.where((element) => element.status == VisitorStatus.NOT_VISIT).toList();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
|
|
|
|
_selectCards = _cards
|
|
|
|
|
|
|
|
.where((element) => element.status == VisitorStatus.VISIT_DONE).toList();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 3:
|
|
|
|
|
|
|
|
_selectCards =
|
|
|
|
|
|
|
|
_cards.where((element) => element.status == VisitorStatus.OUTDATE).toList();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return ListView(
|
|
|
|
padding: EdgeInsets.only(left: 32.w, right: 32.w),
|
|
|
|
padding: EdgeInsets.only(left: 32.w, right: 32.w),
|
|
|
|
children: [
|
|
|
|
children: _selectCards
|
|
|
|
...cards.map((e) => VisitorManagerCard(adress: e.adress,name: e.name,plate: e.plate,time: e.time,)).toList(),
|
|
|
|
.map((e) => VisitorManagerCard(
|
|
|
|
],
|
|
|
|
adress: e.adress,
|
|
|
|
),
|
|
|
|
name: e.name,
|
|
|
|
|
|
|
|
plate: e.plate,
|
|
|
|
|
|
|
|
time: e.time,
|
|
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
.toList(),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|