|
|
@ -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,49 +53,80 @@ 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(
|
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
Column(
|
|
|
|
children:[
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
Text(_adress,style: TextStyle(color:AppStyle.primaryTextColor,fontSize:32.sp,fontWeight: FontWeight.bold),),
|
|
|
|
children: [
|
|
|
|
AkuBox.h(16),
|
|
|
|
Text(
|
|
|
|
Row(children: [
|
|
|
|
_adress,
|
|
|
|
Image.asset(R.ASSETS_USER_IC_PERSON_PNG,width:40.w ,height: 40.w,),
|
|
|
|
style: TextStyle(
|
|
|
|
AkuBox.w(8),
|
|
|
|
color: AppStyle.primaryTextColor,
|
|
|
|
Text('$_name先生',style:_textStyle,),
|
|
|
|
fontSize: 32.sp,
|
|
|
|
AkuBox.w(137),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
Image.asset(R.ASSETS_HOME_IC_BORROW_PNG,width: 40.w,height: 40.w,),
|
|
|
|
),
|
|
|
|
AkuBox.w(8),
|
|
|
|
AkuBox.h(16),
|
|
|
|
Text(_plate,style: _textStyle,),
|
|
|
|
Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Image.asset(
|
|
|
|
|
|
|
|
R.ASSETS_USER_IC_PERSON_PNG,
|
|
|
|
|
|
|
|
width: 40.w,
|
|
|
|
|
|
|
|
height: 40.w,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
AkuBox.w(8),
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
'$_name先生',
|
|
|
|
|
|
|
|
style: _textStyle,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
AkuBox.w(137),
|
|
|
|
|
|
|
|
Image.asset(
|
|
|
|
|
|
|
|
R.ASSETS_HOME_IC_BORROW_PNG,
|
|
|
|
|
|
|
|
width: 40.w,
|
|
|
|
|
|
|
|
height: 40.w,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
AkuBox.w(8),
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
_plate,
|
|
|
|
|
|
|
|
style: _textStyle,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Spacer(),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Spacer(),
|
|
|
|
],),
|
|
|
|
Row(
|
|
|
|
Spacer(),
|
|
|
|
children: [
|
|
|
|
Row(children: [
|
|
|
|
Image.asset(
|
|
|
|
Image.asset(R.ASSETS_HOME_IC_ARTICLE_PNG,width: 40.w,height: 40.w,),
|
|
|
|
R.ASSETS_HOME_IC_ARTICLE_PNG,
|
|
|
|
AkuBox.w(8),
|
|
|
|
width: 40.w,
|
|
|
|
Text(_time,style:_textStyle),
|
|
|
|
height: 40.w,
|
|
|
|
Spacer(),
|
|
|
|
),
|
|
|
|
],),
|
|
|
|
AkuBox.w(8),
|
|
|
|
],
|
|
|
|
Text(_time, style: _textStyle),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Positioned(
|
|
|
|
],
|
|
|
|
left: 582.w,
|
|
|
|
),
|
|
|
|
bottom: 104.w,
|
|
|
|
],
|
|
|
|
child:_statusImage(_status) ),
|
|
|
|
),
|
|
|
|
],),
|
|
|
|
Positioned(
|
|
|
|
|
|
|
|
left: 582.w, 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();
|
|
|
|
case VisitorStatus.VISIT_DONE:
|
|
|
|
case VisitorStatus.VISIT_DONE:
|
|
|
|
return Placeholder();
|
|
|
|
return Placeholder();
|
|
|
|
case VisitorStatus.OUTDATE:
|
|
|
|
case VisitorStatus.OUTDATE:
|
|
|
|
return Placeholder();
|
|
|
|
return Placeholder();
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
return Placeholder();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|