remove sh*t code.

hmxc
小赖 4 years ago
parent 010011b32b
commit 56fb7ef49b

@ -1,4 +1,9 @@
// Flutter imports:
import 'package:akuCommunity/pages/address_page/address_page.dart';
import 'package:akuCommunity/pages/mine_car_page/mine_car_page.dart';
import 'package:akuCommunity/pages/mine_house_page/mine_house_page.dart';
import 'package:akuCommunity/pages/setting_page/settings_page.dart';
import 'package:akuCommunity/ui/community/activity/activity_list_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
@ -72,6 +77,19 @@ List<AO> appObjects = [
AO('一键报警', R.ASSETS_APPLICATIONS_POLICE_PNG, AlarmPage()),
];
List<AO> userAppObjects = [
AO('我的房屋', R.ASSETS_ICONS_USER_ICON_WDFW_PNG, MineHousePage()),
AO('我的车位', R.ASSETS_ICONS_USER_ICON_WDCW_PNG, MineCarPage()),
AO('我的车', R.ASSETS_ICONS_USER_ICON_WDC_PNG, MineCarPage()),
AO('社区活动', R.ASSETS_ICONS_USER_ICON_WDSQHD_PNG, ActivityListPage()),
AO('我的缴费', R.ASSETS_ICONS_USER_ICON_WDJF_PNG, LifePayPage()),
AO('我的保修', R.ASSETS_ICONS_USER_ICON_WDBX_PNG, FixedSubmitPage()),
AO('我的地址', R.ASSETS_ICONS_USER_ICON_WDDZ_PNG, AddressPage()),
AO('我的管家', R.ASSETS_ICONS_USER_ICON_WDGJ_PNG, Scaffold()),
AO('我的访客', R.ASSETS_ICONS_USER_ICON_WDFK_PNG, VisitorAccessPage()),
AO('设置', R.ASSETS_ICONS_USER_ICON_SZ_PNG, SettingsPage()),
];
///
AO allApp = AO('全部应用', R.ASSETS_APPLICATIONS_ALL_APP_PNG, AllApplicationPage());

@ -1,391 +0,0 @@
// Flutter imports:
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_html/flutter_html.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:get/get.dart';
import 'package:image_stack/image_stack.dart';
// Project imports:
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/pages/activities_page/member_list_page/member_list_page.dart';
import 'package:akuCommunity/routers/page_routers.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:akuCommunity/widget/bottom_button.dart';
import 'package:akuCommunity/widget/cached_image_wrapper.dart';
//TODO CLEAN BOTTOM CODES.
@Deprecated("sh*t activities_details_page need to be cleaned.")
class ActivitiesDetailsPage extends StatefulWidget {
final Bundle bundle;
ActivitiesDetailsPage({Key key, this.bundle}) : super(key: key);
@override
_ActivitiesDetailsPageState createState() => _ActivitiesDetailsPageState();
}
const htmlData = '''
<p>
<br /><br /><br />
<br />
<br />
绿<br /><br /><br />
<br />
<br />
<br />
<br />
<br />
627<br />
<br />
</p>
''';
const htmlData1 = '''
<p>
<br />
姿<br /><br />
&nbsp;&nbsp;&nbsp;2020041212:00<br /><br />
&nbsp;&nbsp;&nbsp;2020041512:00<br /><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><br />
&nbsp;&nbsp;&nbsp;<br /><br />
&nbsp;&nbsp;&nbsp;20200413 12:00<br /><br />
</p>
''';
class _ActivitiesDetailsPageState extends State<ActivitiesDetailsPage> {
List<Map<String, dynamic>> _listView = [
{
'imagePath':
'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600062939837&di=30a87dadf9bf465757d70928760f5bb6&imgtype=0&src=http%3A%2F%2Fwww.360changshi.com%2Fuploadfile%2F2015%2F0821%2F20150821020210299.jpg',
'post': '西区绿化保卫员',
'name': '马泽鹏',
'isCheck': true,
},
{
'imagePath':
'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2079977064,85120418&fm=26&gp=0.jpg',
'post': '东区绿化保卫员',
'name': '王珂',
'isCheck': false,
},
{
'imagePath':
'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1380335538,732392216&fm=26&gp=0.jpg',
'post': '中央园区绿化保卫员',
'name': '周玲慧',
'isCheck': false,
},
{
'imagePath':
'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600063061495&di=ad1a8818ba152ca1079ea761a34ec073&imgtype=0&src=http%3A%2F%2Fimg1.a.maoyia.com%2F201806%2F22%2F08%2F08-21-45-11-1441452.jpg',
'post': '南区绿化保卫员',
'name': '叶一样',
'isCheck': false,
}
];
void _showDialog(String url) {
showCupertinoDialog(
context: context,
builder: (context) {
return CupertinoAlertDialog(
title: Text(
'是否确定投$url\一票',
style: TextStyle(
fontSize: 34.sp,
color: Color(0xff030303),
),
),
actions: <Widget>[
CupertinoDialogAction(
child: Text(
'取消',
style: TextStyle(
fontSize: 34.sp,
color: Color(0xff333333),
),
),
onPressed: () {
Get.back();
},
),
CupertinoDialogAction(
child: Text(
'确定',
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 34.sp,
color: Color(0xffff8200),
),
),
onPressed: () {
Get.back();
},
),
],
);
},
);
}
Widget _inkWellVoteCard(
String imagePath, post, name, int index, bool isOver) {
return InkWell(
onTap: isOver
? null
: () {
_listView.forEach((item) {
item['isCheck'] = false;
});
_listView[index]['isCheck'] = true;
_showDialog(_listView[index]['name']);
setState(() {});
},
child: Container(
margin: EdgeInsets.only(top: 39.w),
padding: EdgeInsets.only(left: 41.w, bottom: 40.w),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(color: BaseStyle.colord8d8d8, width: 0.5),
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: 150.w,
alignment: Alignment.center,
child: Icon(
isOver
? Icons.radio_button_checked
: _listView[index]['isCheck']
? Icons.check_circle
: Icons.radio_button_unchecked,
color: isOver
? BaseStyle.color979797
: _listView[index]['isCheck']
? Colors.red
: BaseStyle.color979797,
size: 36.w,
),
),
Container(
margin: EdgeInsets.only(
left: 17.w,
right: 30.w,
),
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(4)),
child: CachedImageWrapper(
url: imagePath,
width: 150.w,
height: 150.w,
),
),
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
post,
style: TextStyle(
fontSize: BaseStyle.fontSize32,
color: ktextPrimary,
),
),
SizedBox(height: 10.w),
Text(
name,
style: TextStyle(
fontSize: BaseStyle.fontSize32,
color: ktextPrimary,
),
),
],
),
],
),
),
);
}
Widget _inkWellEnterMember(List<String> memberList) {
return InkWell(
onTap: () {
MemberListPage().to();
},
child: Container(
padding: EdgeInsets.only(bottom: 24.w),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(color: BaseStyle.coloreeeeee, width: 0.5)),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
margin: EdgeInsets.only(left: 80.w),
child: ImageStack(
imageList: memberList,
imageRadius: 44.sp,
imageCount: 3,
imageBorderWidth: 1,
totalCount: 3,
),
),
Row(
children: [
Container(
margin: EdgeInsets.only(right: 16.w),
child: Text(
'已有${320}人参加',
style: TextStyle(
fontSize: BaseStyle.fontSize28, color: ktextPrimary),
),
),
Icon(
AntDesign.right,
size: 36.sp,
color: BaseStyle.color999999,
),
],
),
],
),
),
);
}
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '活动详情',
body: Stack(
children: [
Container(
color: Colors.white,
child: ListView(
padding: EdgeInsets.only(
bottom:
(widget.bundle.getMap('details')['isVote'] ? 0 : 170).w),
children: [
Container(
padding: EdgeInsets.only(
top: 26.w, left: 32.w, right: 32.w, bottom: 60.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget.bundle.getMap('details')['title'],
style: TextStyle(
fontSize: BaseStyle.fontSize32,
color: ktextPrimary,
fontWeight: FontWeight.w600),
),
Container(
margin: EdgeInsets.only(top: 45.w),
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(6)),
child: CachedImageWrapper(
url: widget.bundle.getMap('details')['imagePath'],
width: 686.w,
height: 228.w,
),
),
),
Container(
margin: EdgeInsets.only(top: 44.w),
width: 647.w,
child: Html(
data: widget.bundle.getMap('details')['isVote']
? htmlData
: htmlData1),
),
],
),
),
widget.bundle.getMap('details')['isVote']
? SizedBox()
: SizedBox(
height: 24.w,
child: Container(color: BaseStyle.colorf9f9f9),
),
Container(
padding: EdgeInsets.only(
top: 26.w, left: 32.w, right: 32.w, bottom: 60.w),
child: widget.bundle.getMap('details')['isVote']
? Container(
margin: EdgeInsets.only(top: 44.w),
padding: EdgeInsets.only(
top: 50.w, left: 32.w, right: 25.w),
width: 686.w,
decoration: BoxDecoration(
color: BaseStyle.colorf3f3f3,
borderRadius: BorderRadius.all(Radius.circular(6)),
border: Border.all(
color: BaseStyle.colorfafafa, width: 0.5),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'选出你心中乘风破浪的园区保卫员',
style: TextStyle(
fontSize: BaseStyle.fontSize32,
color: BaseStyle.color999999),
),
Container(
padding: EdgeInsets.only(left: 3.w),
child: Column(
children: _listView
.asMap()
.keys
.map((index) => _inkWellVoteCard(
_listView[index]['imagePath'],
_listView[index]['post'],
_listView[index]['name'],
index,
widget.bundle
.getMap('details')['isOver'],
))
.toList(),
),
),
],
))
: _inkWellEnterMember(
widget.bundle.getMap('details')['memberList']),
),
],
),
),
widget.bundle.getMap('details')['isVote']
? SizedBox()
: Positioned(
bottom: 0,
child: BottomButton(
title: widget.bundle.getMap('details')['isOver']
? '该活动已结束'
: '我要报名',
fun: widget.bundle.getMap('details')['isOver']
? null
: () {},
),
),
],
),
);
}
}

@ -1,99 +0,0 @@
// Flutter imports:
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:get/get.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
// Project imports:
import 'package:akuCommunity/widget/activity_card.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
//TODO CLEAN BOTTOM CODES.
@Deprecated("sh*t activities_page need to be cleaned.")
class ActivitiesPage extends StatefulWidget {
ActivitiesPage({Key key}) : super(key: key);
@override
_ActivitiesPageState createState() => _ActivitiesPageState();
}
class _ActivitiesPageState extends State<ActivitiesPage> {
List<String> images = [];
List<Map<String, dynamic>> _listView = [];
List<Map<String, dynamic>> _listVote = [];
List<Map<String, dynamic>> _listEnter = [];
RefreshController _refreshController =
RefreshController(initialRefresh: false);
@override
void initState() {
super.initState();
_listView = _listVote;
}
void _onRefresh() async {
await Future.delayed(Duration(milliseconds: 1500));
_refreshController.refreshCompleted();
}
void _onLoading() async {
await Future.delayed(Duration(milliseconds: 1500));
if (mounted) setState(() {});
_refreshController.loadComplete();
}
void detailsRouter(String imagePath, title, bool isOver, isVote, isVoteOver,
List<String> memberList) {
Get.to(ActivitiesPage());
}
@override
void dispose() {
super.dispose();
_refreshController.dispose();
}
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '社区活动',
body: RefreshConfiguration(
hideFooterWhenNotFull: true,
child: SmartRefresher(
controller: _refreshController,
header: WaterDropHeader(),
footer: ClassicFooter(),
onRefresh: _onRefresh,
onLoading: _onLoading,
enablePullUp: true,
child: CustomScrollView(
slivers: [
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) => ActivityCard(
imagePath: _listView[index]['imagePath'],
title: _listView[index]['title'],
subtitleFirst: _listView[index]['subtitleFirst'],
subtitleSecond: _listView[index]['subtitleSecond'],
memberList: images,
isOver: _listView[index]['isOver'],
isVote: false,
isVoteOver: _listView[index]['isVoteOver'],
fun: detailsRouter,
),
childCount: _listView.length,
),
),
],
),
),
),
);
}
}

@ -1,190 +0,0 @@
// Flutter imports:
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:pull_to_refresh/pull_to_refresh.dart';
// Project imports:
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:akuCommunity/widget/cached_image_wrapper.dart';
class MemberListPage extends StatefulWidget {
MemberListPage({Key key}) : super(key: key);
@override
_MemberListPageState createState() => _MemberListPageState();
}
class _MemberListPageState extends State<MemberListPage> {
List<Map<String, dynamic>> _listMemberList = [
{
'imagePath':
'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=251289958,1860898046&fm=26&gp=0.jpg',
'name': '马泽鹏',
'phone': '18844441879'
},
{
'imagePath':
'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600336261085&di=ecdf0b044d86d52173b57f7ed01f3a9b&imgtype=0&src=http%3A%2F%2Fcdn.duitang.com%2Fuploads%2Fitem%2F201408%2F30%2F20140830180834_XuWYJ.png',
'name': '王珂',
'phone': '13844441179'
},
{
'imagePath':
'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600336261085&di=0961159907966a47dfb3e1b5d82fa1d3&imgtype=0&src=http%3A%2F%2Fn.sinaimg.cn%2Fsinacn19%2F0%2Fw400h400%2F20180910%2F3391-hiycyfw5413589.jpg',
'name': '叶一样',
'phone': '13944443278'
},
{
'imagePath':
'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600336261084&di=59a60839cdf3621cf48a7e5b41aabaa4&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201703%2F31%2F20170331090953_zUcaS.jpeg',
'name': '周玲慧',
'phone': '15844441899'
},
{
'imagePath':
'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600336261083&di=53b0dead3e405ce275906ab94c86bde6&imgtype=0&src=http%3A%2F%2F5b0988e595225.cdn.sohucs.com%2Fq_70%2Cc_zoom%2Cw_640%2Fimages%2F20190129%2F8478c326fa174158859b9ac093e36938.jpeg',
'name': '马成泽',
'phone': '13844444979'
},
{
'imagePath':
'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600336261083&di=690a867c66de6517e04d51d7df8fc0ff&imgtype=0&src=http%3A%2F%2Fpic2.zhimg.com%2F50%2Fv2-dabd289dd21a5cf4967cb9b710cee36f_hd.jpg',
'name': '王珂珂',
'phone': '18844441879'
},
{
'imagePath':
'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600336261082&di=a4ad6bab4fd4fdd736a9d4bab76d0bce&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201706%2F10%2F20170610192627_yhAMN.thumb.700_0.jpeg',
'name': '王章程',
'phone': '18844441879'
},
{
'imagePath':
'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600336261079&di=34d4969e9e657de267a6df0bd60eb40c&imgtype=0&src=http%3A%2F%2Fimgsrc.baidu.com%2Fforum%2Fw%3D580%2Fsign%3D09b795cc9e2f07085f052a08d925b865%2F75dffbf2b21193133e1f783365380cd790238d75.jpg',
'name': '刘佳佳',
'phone': '15844448879'
},
{
'imagePath':
'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600336261078&di=76d0e5d8b4ad47d066a29803dfa4c175&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201902%2F17%2F20190217231515_ixMhS.thumb.700_0.jpeg',
'name': '周建',
'phone': '13844441879'
},
{
'imagePath':
'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600336548534&di=eba96a077b96eac039d136587c5bb908&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201712%2F19%2F20171219234358_VRdrH.thumb.700_0.jpeg',
'name': '静静',
'phone': '16644441879'
},
];
RefreshController _refreshController =
RefreshController(initialRefresh: false);
@override
void initState() {
super.initState();
}
void _onRefresh() async {
await Future.delayed(Duration(milliseconds: 1500));
_refreshController.refreshCompleted();
}
void _onLoading() async {
await Future.delayed(Duration(milliseconds: 1500));
if (mounted) setState(() {});
_refreshController.loadComplete();
}
Container _memberCard(String imagePath, name, phone) {
return Container(
padding: EdgeInsets.only(
top: 18.w,
bottom: 18.w,
left: 20.w,
right: 10.w,
),
margin: EdgeInsets.symmetric(horizontal: 32.w),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(color: BaseStyle.coloreeeeee, width: 0.5)),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Container(
margin: EdgeInsets.only(right: 18.w),
child: ClipOval(
child: CachedImageWrapper(
url: imagePath,
width: 60.w,
height: 60.w,
),
),
),
Text(
name,
style: TextStyle(
fontSize: BaseStyle.fontSize28,
color: ktextPrimary,
),
),
],
),
Text(
phone.replaceAllMapped(new RegExp(r'(\d{3})\d{4}(\d+)'),
(Match m) => "${m[1]}****${m[2]}"),
style: TextStyle(
fontSize: BaseStyle.fontSize28,
color: ktextPrimary,
),
),
],
),
);
}
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '参与人员',
body: Container(
color: Colors.white,
child: RefreshConfiguration(
hideFooterWhenNotFull: true,
child: SmartRefresher(
controller: _refreshController,
header: WaterDropHeader(),
footer: ClassicFooter(),
onRefresh: _onRefresh,
onLoading: _onLoading,
enablePullUp: true,
child: CustomScrollView(
slivers: [
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) => _memberCard(
_listMemberList[index]['imagePath'],
_listMemberList[index]['name'],
_listMemberList[index]['phone'],
),
childCount: _listMemberList.length,
),
),
],
),
),
),
),
);
}
}

@ -6,13 +6,11 @@ import 'package:flutter/material.dart';
import 'package:akuCommunity/base/assets_image.dart';
import 'package:akuCommunity/pages/mine_car_page/car_add_page/car_add_page.dart';
import 'package:akuCommunity/pages/mine_car_page/select_community_page/select_community_page.dart';
import 'package:akuCommunity/routers/page_routers.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
class MineCarPage extends StatefulWidget {
final Bundle bundle;
MineCarPage({Key key, this.bundle}) : super(key: key);
MineCarPage({Key key}) : super(key: key);
@override
_MineCarPageState createState() => _MineCarPageState();
@ -148,7 +146,6 @@ class _MineCarPageState extends State<MineCarPage> {
),
),
SizedBox(height: 39.w),
_inkWellCheck(widget.bundle.getMap('carType')['type']),
],
),
);
@ -157,7 +154,7 @@ class _MineCarPageState extends State<MineCarPage> {
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '我的${widget.bundle.getMap('carType')['type']}',
title: '我的',
body: Container(
color: Colors.white,
child: Stack(
@ -176,19 +173,6 @@ class _MineCarPageState extends State<MineCarPage> {
))
.toList(),
),
// Container(
// margin: EdgeInsets.only(top: 64.w),
// child: Column(
// children: _listCart
// .map((item) => _containerInfoCard(
// item['title'],
// item['isDelete'],
// ))
// .toList(),
// ),
// ),
_containerAttestation(
widget.bundle.getMap('carType')['type']),
],
),
),

@ -1,11 +1,12 @@
// Flutter imports:
import 'package:akuCommunity/constants/application_objects.dart';
import 'package:akuCommunity/widget/views/application_view.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_icons/flutter_icons.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
// Project imports:
@ -13,22 +14,12 @@ import 'package:akuCommunity/base/assets_image.dart';
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/const/resource.dart';
import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/pages/activities_page/activities_page.dart';
import 'package:akuCommunity/pages/address_page/address_page.dart';
import 'package:akuCommunity/pages/life_pay/life_pay_page.dart';
import 'package:akuCommunity/pages/mine_car_page/mine_car_page.dart';
import 'package:akuCommunity/pages/mine_house_page/mine_house_page.dart';
import 'package:akuCommunity/pages/personal/order_page.dart';
import 'package:akuCommunity/pages/personal/user_profile_page.dart';
import 'package:akuCommunity/pages/setting_page/settings_page.dart';
import 'package:akuCommunity/pages/sign/sign_in_page.dart';
import 'package:akuCommunity/pages/things_page/fixed_submit_page.dart';
import 'package:akuCommunity/pages/visitor_access_page/visitor_access_page.dart';
import 'package:akuCommunity/painters/user_bottom_bar_painter.dart';
import 'package:akuCommunity/provider/user_provider.dart';
import 'package:akuCommunity/routers/page_routers.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/grid_buttons.dart';
class PersonalIndex extends StatefulWidget {
final bool isSign;
@ -40,54 +31,6 @@ class PersonalIndex extends StatefulWidget {
class _PersonalIndexState extends State<PersonalIndex>
with SingleTickerProviderStateMixin {
List<GridButton> _manageGridList = [
GridButton('我的房屋', R.ASSETS_ICONS_USER_ICON_WDFW_PNG, () {
MineHousePage().to();
}),
GridButton('我的车位', R.ASSETS_ICONS_USER_ICON_WDCW_PNG, () {
Get.to(MineCarPage(
bundle: Bundle()..putMap('carType', {'type': '车位'}),
));
}),
GridButton('我的车', R.ASSETS_ICONS_USER_ICON_WDC_PNG, () {
Get.to(MineCarPage(
bundle: Bundle()..putMap('carType', {'type': ''}),
));
}),
GridButton('社区活动', R.ASSETS_ICONS_USER_ICON_WDSQHD_PNG, () {
Get.to(ActivitiesPage());
}),
GridButton('我的缴费', R.ASSETS_ICONS_USER_ICON_WDJF_PNG, () {
LifePayPage().to();
}),
GridButton('我的保修', R.ASSETS_ICONS_USER_ICON_WDBX_PNG, () {
FixedSubmitPage().to();
}),
GridButton('我的地址', R.ASSETS_ICONS_USER_ICON_WDDZ_PNG, () {
AddressPage().to();
}),
GridButton('我的管家', R.ASSETS_ICONS_USER_ICON_WDGJ_PNG, () {}),
GridButton('我的访客', R.ASSETS_ICONS_USER_ICON_WDFK_PNG, () {
VisitorAccessPage().to();
}),
GridButton('设置', R.ASSETS_ICONS_USER_ICON_SZ_PNG, () {
SettingsPage().to();
}),
];
// List<GridButton> _orderList = [
// GridButton('待付款', R.ASSETS_ICONS_USER_ICON_DFK_PNG, () {}),
// GridButton('待发货', R.ASSETS_ICONS_USER_ICON_DFH_PNG, () {}),
// GridButton('待收货', R.ASSETS_ICONS_USER_ICON_DSH_PNG, () {}),
// GridButton('待评价', R.ASSETS_ICONS_USER_ICON_DPJ_PNG, () {}),
// GridButton('售后', R.ASSETS_ICONS_USER_ICON_SH_PNG, () {}),
// ];
// List<GridButton> _groupOrderList = [
// GridButton('待发货', R.ASSETS_ICONS_USER_ICON_DFH_PNG, () {}),
// GridButton('待收货', R.ASSETS_ICONS_USER_ICON_DSH_PNG, () {}),
// ];
SliverAppBar _sliverAppBar(double height) {
final userProvider = Provider.of<UserProvider>(context);
return SliverAppBar(
@ -313,9 +256,9 @@ class _PersonalIndexState extends State<PersonalIndex>
mainAxisAlignment: MainAxisAlignment.center,
children: [
_containerBar('我的物业'),
GridButtons(
gridList: _manageGridList,
crossCount: 4,
ApplicationView.custom(
items: userAppObjects,
needAllApp: false,
),
],
),

@ -1,65 +0,0 @@
// Flutter imports:
import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_screenutil/flutter_screenutil.dart';
//TODO CLEAN BOTTOM CODES.
@Deprecated("sh*t grid_buttons need to be cleaned.")
class GridButtons extends StatefulWidget {
final List<GridButton> gridList;
final int crossCount;
GridButtons({Key key, this.crossCount, this.gridList}) : super(key: key);
@override
_GridButtonsState createState() => _GridButtonsState();
}
class GridButton {
String title;
String path;
VoidCallback onTap;
GridButton(this.title, this.path, this.onTap);
}
class _GridButtonsState extends State<GridButtons> {
@override
Widget build(BuildContext context) {
return GridView.builder(
padding: EdgeInsets.zero,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: widget.gridList.length,
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: widget.gridList[index].onTap,
child: Container(
alignment: Alignment.center,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset(
widget.gridList[index].path,
height: 53.w,
width: 53.w,
fit: BoxFit.cover,
),
SizedBox(height: 5),
Text(
widget.gridList[index].title,
style: TextStyle(fontSize: 24.sp),
)
],
),
),
);
},
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: widget.crossCount,
mainAxisSpacing: 6.0,
childAspectRatio: 1.0,
),
);
}
}

@ -13,11 +13,13 @@ import 'package:akuCommunity/utils/headers.dart';
class ApplicationView extends StatefulWidget {
final List<AO> items;
ApplicationView({Key key})
final bool needAllApp;
ApplicationView({Key key, this.needAllApp = true})
: items = null,
super(key: key);
ApplicationView.custom({Key key, @required this.items})
ApplicationView.custom(
{Key key, @required this.items, this.needAllApp = true})
: assert(items != null),
super(key: key);
@ -61,10 +63,11 @@ class _ApplicationViewState extends State<ApplicationView> {
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 4),
itemBuilder: (context, index) {
if (index == _items.length) return _buildTile(allApp);
if (index == _items.length && widget.needAllApp)
return _buildTile(allApp);
return _buildTile(_items[index]);
},
itemCount: _items.length + 1,
itemCount: widget.needAllApp ? _items.length + 1 : _items.length,
shrinkWrap: true,
);
}

Loading…
Cancel
Save