parent
7303a1b165
commit
daee622de5
@ -1,97 +0,0 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
|
||||
import 'package:flutter_icons/flutter_icons.dart';
|
||||
import 'package:flutter_picker/flutter_picker.dart';
|
||||
|
||||
import 'package:akuCommunity/base/base_style.dart';
|
||||
import 'package:akuCommunity/utils/headers.dart';
|
||||
|
||||
class CommonSelect extends StatefulWidget {
|
||||
final String title;
|
||||
CommonSelect({Key key, this.title}) : super(key: key);
|
||||
|
||||
@override
|
||||
_CommonSelectState createState() => _CommonSelectState();
|
||||
}
|
||||
|
||||
class _CommonSelectState extends State<CommonSelect> {
|
||||
String pickerData = '请选择';
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
switch (widget.title) {
|
||||
case '时间':
|
||||
DatePicker.showDatePicker(context,
|
||||
showTitleActions: true,
|
||||
minTime: DateTime(2020, 1, 1),
|
||||
maxTime: DateTime(2020, 12, 31), onChanged: (date) {
|
||||
print('change $date in time zone ' +
|
||||
date.timeZoneOffset.inHours.toString());
|
||||
}, onConfirm: (date) {
|
||||
pickerData = date.toString().substring(0, 11);
|
||||
setState(() {});
|
||||
}, currentTime: DateTime.now(), locale: LocaleType.zh);
|
||||
break;
|
||||
case '证件类型':
|
||||
Picker(
|
||||
adapter: PickerDataAdapter<String>(
|
||||
pickerdata: [
|
||||
["身份证", "驾驶证", "护照"]
|
||||
],
|
||||
isArray: true,
|
||||
),
|
||||
changeToFirst: true,
|
||||
hideHeader: false,
|
||||
title: Text(
|
||||
"证件类型",
|
||||
style: TextStyle(
|
||||
fontSize: 32.sp,
|
||||
color: Color(0xff333333),
|
||||
),
|
||||
),
|
||||
confirmTextStyle: TextStyle(
|
||||
fontSize: 28.sp,
|
||||
color: Color(0xffffc40c),
|
||||
),
|
||||
cancelTextStyle: TextStyle(
|
||||
fontSize: 28.sp,
|
||||
color: Color(0xff333333),
|
||||
),
|
||||
onConfirm: (Picker picker, List value) {
|
||||
pickerData = picker.getSelectedValues()[0];
|
||||
setState(() {});
|
||||
print(value.toString());
|
||||
print(picker.getSelectedValues());
|
||||
}).showModal(context);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
pickerData,
|
||||
style: TextStyle(
|
||||
fontSize: BaseStyle.fontSize36,
|
||||
color: BaseStyle.color999999,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
Icon(
|
||||
AntDesign.right,
|
||||
color: BaseStyle.color999999,
|
||||
size: 32.w,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -1,113 +0,0 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_icons/flutter_icons.dart';
|
||||
import 'package:flutter_picker/flutter_picker.dart';
|
||||
|
||||
import 'package:akuCommunity/utils/headers.dart';
|
||||
import 'package:akuCommunity/widget/picker/bee_date_picker.dart';
|
||||
|
||||
@Deprecated('s**t code should be remove')
|
||||
class CommonPicker extends StatefulWidget {
|
||||
final String title;
|
||||
CommonPicker({Key key, this.title}) : super(key: key);
|
||||
|
||||
@override
|
||||
_CommonPickerState createState() => _CommonPickerState();
|
||||
}
|
||||
|
||||
class _CommonPickerState extends State<CommonPicker> {
|
||||
String pickerData = '请选择';
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
height: 96.w,
|
||||
padding: EdgeInsets.symmetric(vertical: 28.w),
|
||||
decoration: BoxDecoration(
|
||||
border:
|
||||
Border(bottom: BorderSide(color: Color(0xffeeeeee), width: 0.5)),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(right: 30.w),
|
||||
child: Text(
|
||||
widget.title,
|
||||
style: TextStyle(fontSize: 28.sp, color: Color(0xff333333)),
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
switch (widget.title) {
|
||||
case '出户时间':
|
||||
BeeDatePicker.pick(DateTime.now());
|
||||
// DatePicker.showDatePicker(context,
|
||||
// showTitleActions: true,
|
||||
// minTime: DateTime(2020, 1, 1),
|
||||
// maxTime: DateTime(2020, 12, 31), onChanged: (date) {
|
||||
// print('change $date in time zone ' +
|
||||
// date.timeZoneOffset.inHours.toString());
|
||||
// }, onConfirm: (date) {
|
||||
// pickerData = date.toString().substring(0, 11);
|
||||
// setState(() {});
|
||||
// }, currentTime: DateTime.now(), locale: LocaleType.zh);
|
||||
break;
|
||||
case '物品名称':
|
||||
Picker(
|
||||
adapter: PickerDataAdapter<String>(
|
||||
pickerdata: [
|
||||
["全部", "家纺", "家具", "电器"]
|
||||
],
|
||||
isArray: true,
|
||||
),
|
||||
changeToFirst: true,
|
||||
hideHeader: false,
|
||||
title: Text(
|
||||
"物品名称",
|
||||
style: TextStyle(
|
||||
fontSize: 32.sp,
|
||||
color: Color(0xff333333),
|
||||
),
|
||||
),
|
||||
confirmTextStyle: TextStyle(
|
||||
fontSize: 28.sp,
|
||||
color: Color(0xffffc40c),
|
||||
),
|
||||
cancelTextStyle: TextStyle(
|
||||
fontSize: 28.sp,
|
||||
color: Color(0xff333333),
|
||||
),
|
||||
onConfirm: (Picker picker, List value) {
|
||||
pickerData = picker.getSelectedValues()[0];
|
||||
setState(() {});
|
||||
print(value.toString());
|
||||
print(picker.getSelectedValues());
|
||||
}).showModal(context);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
width: 538.w,
|
||||
height: 40.w,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
pickerData,
|
||||
style: TextStyle(fontSize: 28.sp, color: Color(0xff999999)),
|
||||
),
|
||||
Icon(
|
||||
AntDesign.right,
|
||||
color: Color(0xff999999),
|
||||
size: 32.sp,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -1,185 +0,0 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:image_stack/image_stack.dart';
|
||||
|
||||
import 'package:akuCommunity/base/base_style.dart';
|
||||
import 'package:akuCommunity/utils/headers.dart';
|
||||
import 'package:akuCommunity/widget/cached_image_wrapper.dart';
|
||||
|
||||
class ActivityCard extends StatelessWidget {
|
||||
final String imagePath, title, subtitleFirst, subtitleSecond;
|
||||
final List<String> memberList;
|
||||
final bool isOver, isVote, isVoteOver;
|
||||
final Function fun;
|
||||
ActivityCard(
|
||||
{Key key,
|
||||
this.imagePath,
|
||||
this.title,
|
||||
this.subtitleFirst,
|
||||
this.subtitleSecond,
|
||||
this.memberList,
|
||||
this.isOver,
|
||||
this.isVote,
|
||||
this.isVoteOver,
|
||||
this.fun})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 20.w,
|
||||
left: 32.w,
|
||||
right: 32.w,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xffffffff),
|
||||
borderRadius: BorderRadius.all(Radius.circular(6)),
|
||||
boxShadow: <BoxShadow>[
|
||||
BoxShadow(
|
||||
color: Colors.grey.withOpacity(0.2),
|
||||
offset: Offset(1.1, 1.1),
|
||||
blurRadius: 10.0),
|
||||
],
|
||||
),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
fun(imagePath, title, isOver, isVote, isVoteOver, memberList);
|
||||
},
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(bottom: 16.w),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(6),
|
||||
topRight: Radius.circular(6),
|
||||
),
|
||||
child: CachedImageWrapper(
|
||||
url: imagePath,
|
||||
width: 686.w,
|
||||
height: 210.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 24.w),
|
||||
margin: EdgeInsets.only(bottom: 16.w),
|
||||
child: Text(
|
||||
title,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: BaseStyle.fontSize28,
|
||||
color: BaseStyle.color4a4b51),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 22.w),
|
||||
margin: EdgeInsets.only(bottom: 8.w),
|
||||
child: isVote
|
||||
? Text(
|
||||
subtitleFirst,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: BaseStyle.fontSize24,
|
||||
color: BaseStyle.color999999),
|
||||
)
|
||||
: RichText(
|
||||
text: TextSpan(children: <InlineSpan>[
|
||||
TextSpan(
|
||||
text: '地点: ',
|
||||
style: TextStyle(
|
||||
fontSize: BaseStyle.fontSize24,
|
||||
color: BaseStyle.color999999),
|
||||
),
|
||||
TextSpan(
|
||||
text: subtitleFirst,
|
||||
style: TextStyle(
|
||||
fontSize: BaseStyle.fontSize24,
|
||||
color: ktextPrimary),
|
||||
),
|
||||
]),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 22.w),
|
||||
margin: EdgeInsets.only(bottom: 16.w),
|
||||
child: RichText(
|
||||
text: TextSpan(children: <InlineSpan>[
|
||||
TextSpan(
|
||||
text: isVote ? '投票时间: ' : '报名时间: ',
|
||||
style: TextStyle(
|
||||
fontSize: BaseStyle.fontSize24,
|
||||
color: BaseStyle.color999999),
|
||||
),
|
||||
TextSpan(
|
||||
text: subtitleSecond,
|
||||
style: TextStyle(
|
||||
fontSize: BaseStyle.fontSize24, color: ktextPrimary),
|
||||
),
|
||||
]),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
left: 24.w,
|
||||
right: 20.w,
|
||||
bottom: 24.w,
|
||||
),
|
||||
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,
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
fun(imagePath, title, isOver, isVote, isVoteOver,
|
||||
memberList);
|
||||
},
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
height: 44.w,
|
||||
width: 120.w,
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 8.w,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: isOver
|
||||
? BaseStyle.colorababab
|
||||
: BaseStyle.colorffc40c,
|
||||
borderRadius: BorderRadius.all(Radius.circular(22)),
|
||||
),
|
||||
child: Text(
|
||||
isOver
|
||||
? '已结束'
|
||||
: isVote
|
||||
? '去投票'
|
||||
: '去参与',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: BaseStyle.fontSize22,
|
||||
color: BaseStyle.color4a4b51),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -1,199 +0,0 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:image_stack/image_stack.dart';
|
||||
|
||||
import 'package:akuCommunity/base/base_style.dart';
|
||||
import 'package:akuCommunity/utils/headers.dart';
|
||||
import 'package:akuCommunity/widget/cached_image_wrapper.dart';
|
||||
|
||||
class CommunityCard extends StatefulWidget {
|
||||
final String imagePath, title, subtitle, timeZone;
|
||||
final List<String> headList;
|
||||
final bool isOver;
|
||||
final int peopleNum;
|
||||
final Function fun;
|
||||
CommunityCard(
|
||||
{Key key,
|
||||
this.imagePath,
|
||||
this.title,
|
||||
this.subtitle,
|
||||
this.timeZone,
|
||||
this.headList,
|
||||
this.isOver,
|
||||
this.peopleNum,
|
||||
this.fun})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_CommunityCardState createState() => _CommunityCardState();
|
||||
}
|
||||
|
||||
class _CommunityCardState extends State<CommunityCard> {
|
||||
Container _cardHeader(String imagePath, title, subtitle, timeZone) {
|
||||
return Container(
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(bottom: 16.w),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.all(Radius.circular(6)),
|
||||
child: CachedImageWrapper(
|
||||
url: imagePath,
|
||||
width: 160.w,
|
||||
height: 120.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 20.w),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: 480.w,
|
||||
margin: EdgeInsets.only(bottom: 6.w),
|
||||
child: Text(
|
||||
title,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
style: TextStyle(
|
||||
fontSize: BaseStyle.fontSize28,
|
||||
color: BaseStyle.color4a4b51),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 480.w,
|
||||
margin: EdgeInsets.only(bottom: 8.w),
|
||||
child: Text(
|
||||
subtitle,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
style: TextStyle(
|
||||
fontSize: BaseStyle.fontSize24,
|
||||
color: BaseStyle.color999999),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 480.w,
|
||||
child: RichText(
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
text: TextSpan(children: <InlineSpan>[
|
||||
TextSpan(
|
||||
text: '参与时间: ',
|
||||
style: TextStyle(
|
||||
fontSize: BaseStyle.fontSize24,
|
||||
color: BaseStyle.color999999),
|
||||
),
|
||||
TextSpan(
|
||||
text: timeZone,
|
||||
style: TextStyle(
|
||||
fontSize: BaseStyle.fontSize24,
|
||||
color: BaseStyle.color4a4b51),
|
||||
),
|
||||
]),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Container _cardFooter(String imagePath, title, List<String> headList,
|
||||
bool isOver, int peopleNum, Function fun) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 40.w),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 80.w),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(right: 26.w),
|
||||
child: ImageStack(
|
||||
imageList: headList,
|
||||
imageRadius: 44.sp,
|
||||
imageCount: 3,
|
||||
imageBorderWidth: 1,
|
||||
totalCount: 3,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'$peopleNum人已参加',
|
||||
style: TextStyle(
|
||||
fontSize: BaseStyle.fontSize22, color: ktextPrimary),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
fun(imagePath, title);
|
||||
},
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
height: 44.w,
|
||||
width: 120.w,
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 7.w,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: isOver ? BaseStyle.colorababab : BaseStyle.colorffc40c,
|
||||
borderRadius: BorderRadius.all(Radius.circular(22)),
|
||||
),
|
||||
child: Text(
|
||||
isOver ? '已结束' : '去参与',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: BaseStyle.fontSize22,
|
||||
color: BaseStyle.color4a4b51),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
color: Colors.white,
|
||||
margin: EdgeInsets.only(
|
||||
top: 24.w,
|
||||
left: 32.w,
|
||||
right: 32.w,
|
||||
),
|
||||
padding: EdgeInsets.only(
|
||||
top: 12.w,
|
||||
left: 10.w,
|
||||
right: 16.w,
|
||||
bottom: 20.w,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
_cardHeader(
|
||||
widget.imagePath,
|
||||
widget.title,
|
||||
widget.subtitle,
|
||||
widget.timeZone,
|
||||
),
|
||||
_cardFooter(
|
||||
widget.imagePath,
|
||||
widget.title,
|
||||
widget.headList,
|
||||
widget.isOver,
|
||||
widget.peopleNum,
|
||||
widget.fun,
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue