flutter format

hmxc
小赖 4 years ago
parent 0be5099251
commit 97a8528e8f

@ -87,27 +87,26 @@ class ItemsOutdoorModel {
rejectReason: '',
),
ItemsOutdoorModel(
status: OUTDOORSTATUS.OUT_DONE,
datetime: DateTime(2020, 10, 23, 09, 28, 56),
communityname: '深圳华悦茂峰',
adress: '1幢1单元702室',
name: '马云',
identify: '业主',
items: ItemDetails(
itemname: '家具',
weight: 60,
way: '搬家公司',
imagepath: [
R.ASSETS_OUTDOOR_ITME1_PNG,
R.ASSETS_OUTDOOR_ITEM2_PNG,
R.ASSETS_OUTDOOR_ITEM3_PNG
],
),
outtime: '2020-10-24 12:00',
finalOutTime: '2020-10-23 11:23:56',
outPlace: '东大门',
rejectReason: ''
),
status: OUTDOORSTATUS.OUT_DONE,
datetime: DateTime(2020, 10, 23, 09, 28, 56),
communityname: '深圳华悦茂峰',
adress: '1幢1单元702室',
name: '马云',
identify: '业主',
items: ItemDetails(
itemname: '家具',
weight: 60,
way: '搬家公司',
imagepath: [
R.ASSETS_OUTDOOR_ITME1_PNG,
R.ASSETS_OUTDOOR_ITEM2_PNG,
R.ASSETS_OUTDOOR_ITEM3_PNG
],
),
outtime: '2020-10-24 12:00',
finalOutTime: '2020-10-23 11:23:56',
outPlace: '东大门',
rejectReason: ''),
ItemsOutdoorModel(
status: OUTDOORSTATUS.REJECTED,
datetime: DateTime(2020, 10, 23, 09, 28, 56),

@ -1,12 +1,12 @@
import 'package:aku_community_manager/mock_models/anouncement/anouncement_model.dart';
import 'package:flutter/material.dart';
class AnouncementProvider extends ChangeNotifier{
List<AnouncementCardModel> _anouncementCardModel=AnouncementCardModel.initList();
List<AnouncementCardModel> get anouncementCardModels =>_anouncementCardModel;
addAnouncementCardModel(AnouncementCardModel model){
_anouncementCardModel.insert(0, model);
notifyListeners();
class AnouncementProvider extends ChangeNotifier {
List<AnouncementCardModel> _anouncementCardModel =
AnouncementCardModel.initList();
List<AnouncementCardModel> get anouncementCardModels => _anouncementCardModel;
addAnouncementCardModel(AnouncementCardModel model) {
_anouncementCardModel.insert(0, model);
notifyListeners();
}
}
}

@ -1,14 +1,17 @@
import 'package:aku_community_manager/mock_models/manage_models/manage_model.dart';
import 'package:flutter/material.dart';
class GreenManageProvider extends ChangeNotifier{
List<GreenManageCardModel> _greenManageModel =GreenManageCardModel.initList();
class GreenManageProvider extends ChangeNotifier {
List<GreenManageCardModel> _greenManageModel =
GreenManageCardModel.initList();
List<GreenManageCardModel> get greenManageModels => _greenManageModel;
notifyListeners();
}
class InspectionManageProvider extends ChangeNotifier{
List<InspectionManageCardModel> _inspectionManageModel=InspectionManageCardModel.initList();
List<InspectionManageCardModel> get inspectionManageModels => _inspectionManageModel;
class InspectionManageProvider extends ChangeNotifier {
List<InspectionManageCardModel> _inspectionManageModel =
InspectionManageCardModel.initList();
List<InspectionManageCardModel> get inspectionManageModels =>
_inspectionManageModel;
notifyListeners();
}
}

@ -26,4 +26,4 @@ class OutdoorProvider extends ChangeNotifier {
_itemOutdoorModel,
][index];
}
}
}

@ -12,10 +12,10 @@ class PrivacyPage extends StatelessWidget {
body: SingleChildScrollView(
padding: EdgeInsets.all(16.sp),
child: Column(
children: [Text(
children: [
Text(
'小蜜蜂智慧社区管家端隐私政策',
style: TextStyle(
fontWeight: FontWeight.w600, fontSize: 35.w),
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 35.w),
),
Text(
'''

@ -20,9 +20,7 @@ class AllAnouncement extends StatefulWidget {
}
class AllAnouncementState extends State<AllAnouncement> {
static Widget anounceCard(
AnouncementCardModel model
) {
static Widget anounceCard(AnouncementCardModel model) {
return Column(
children: [
AkuButton(
@ -30,7 +28,7 @@ class AllAnouncementState extends State<AllAnouncement> {
Get.to(AnouncementDetails(
title: model.title,
date: model.date,
body: model.body==null?'':model.body,
body: model.body == null ? '' : model.body,
));
},
child: Container(
@ -53,7 +51,11 @@ class AllAnouncementState extends State<AllAnouncement> {
Color(0xFF7EB4FF),
Color(0xFF3F8FFE),
])),
child: Image.asset(R.ASSETS_MANAGE_IC_ANNOUNCE_PNG,width: 74.w,height: 60.w,),
child: Image.asset(
R.ASSETS_MANAGE_IC_ANNOUNCE_PNG,
width: 74.w,
height: 60.w,
),
),
SizedBox(
width: 24.w,
@ -120,14 +122,17 @@ class AllAnouncementState extends State<AllAnouncement> {
@override
Widget build(BuildContext context) {
final AnouncementProvider _anouncementProvider=Provider.of<AnouncementProvider>(context);
final AnouncementProvider _anouncementProvider =
Provider.of<AnouncementProvider>(context);
return AkuScaffold(
title: '全部公告',
body: ListView(
padding: EdgeInsets.only(left: 32.w, right: 32.w),
children: [
_anouncementList('2020-10-22', _anouncementProvider.anouncementCardModels.sublist(0,2)),
_anouncementList('2020-10-20', _anouncementProvider.anouncementCardModels.sublist(2,2)),
_anouncementList('2020-10-22',
_anouncementProvider.anouncementCardModels.sublist(0, 2)),
_anouncementList('2020-10-20',
_anouncementProvider.anouncementCardModels.sublist(2, 2)),
],
),
);

@ -1,4 +1,3 @@
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:flutter/material.dart';
@ -24,41 +23,42 @@ class AnouncementDetails extends StatelessWidget {
padding: EdgeInsets.only(top: 24.w, left: 33.w, right: 33.w),
width: double.infinity,
height: double.infinity,
child: Column(mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
title,
style: AppStyle().barTitleStyle,
),
SizedBox(
height: 16.w,
),
Text(body,
style:
TextStyle(color: AppStyle.primaryTextColor, fontSize: 28.sp)),
SizedBox(
height: 120.w,
),
Row(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Spacer(),
Column(
mainAxisAlignment: MainAxisAlignment.center,
Text(
title,
style: AppStyle().barTitleStyle,
),
SizedBox(
height: 16.w,
),
Text(body,
style: TextStyle(
color: AppStyle.primaryTextColor, fontSize: 28.sp)),
SizedBox(
height: 120.w,
),
Row(
children: [
Text('深圳永成物业有限公司', style: AppStyle().primaryStyle),
Spacer(),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('深圳永成物业有限公司', style: AppStyle().primaryStyle),
SizedBox(
height: 4.w,
),
Text(date, style: AppStyle().primaryStyle),
],
),
SizedBox(
height: 4.w,
width: 56.w - 31.w,
),
Text(date, style: AppStyle().primaryStyle),
],
),
SizedBox(
width: 56.w - 31.w,
),
],
),
]),
]),
),
);
}

@ -4,6 +4,7 @@ import 'package:aku_ui/common_widgets/aku_common_widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:aku_community_manager/const/resource.dart';
class CommentMessage extends StatefulWidget {
CommentMessage({Key key}) : super(key: key);
@ -12,11 +13,15 @@ class CommentMessage extends StatefulWidget {
}
class _CommentMessageState extends State<CommentMessage> {
Widget _messageList(String date, String name, String comment,) {
Widget _messageList(
String date,
String name,
String comment,
) {
return Column(
children: [
Container(
margin: EdgeInsets.only(top:24.w,bottom:24.w),
margin: EdgeInsets.only(top: 24.w, bottom: 24.w),
alignment: Alignment.center,
width: double.infinity,
child: Text(
@ -130,12 +135,13 @@ class _CommentMessageState extends State<CommentMessage> {
],
);
}
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '评论消息',
body: ListView(
padding: EdgeInsets.only(left:32.w,right: 32.w,bottom: 40.w),
body: ListView(
padding: EdgeInsets.only(left: 32.w, right: 32.w, bottom: 40.w),
children: [
_messageList('2020-10-23 10:00', '杨建', '四星'),
_messageList('2020-10-24 11:00', '刘能', '四星'),
@ -143,4 +149,4 @@ class _CommentMessageState extends State<CommentMessage> {
),
);
}
}
}

@ -18,7 +18,7 @@ class _SystemMessageState extends State<SystemMessage> {
return Column(
children: [
Container(
margin: EdgeInsets.only(top:24.w,bottom: 24.w),
margin: EdgeInsets.only(top: 24.w, bottom: 24.w),
alignment: Alignment.center,
width: double.infinity,
child: Text(
@ -159,7 +159,7 @@ class _SystemMessageState extends State<SystemMessage> {
return AkuScaffold(
title: '系统消息',
body: ListView(
padding: EdgeInsets.only(left:32.w,right:32.w,bottom: 40.w),
padding: EdgeInsets.only(left: 32.w, right: 32.w, bottom: 40.w),
children: [
_messageList('2020-10-23 10:00', '杨建', '17867665666', '共区'),
_messageList('2020-10-22 10:00', '刘能', '17855823545', '共区'),

@ -117,10 +117,10 @@ class GreenManageDetailsPage extends StatelessWidget {
AkuBox.h(16),
Expanded(
child: Container(
alignment: Alignment.centerLeft,
alignment: Alignment.centerLeft,
width: double.infinity,
color: Color(0xFFFFFFFF),
padding: EdgeInsets.only(top: 16.w,left: 32.w,right: 32.w),
padding: EdgeInsets.only(top: 16.w, left: 32.w, right: 32.w),
child: Column(
children: [
Text('详细描述',
@ -129,7 +129,11 @@ class GreenManageDetailsPage extends StatelessWidget {
fontSize: 32.w,
fontWeight: FontWeight.bold)),
AkuBox.h(16),
Text(cardModel.body,style: TextStyle(color:AppStyle.primaryTextColor,fontSize: 28.w),),
Text(
cardModel.body,
style: TextStyle(
color: AppStyle.primaryTextColor, fontSize: 28.w),
),
],
),
)),

@ -26,9 +26,9 @@ class _GreenManagePageState extends State<GreenManagePage> {
title: '绿化管理',
body: ListView.builder(
itemBuilder: (context, index) {
return _greenManageCard(greenManageProvider.greenManageModels[index]);
return _greenManageCard(greenManageProvider.greenManageModels[index]);
},
padding: EdgeInsets.only(left: 32.w, right: 32.w,bottom: 40.w),
padding: EdgeInsets.only(left: 32.w, right: 32.w, bottom: 40.w),
itemCount: greenManageProvider.greenManageModels.length,
),
);
@ -42,8 +42,7 @@ class _GreenManagePageState extends State<GreenManagePage> {
//
AkuButton(
onPressed: () {
Get.to(GreenManageDetailsPage(cardModel)
);
Get.to(GreenManageDetailsPage(cardModel));
},
child: Container(
height: 302.w,

@ -22,25 +22,32 @@ class InspectionManageCard {
children: [
AkuBox.h(16),
AkuButton(
onPressed: extra? () {
Get.to(InspectionManageDetailsPage(cardModel: cardModel,));
}:(){},
onPressed: extra
? () {
Get.to(InspectionManageDetailsPage(
cardModel: cardModel,
));
}
: () {},
child: Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 24.w, right: 24.w, bottom: extra? 48.w:40.w),
padding: EdgeInsets.only(
left: 24.w, right: 24.w, bottom: extra ? 48.w : 40.w),
width: double.infinity,
height:extra? 362.w:270.w,
decoration: BoxDecoration(borderRadius:BorderRadius.circular(8.w),color: Color(0xFFFFFFFF)),
height: extra ? 362.w : 270.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
color: Color(0xFFFFFFFF)),
child: Column(children: [
Container(
height:extra? 93.w :86.w,
height: extra ? 93.w : 86.w,
width: double.infinity,
alignment: Alignment.centerLeft,
child: Text(
cardModel.title,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: extra? 32.sp:36.sp,
fontSize: extra ? 32.sp : 36.sp,
fontWeight: FontWeight.bold),
)),
extra
@ -48,7 +55,7 @@ class InspectionManageCard {
height: 1.w,
)
: SizedBox(),
extra? AkuBox.h(24):SizedBox(),
extra ? AkuBox.h(24) : SizedBox(),
Row(
children: [
Image.asset(

@ -54,9 +54,8 @@ class InspectionManageDetailsPage extends StatelessWidget {
color: Color(0xFFFFFFFF),
padding: EdgeInsets.only(top: 24.w, left: 32.w, right: 32.w),
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
child:
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Text('巡检站点',
style: TextStyle(
color: AppStyle.primaryTextColor,

@ -21,7 +21,7 @@ class _InspectionManagePageState extends State<InspectionManagePage> {
return AkuScaffold(
title: '巡检管理',
body: ListView(
padding: EdgeInsets.only(left: 32.w, right: 32.w,bottom: 40.w),
padding: EdgeInsets.only(left: 32.w, right: 32.w, bottom: 40.w),
children: _inspectionManageModel.inspectionManageModels
.map((e) => InspectionManageCard(e).inspectionManageCard())
.toList(),

@ -125,8 +125,8 @@ class _DecorationManagerDetailStatePage
name: '业主:' + widget.model.userHomeModel.userName,
phone: widget.model.userHomeModel.phone,
rightTopWidget: Transform.rotate(
angle: pi/4,
child: widget.model.statusType == DecorationStatusType.DONE
angle: pi / 4,
child: widget.model.statusType == DecorationStatusType.DONE
? Image.asset(R.ASSETS_MANAGE_IC_WANCHENG_PNG)
: Image.asset(R.ASSETS_MANAGE_IC_ZHUANGXIU_PNG),
),

@ -192,7 +192,11 @@ class _ItemsOutdoorCardState extends State<ItemsOutdoorCard> {
AkuBox.h(12),
Row(
children: [
Image.asset(R.ASSETS_OUTDOOR_IC_CHUHU_PNG,width: 40.w,height: 40.w,),
Image.asset(
R.ASSETS_OUTDOOR_IC_CHUHU_PNG,
width: 40.w,
height: 40.w,
),
Text(
'出户物品',
style: _textStyle,
@ -266,14 +270,14 @@ class _ItemsOutdoorCardState extends State<ItemsOutdoorCard> {
width: 160.w,
height: 64.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
borderRadius: BorderRadius.circular(8.w),
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
AppStyle.primaryColor,
AppStyle.minorColor
])),
AppStyle.primaryColor,
AppStyle.minorColor
])),
child: Text(
'查看详情',
style: AppStyle().primaryStyle,

@ -150,7 +150,7 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
),
],
),
bottom:_bottomCard(userRole) ,
bottom: _bottomCard(userRole),
);
}
@ -177,7 +177,9 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
children: [
AkuButton(
onPressed: () {
Get.to(OutdoorNotpassPage(model: widget.cardMedel,));
Get.to(OutdoorNotpassPage(
model: widget.cardMedel,
));
},
child: Container(
width: 304.w,
@ -197,7 +199,9 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
Spacer(),
AkuMaterialButton(
onPressed: () {
Get.to(OutdoorPassPage( model: widget.cardMedel,));
Get.to(OutdoorPassPage(
model: widget.cardMedel,
));
},
radius: 4.w,
color: Color(0xFFFFC40C),
@ -269,7 +273,6 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
);
break;
case OUTDOORSTATUS.REJECTED:
return Container(
height: 226.w,
color: Color(0xFFFFFFFF),

@ -14,19 +14,22 @@ class ItemsOutdoorPage extends StatefulWidget {
_ItemsOutdoorPageState createState() => _ItemsOutdoorPageState();
}
class _ItemsOutdoorPageState extends State<ItemsOutdoorPage> with TickerProviderStateMixin {
class _ItemsOutdoorPageState extends State<ItemsOutdoorPage>
with TickerProviderStateMixin {
List<String> _tabs = ['待出户', '已出户', '已驳回', '已作废', '全部'];
TabController _tabController;
@override
void initState() {
super.initState();
_tabController=TabController(length: _tabs.length, vsync: this);
_tabController = TabController(length: _tabs.length, vsync: this);
}
@override
void dispose() {
_tabController?.dispose();
super.dispose();
}
@override
void dispose() {
_tabController?.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return AkuScaffold(
@ -36,16 +39,24 @@ void dispose() {
child: AkuTabBar(controller: _tabController, tabs: _tabs),
),
body: TabBarView(
controller: _tabController,
children: _tabs.map((e) => _buildListView(_tabs.indexOf(e))).toList()),
controller: _tabController,
children:
_tabs.map((e) => _buildListView(_tabs.indexOf(e))).toList()),
);
}
Widget _buildListView(int index){
final _outdoorModels=Provider.of<OutdoorProvider>(context);
List<ItemsOutdoorModel> _selectModels = _outdoorModels.getOutdoorModels(index);
Widget _buildListView(int index) {
final _outdoorModels = Provider.of<OutdoorProvider>(context);
List<ItemsOutdoorModel> _selectModels =
_outdoorModels.getOutdoorModels(index);
return ListView(
padding: EdgeInsets.only(left: 32.w,right: 32.w),
children: _selectModels.map((e) => ItemsOutdoorCard(cardModel:e,isdetail: false,)).toList(),
padding: EdgeInsets.only(left: 32.w, right: 32.w),
children: _selectModels
.map((e) => ItemsOutdoorCard(
cardModel: e,
isdetail: false,
))
.toList(),
);
}
}

@ -14,7 +14,7 @@ import 'package:provider/provider.dart';
class OutdoorPassPage extends StatefulWidget {
final ItemsOutdoorModel model;
OutdoorPassPage({Key key,@required this.model}) : super(key: key);
OutdoorPassPage({Key key, @required this.model}) : super(key: key);
@override
_OutdoorPassPageState createState() => _OutdoorPassPageState();
@ -109,16 +109,18 @@ class _OutdoorPassPageState extends State<OutdoorPassPage> {
],
),
bottom: AkuButton(
onPressed:_textController.text==null?(){
BotToast.showText(text: '出口不能为空!');
}: () {
widget.model.finalOutTime=_currentTime;
widget.model.outPlace=_textController.text;
widget.model.datetime=DateTime.now();
widget.model.status=OUTDOORSTATUS.OUT_DONE;
Get.back();
Get.back();
},
onPressed: _textController.text == null
? () {
BotToast.showText(text: '出口不能为空!');
}
: () {
widget.model.finalOutTime = _currentTime;
widget.model.outPlace = _textController.text;
widget.model.datetime = DateTime.now();
widget.model.status = OUTDOORSTATUS.OUT_DONE;
Get.back();
Get.back();
},
child: Container(
color: Color(0xFFFFC40C),
height: 98.w,

@ -111,11 +111,15 @@ class _VisitorManagerCardState extends State<VisitorManagerCard> {
],
),
Positioned(
left: 552.w-24.w,
bottom: 75.w-28.w,
left: 552.w - 24.w,
bottom: 75.w - 28.w,
child: Transform.rotate(
angle: pi / 4,
child: Image.asset(_statusImage(_status),width: 140.w,height: 140.w,),
child: Image.asset(
_statusImage(_status),
width: 140.w,
height: 140.w,
),
),
),
],

@ -17,8 +17,8 @@ class VisitorCardsModel {
String plate;
String time;
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 {
@ -35,14 +35,16 @@ class _VisitorManagerPageState extends State<VisitorManagerPage>
List<VisitorCardsModel> _cards = [
VisitorCardsModel(
adress:'深圳华悦茂峰1幢1单元702',
name:'马泽城',
status:VisitorStatus.VISIT_DONE,
adress: '深圳华悦茂峰1幢1单元702',
name: '马泽城',
status: VisitorStatus.VISIT_DONE,
plate: '浙BA9899',
time: '2020-10-24 12:00',
),
VisitorCardsModel(adress:'深圳华悦茂峰2幢2单元702',name:'刘揪心',status: VisitorStatus.NOT_VISIT),
VisitorCardsModel(adress:'深圳华悦茂峰3幢3单元602', name:'张空间', status:VisitorStatus.OUTDATE),
VisitorCardsModel(
adress: '深圳华悦茂峰2幢2单元702', name: '刘揪心', status: VisitorStatus.NOT_VISIT),
VisitorCardsModel(
adress: '深圳华悦茂峰3幢3单元602', name: '张空间', status: VisitorStatus.OUTDATE),
];
TabController _tabController;

@ -27,7 +27,7 @@ class _AkuRadioState extends State<AkuRadio> {
width: widget.size,
height: widget.size,
decoration: BoxDecoration(
border: Border.all(color: Color(0xFFE8E8E8),width: 2.w),
border: Border.all(color: Color(0xFFE8E8E8), width: 2.w),
borderRadius: BorderRadius.circular(widget.size / 2),
gradient: LinearGradient(
begin: Alignment.topLeft,

@ -11,8 +11,6 @@ import 'package:dio/dio.dart';
import 'package:get/get.dart' hide Response, FormData, MultipartFile;
import 'package:power_logger/power_logger.dart';
class NetUtil {
Dio _dio;
static final NetUtil _netUtil = NetUtil._internal();

Loading…
Cancel
Save