remove SH*T code again.🙃

hmxc
小赖 4 years ago
parent 37a6c0d512
commit 30e2a1f760

@ -37,10 +37,8 @@ import 'package:akuCommunity/ui/manager/advice/advice_page.dart';
import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/container_comment.dart'; import 'package:akuCommunity/widget/container_comment.dart';
import 'package:akuCommunity/widget/grid_buttons.dart'; import 'package:akuCommunity/widget/grid_buttons.dart';
import 'widget/home_card.dart';
import 'widget/home_search.dart'; import 'widget/home_search.dart';
import 'widget/home_swiper.dart'; import 'widget/home_swiper.dart';
import 'widget/home_tag_bar.dart';
class HomePage extends StatefulWidget { class HomePage extends StatefulWidget {
HomePage({Key key}) : super(key: key); HomePage({Key key}) : super(key: key);

@ -1,83 +0,0 @@
// Flutter imports:
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_icons/flutter_icons.dart';
// Project imports:
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/app_bar_action.dart';
class HomeAppBar extends StatefulWidget {
HomeAppBar({Key key}) : super(key: key);
@override
_HomeAppBarState createState() => _HomeAppBarState();
}
class _HomeAppBarState extends State<HomeAppBar> {
List<Map<String, dynamic>> _actionsList = [
{'title': '扫一扫', 'icon': AntDesign.scan1, 'funtion': null},
{'title': '消息', 'icon': AntDesign.bells, 'funtion': null}
];
List<Widget> _actions() {
return _actionsList
.map((item) => AppBarAction(
title: item['title'],
icon: item['icon'],
))
.toList();
}
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [Color(0xffffd000), Color(0xffffbd00)],
),
),
child: AppBar(
elevation: 0,
title: Text(
'皇冠花园二期',
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 36.sp,
color: Color(0xff333333),
),
),
centerTitle: true,
backgroundColor: Colors.transparent,
leading: Container(
margin: EdgeInsets.only(left: 32.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'深圳',
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 24.sp,
color: Color(0xff333333),
),
),
Text(
'阴 27℃',
style: TextStyle(
fontSize: 20.sp,
color: Color(0xff333333),
),
)
]),
),
actions: _actions(),
),
);
}
}

@ -1,231 +0,0 @@
// Dart imports:
import 'dart:convert';
// Flutter imports:
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:image_stack/image_stack.dart';
// Project imports:
import 'package:akuCommunity/pages/activities_page/activities_details_page/activities_details_page.dart';
import 'package:akuCommunity/pages/goods_details/goods_details_page.dart';
import 'package:akuCommunity/routers/page_routers.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/cached_image_wrapper.dart';
//TODO CLEAN BOTTOM CODES.
@Deprecated("sh*t home_card need to be cleaned.")
class HomeCard extends StatefulWidget {
final String title;
final String subtitleOne;
final String subtitleTwo;
final bool isActivity;
final String imagePath;
HomeCard(
{this.title,
this.subtitleOne,
this.subtitleTwo,
this.imagePath,
this.isActivity,
Key key})
: super(key: key);
@override
_HomeCardState createState() => _HomeCardState();
}
class _HomeCardState extends State<HomeCard> {
List<String> images = [
"https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1151143562,4115642159&fm=26&gp=0.jpg",
"https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=2551412680,857245643&fm=26&gp=0.jpg",
"https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3604827221,1047385274&fm=26&gp=0.jpg",
];
Widget _button(String buttonName) {
return InkWell(
onTap: () {
switch (widget.isActivity) {
case true:
ActivitiesDetailsPage(
bundle: Bundle()
..putMap('details', {
'title': widget.title,
'imagePath': widget.imagePath,
'isOver': false,
'isVoteOver': false,
'isVote': false,
'memberList': images
}),
).to;
break;
case false:
var shopInfo;
shopInfo = {
'itemid': '1',
'itemtitle': widget.title,
'taobao_image': "${widget.imagePath},${widget.imagePath}",
'itemprice': '69.9',
'itemshorttitle': widget.title,
'itempic_copy': widget.imagePath,
'itemdesc': widget.title,
'itempic': widget.imagePath
};
GoodsDetailsPage(
bundle: Bundle()
..putString('shoplist', json.encode(shopInfo).toString()),
).to;
break;
default:
}
},
child: Container(
height: 44.w,
width: 120.w,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xffffc40c),
borderRadius: BorderRadius.all(Radius.circular(22.w)),
),
padding: EdgeInsets.symmetric(vertical: 8.w),
child: Text(
buttonName,
style: TextStyle(
fontWeight: FontWeight.w600,
color: Color(0xff4a4b51),
fontSize: 20.sp),
),
),
);
}
@override
Widget build(BuildContext context) {
return Container(
color: Colors.white,
margin: EdgeInsets.symmetric(
horizontal: 32.w,
),
padding: EdgeInsets.only(
left: 24.w,
right: 24.w,
bottom: 40.w,
),
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(8.w)),
border: Border.all(color: Color(0xffe8e8e8), width: 2.w),
),
padding: EdgeInsets.only(bottom: 24.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(
children: [
Container(
child: ClipRRect(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8.w),
topRight: Radius.circular(8.w),
),
child: CachedImageWrapper(
url: widget.imagePath,
width: 638.w,
height: 210.w,
),
),
),
],
),
Container(
margin: EdgeInsets.only(
top: 16.w,
left: 24.w,
),
child: Text(
widget.title,
style: TextStyle(
fontWeight: FontWeight.w600,
color: Color(0xff4a4b51),
fontSize: 28.sp),
),
),
Container(
margin: EdgeInsets.only(
top: 16.w,
left: 24.w,
right: 24.w,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RichText(
text: TextSpan(
style: TextStyle(fontSize: 24.sp),
children: <InlineSpan>[
TextSpan(
text: widget.isActivity ? '地点:' : '原产地区:',
style: TextStyle(color: Color(0xff999999))),
TextSpan(
text: widget.subtitleOne,
style: TextStyle(color: Color(0xff4a4b51))),
],
),
),
Container(
margin: EdgeInsets.only(top: 8.w),
child: RichText(
text: TextSpan(
style: TextStyle(fontSize: 24.sp),
children: <InlineSpan>[
TextSpan(
text: widget.isActivity ? '活动时间:' : '预计到货:',
style: TextStyle(color: Color(0xff999999))),
TextSpan(
text: widget.subtitleTwo,
style: TextStyle(color: Color(0xff4a4b51))),
],
),
),
),
],
),
widget.isActivity ? SizedBox() : _button('去团购')
],
),
),
widget.isActivity
? Container(
margin: EdgeInsets.only(
top: 16.w,
right: 24.w,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
margin: EdgeInsets.only(left: 80.w),
child: ImageStack(
imageList: images,
imageRadius: 44.sp,
imageCount: 3,
imageBorderWidth: 1,
totalCount: 3,
),
),
_button('去看看'),
],
),
)
: SizedBox(),
],
),
),
);
}
}

@ -1,113 +0,0 @@
// Flutter imports:
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_icons/flutter_icons.dart';
// Project imports:
import 'package:akuCommunity/base/assets_image.dart';
import 'package:akuCommunity/utils/headers.dart';
//TODO CLEAN BOTTOM CODES.
@Deprecated("sh*t home_tag_bar need to be cleaned.")
class HomeTagBar extends StatefulWidget {
final String title;
final String tag;
final bool isShowImage, isShowTitle;
final Function fun;
HomeTagBar(
{Key key,
this.title,
this.tag,
this.isShowImage,
this.isShowTitle = false,
this.fun})
: super(key: key);
@override
_HomeTagBarState createState() => _HomeTagBarState();
}
class _HomeTagBarState extends State<HomeTagBar> {
@override
Widget build(BuildContext context) {
return Container(
color: widget.isShowTitle ? Colors.transparent : Colors.white,
margin: EdgeInsets.symmetric(
horizontal: 32.w,
),
padding: EdgeInsets.all(24.w),
child: Stack(
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
widget.isShowImage
? Container(
margin: EdgeInsets.only(right: 24.w),
child: Image.asset(
AssetsImage.NOTIFICATION,
height: 38.w,
width: 38.w,
),
)
: SizedBox(),
Text(
widget.title,
style: TextStyle(
fontSize: widget.isShowImage ? 28.sp : 32.sp,
fontWeight: widget.isShowImage
? FontWeight.normal
: FontWeight.w600,
color: Color(0xff4a4b51)),
),
],
),
widget.isShowTitle
? SizedBox()
: InkWell(
onTap: () {
widget.fun();
},
child: Row(children: [
Text(
'更多${widget.tag}',
style: TextStyle(
color: Color(0xff999999), fontSize: 20.sp),
),
SizedBox(width: 8.w),
Icon(
AntDesign.right,
color: Color(0xff999999),
size: 20.sp,
),
]),
),
],
),
widget.isShowImage
? SizedBox()
: Positioned(
top: 30.w,
left: 0,
child: Container(
decoration: BoxDecoration(
color: Color(0xffffc40c).withOpacity(0.4),
boxShadow: <BoxShadow>[
BoxShadow(
color: Colors.grey.withOpacity(0.1),
offset: Offset(1.1, 1.1),
blurRadius: 10.0),
],
),
width: 126.w,
height: 8.w),
)
],
),
);
}
}

@ -28,9 +28,7 @@ import 'package:akuCommunity/painters/user_bottom_bar_painter.dart';
import 'package:akuCommunity/provider/user_provider.dart'; import 'package:akuCommunity/provider/user_provider.dart';
import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/routers/page_routers.dart';
import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/cached_image_wrapper.dart';
import 'package:akuCommunity/widget/grid_buttons.dart'; import 'package:akuCommunity/widget/grid_buttons.dart';
import 'package:akuCommunity/widget/single_ad_space.dart';
class PersonalIndex extends StatefulWidget { class PersonalIndex extends StatefulWidget {
final bool isSign; final bool isSign;
@ -128,8 +126,8 @@ class _PersonalIndexState extends State<PersonalIndex>
child: FadeInImage.assetNetwork( child: FadeInImage.assetNetwork(
//TODO PLACEHOLDER //TODO PLACEHOLDER
placeholder: R.ASSETS_ICONS_PROPOSAL_PNG, placeholder: R.ASSETS_ICONS_PROPOSAL_PNG,
image: API image: API.image(
.image(userProvider.userInfoModel.imgUrl), userProvider?.userInfoModel?.imgUrl ?? ''),
height: 106.w, height: 106.w,
width: 106.w, width: 106.w,
), ),

Loading…
Cancel
Save