|
|
@ -4,35 +4,46 @@ import 'package:aku_community_manager/tools/widget_tool.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:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class VisitorManagerCard extends StatefulWidget {
|
|
|
|
class VisitorManagerCard extends StatefulWidget {
|
|
|
|
final String adress;
|
|
|
|
final String adress;
|
|
|
|
final String name;
|
|
|
|
final String name;
|
|
|
|
final String plate;
|
|
|
|
final String plate;
|
|
|
|
final String time;
|
|
|
|
final String time;
|
|
|
|
final VisitorStatus status;
|
|
|
|
final VisitorStatus status;
|
|
|
|
VisitorManagerCard({Key key, @required this.adress,@required this.name, this.plate, this.time,@required this.status}) : super(key: key);
|
|
|
|
VisitorManagerCard(
|
|
|
|
|
|
|
|
{Key key,
|
|
|
|
|
|
|
|
@required this.adress,
|
|
|
|
|
|
|
|
@required this.name,
|
|
|
|
|
|
|
|
this.plate,
|
|
|
|
|
|
|
|
this.time,
|
|
|
|
|
|
|
|
@required this.status})
|
|
|
|
|
|
|
|
: super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
_VisitorManagerCardState createState() => _VisitorManagerCardState();
|
|
|
|
_VisitorManagerCardState createState() => _VisitorManagerCardState();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _VisitorManagerCardState extends State<VisitorManagerCard> {
|
|
|
|
class _VisitorManagerCardState extends State<VisitorManagerCard> {
|
|
|
|
|
|
|
|
TextStyle _textStyle = TextStyle(
|
|
|
|
TextStyle _textStyle=TextStyle(color:AppStyle.primaryTextColor,fontSize:28.sp,);
|
|
|
|
color: AppStyle.primaryTextColor,
|
|
|
|
String _adress;
|
|
|
|
fontSize: 28.sp,
|
|
|
|
String _name;
|
|
|
|
);
|
|
|
|
String _plate;
|
|
|
|
String _adress;
|
|
|
|
String _time;
|
|
|
|
String _name;
|
|
|
|
VisitorStatus _status;
|
|
|
|
String _plate;
|
|
|
|
|
|
|
|
String _time;
|
|
|
|
|
|
|
|
VisitorStatus _status;
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
|
_adress=widget.adress;
|
|
|
|
_adress = widget.adress;
|
|
|
|
_name=widget.name;
|
|
|
|
_name = widget.name;
|
|
|
|
_plate=widget.plate??'无信息';
|
|
|
|
_plate = widget.plate ?? '无信息';
|
|
|
|
_time=widget.time??'无信息';
|
|
|
|
_time = widget.time ?? '无信息';
|
|
|
|
_status=widget.status;
|
|
|
|
_status = widget.status;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Column(
|
|
|
|
return Column(
|
|
|
@ -42,42 +53,71 @@ VisitorStatus _status;
|
|
|
|
color: Color(0xFFFFFFFF),
|
|
|
|
color: Color(0xFFFFFFFF),
|
|
|
|
width: double.infinity,
|
|
|
|
width: double.infinity,
|
|
|
|
height: 201.w,
|
|
|
|
height: 201.w,
|
|
|
|
padding: EdgeInsets.only(top:24.w,left:24.w,bottom: 28.w),
|
|
|
|
padding: EdgeInsets.only(top: 24.w, left: 24.w, bottom: 28.w),
|
|
|
|
child: Stack(children: [
|
|
|
|
child: Stack(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children:[
|
|
|
|
children: [
|
|
|
|
Text(_adress,style: TextStyle(color:AppStyle.primaryTextColor,fontSize:32.sp,fontWeight: FontWeight.bold),),
|
|
|
|
Text(
|
|
|
|
|
|
|
|
_adress,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
color: AppStyle.primaryTextColor,
|
|
|
|
|
|
|
|
fontSize: 32.sp,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
|
|
|
),
|
|
|
|
AkuBox.h(16),
|
|
|
|
AkuBox.h(16),
|
|
|
|
Row(children: [
|
|
|
|
Row(
|
|
|
|
Image.asset(R.ASSETS_USER_IC_PERSON_PNG,width:40.w ,height: 40.w,),
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Image.asset(
|
|
|
|
|
|
|
|
R.ASSETS_USER_IC_PERSON_PNG,
|
|
|
|
|
|
|
|
width: 40.w,
|
|
|
|
|
|
|
|
height: 40.w,
|
|
|
|
|
|
|
|
),
|
|
|
|
AkuBox.w(8),
|
|
|
|
AkuBox.w(8),
|
|
|
|
Text('$_name先生',style:_textStyle,),
|
|
|
|
Text(
|
|
|
|
|
|
|
|
'$_name先生',
|
|
|
|
|
|
|
|
style: _textStyle,
|
|
|
|
|
|
|
|
),
|
|
|
|
AkuBox.w(137),
|
|
|
|
AkuBox.w(137),
|
|
|
|
Image.asset(R.ASSETS_HOME_IC_BORROW_PNG,width: 40.w,height: 40.w,),
|
|
|
|
Image.asset(
|
|
|
|
|
|
|
|
R.ASSETS_HOME_IC_BORROW_PNG,
|
|
|
|
|
|
|
|
width: 40.w,
|
|
|
|
|
|
|
|
height: 40.w,
|
|
|
|
|
|
|
|
),
|
|
|
|
AkuBox.w(8),
|
|
|
|
AkuBox.w(8),
|
|
|
|
Text(_plate,style: _textStyle,),
|
|
|
|
Text(
|
|
|
|
|
|
|
|
_plate,
|
|
|
|
|
|
|
|
style: _textStyle,
|
|
|
|
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Spacer(),
|
|
|
|
],),
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Spacer(),
|
|
|
|
Row(children: [
|
|
|
|
Row(
|
|
|
|
Image.asset(R.ASSETS_HOME_IC_ARTICLE_PNG,width: 40.w,height: 40.w,),
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Image.asset(
|
|
|
|
|
|
|
|
R.ASSETS_HOME_IC_ARTICLE_PNG,
|
|
|
|
|
|
|
|
width: 40.w,
|
|
|
|
|
|
|
|
height: 40.w,
|
|
|
|
|
|
|
|
),
|
|
|
|
AkuBox.w(8),
|
|
|
|
AkuBox.w(8),
|
|
|
|
Text(_time,style:_textStyle),
|
|
|
|
Text(_time, style: _textStyle),
|
|
|
|
Spacer(),
|
|
|
|
Spacer(),
|
|
|
|
],),
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Positioned(
|
|
|
|
Positioned(
|
|
|
|
left: 582.w,
|
|
|
|
left: 582.w, bottom: 104.w, child: _statusImage(_status)),
|
|
|
|
bottom: 104.w,
|
|
|
|
],
|
|
|
|
child:_statusImage(_status) ),
|
|
|
|
),
|
|
|
|
],),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Widget _statusImage(VisitorStatus status){
|
|
|
|
|
|
|
|
|
|
|
|
Widget _statusImage(VisitorStatus status) {
|
|
|
|
switch (status) {
|
|
|
|
switch (status) {
|
|
|
|
case VisitorStatus.NOT_VISIT:
|
|
|
|
case VisitorStatus.NOT_VISIT:
|
|
|
|
return Placeholder();
|
|
|
|
return Placeholder();
|
|
|
@ -85,6 +125,8 @@ VisitorStatus _status;
|
|
|
|
return Placeholder();
|
|
|
|
return Placeholder();
|
|
|
|
case VisitorStatus.OUTDATE:
|
|
|
|
case VisitorStatus.OUTDATE:
|
|
|
|
return Placeholder();
|
|
|
|
return Placeholder();
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
return Placeholder();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|