parent
26366ae719
commit
c11b177352
@ -0,0 +1,27 @@
|
||||
class ImgModel {
|
||||
String url;
|
||||
String size;
|
||||
int longs;
|
||||
int paragraph;
|
||||
int sort;
|
||||
|
||||
ImgModel({this.url, this.size, this.longs, this.paragraph, this.sort});
|
||||
|
||||
ImgModel.fromJson(Map<String, dynamic> json) {
|
||||
url = json['url'];
|
||||
size = json['size'];
|
||||
longs = json['longs'];
|
||||
paragraph = json['paragraph'];
|
||||
sort = json['sort'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['url'] = this.url;
|
||||
data['size'] = this.size;
|
||||
data['longs'] = this.longs;
|
||||
data['paragraph'] = this.paragraph;
|
||||
data['sort'] = this.sort;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
import 'package:akuCommunity/model/common/img_model.dart';
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
|
||||
class ActivityDetailModel {
|
||||
int id;
|
||||
String title;
|
||||
String content;
|
||||
String location;
|
||||
String activityStartTime;
|
||||
String activityEndTime;
|
||||
String registrationEndTime;
|
||||
int countRegistration;
|
||||
List<ImgModel> imgUrls;
|
||||
List<ImgModel> headImgURls;
|
||||
|
||||
DateTime get startDate => DateUtil.getDateTime(activityStartTime);
|
||||
DateTime get endDate => DateUtil.getDateTime(activityEndTime);
|
||||
DateTime get registEndDate => DateUtil.getDateTime(registrationEndTime);
|
||||
|
||||
ActivityDetailModel(
|
||||
{this.id,
|
||||
this.title,
|
||||
this.content,
|
||||
this.location,
|
||||
this.activityStartTime,
|
||||
this.activityEndTime,
|
||||
this.registrationEndTime,
|
||||
this.countRegistration,
|
||||
this.imgUrls,
|
||||
this.headImgURls});
|
||||
|
||||
ActivityDetailModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
title = json['title'];
|
||||
content = json['content'];
|
||||
location = json['location'];
|
||||
activityStartTime = json['activityStartTime'];
|
||||
activityEndTime = json['activityEndTime'];
|
||||
registrationEndTime = json['registrationEndTime'];
|
||||
countRegistration = json['countRegistration'];
|
||||
if (json['imgUrls'] != null) {
|
||||
imgUrls = new List<ImgModel>();
|
||||
json['imgUrls'].forEach((v) {
|
||||
imgUrls.add(new ImgModel.fromJson(v));
|
||||
});
|
||||
} else
|
||||
imgUrls = [];
|
||||
if (json['headImgURls'] != null) {
|
||||
headImgURls = new List<ImgModel>();
|
||||
json['headImgURls'].forEach((v) {
|
||||
headImgURls.add(new ImgModel.fromJson(v));
|
||||
});
|
||||
} else
|
||||
headImgURls = [];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['title'] = this.title;
|
||||
data['content'] = this.content;
|
||||
data['location'] = this.location;
|
||||
data['activityStartTime'] = this.activityStartTime;
|
||||
data['activityEndTime'] = this.activityEndTime;
|
||||
data['registrationEndTime'] = this.registrationEndTime;
|
||||
data['countRegistration'] = this.countRegistration;
|
||||
if (this.imgUrls != null) {
|
||||
data['imgUrls'] = this.imgUrls.map((v) => v.toJson()).toList();
|
||||
}
|
||||
if (this.headImgURls != null) {
|
||||
data['headImgURls'] = this.headImgURls.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
import 'package:akuCommunity/model/common/img_model.dart';
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
|
||||
class ActivityItemModel {
|
||||
int id;
|
||||
String title;
|
||||
String location;
|
||||
int status;
|
||||
String registrationStartTime;
|
||||
String registrationEndTime;
|
||||
List<ImgModel> imgUrls;
|
||||
List<ImgModel> headImgURls;
|
||||
|
||||
DateTime get begin => DateUtil.getDateTime(registrationStartTime);
|
||||
DateTime get end => DateUtil.getDateTime(registrationEndTime);
|
||||
|
||||
ActivityItemModel(
|
||||
{this.id,
|
||||
this.title,
|
||||
this.location,
|
||||
this.status,
|
||||
this.registrationStartTime,
|
||||
this.registrationEndTime,
|
||||
this.imgUrls,
|
||||
this.headImgURls});
|
||||
|
||||
ActivityItemModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
title = json['title'];
|
||||
location = json['location'];
|
||||
status = json['status'];
|
||||
registrationStartTime = json['registrationStartTime'];
|
||||
registrationEndTime = json['registrationEndTime'];
|
||||
if (json['imgUrls'] != null) {
|
||||
imgUrls = new List<ImgModel>();
|
||||
json['imgUrls'].forEach((v) {
|
||||
imgUrls.add(new ImgModel.fromJson(v));
|
||||
});
|
||||
} else {
|
||||
imgUrls = [];
|
||||
}
|
||||
if (json['headImgURls'] != null) {
|
||||
headImgURls = new List<ImgModel>();
|
||||
json['headImgURls'].forEach((v) {
|
||||
headImgURls.add(new ImgModel.fromJson(v));
|
||||
});
|
||||
} else {
|
||||
headImgURls = [];
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['title'] = this.title;
|
||||
data['location'] = this.location;
|
||||
data['status'] = this.status;
|
||||
data['registrationStartTime'] = this.registrationStartTime;
|
||||
data['registrationEndTime'] = this.registrationEndTime;
|
||||
if (this.imgUrls != null) {
|
||||
data['imgUrls'] = this.imgUrls.map((v) => v.toJson()).toList();
|
||||
}
|
||||
if (this.headImgURls != null) {
|
||||
data['headImgURls'] = this.headImgURls.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
class ActivityPeopleModel {
|
||||
int id;
|
||||
String name;
|
||||
String tel;
|
||||
List<ImgUrl> imgUrl;
|
||||
|
||||
ActivityPeopleModel({this.id, this.name, this.tel, this.imgUrl});
|
||||
|
||||
ActivityPeopleModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
tel = json['tel'];
|
||||
if (json['imgUrl'] != null) {
|
||||
imgUrl = new List<ImgUrl>();
|
||||
json['imgUrl'].forEach((v) {
|
||||
imgUrl.add(new ImgUrl.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['name'] = this.name;
|
||||
data['tel'] = this.tel;
|
||||
if (this.imgUrl != null) {
|
||||
data['imgUrl'] = this.imgUrl.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class ImgUrl {
|
||||
String url;
|
||||
String size;
|
||||
int longs;
|
||||
int paragraph;
|
||||
int sort;
|
||||
|
||||
ImgUrl({this.url, this.size, this.longs, this.paragraph, this.sort});
|
||||
|
||||
ImgUrl.fromJson(Map<String, dynamic> json) {
|
||||
url = json['url'];
|
||||
size = json['size'];
|
||||
longs = json['longs'];
|
||||
paragraph = json['paragraph'];
|
||||
sort = json['sort'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['url'] = this.url;
|
||||
data['size'] = this.size;
|
||||
data['longs'] = this.longs;
|
||||
data['paragraph'] = this.paragraph;
|
||||
data['sort'] = this.sort;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
import 'package:akuCommunity/model/common/img_model.dart';
|
||||
import 'package:akuCommunity/model/community/activity_item_model.dart';
|
||||
import 'package:akuCommunity/ui/community/activity_detail_page.dart';
|
||||
import 'package:akuCommunity/utils/headers.dart';
|
||||
import 'package:akuCommunity/const/resource.dart';
|
||||
import 'package:akuCommunity/constants/api.dart';
|
||||
import 'package:akuCommunity/widget/others/stack_avatar.dart';
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
class ActivityCard extends StatelessWidget {
|
||||
final ActivityItemModel model;
|
||||
const ActivityCard({
|
||||
Key key,
|
||||
@required this.model,
|
||||
}) : super(key: key);
|
||||
|
||||
String get firstPath =>
|
||||
(model.imgUrls?.isEmpty ?? true) ? null : model.imgUrls.first.url;
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialButton(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.zero,
|
||||
onPressed: ActivityDetailPage(id: model.id).to,
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8.w),
|
||||
side: BorderSide(
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
firstPath == null
|
||||
? SizedBox()
|
||||
: Hero(
|
||||
tag: API.image(firstPath),
|
||||
child: Material(
|
||||
color: Colors.grey,
|
||||
child: FadeInImage.assetNetwork(
|
||||
placeholder: R.ASSETS_IMAGES_LOGO_PNG,
|
||||
image: API.image(firstPath),
|
||||
height: 210.w,
|
||||
width: double.infinity,
|
||||
),
|
||||
),
|
||||
),
|
||||
model.title.text
|
||||
.size(28.sp)
|
||||
.black
|
||||
.make()
|
||||
.pSymmetric(h: 24.w, v: 16.w),
|
||||
[
|
||||
'地 点:'.text.size(24.sp).color(Color(0xFF999999)).make(),
|
||||
model.location.text.size(24.sp).make(),
|
||||
].row().pSymmetric(h: 24.w),
|
||||
6.hb,
|
||||
[
|
||||
'活动时间:'.text.size(24.sp).color(Color(0xFF999999)).make(),
|
||||
'${DateUtil.formatDate(
|
||||
model.begin,
|
||||
format: 'MM月dd日 HH:mm',
|
||||
)}至${DateUtil.formatDate(
|
||||
model.end,
|
||||
format: 'MM月dd日 HH:mm',
|
||||
)}'
|
||||
.text
|
||||
.size(24.sp)
|
||||
.make(),
|
||||
].row().pSymmetric(h: 24.w),
|
||||
[
|
||||
StackAvatar(avatars: model.headImgURls.map((e) => e.url).toList()),
|
||||
Spacer(),
|
||||
MaterialButton(
|
||||
elevation: 0,
|
||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
color: Color(0xFFFFC40C),
|
||||
shape: StadiumBorder(),
|
||||
height: 44.w,
|
||||
minWidth: 120.w,
|
||||
onPressed: () {},
|
||||
child: '去看看'.text.size(20.sp).bold.make(),
|
||||
),
|
||||
].row().p(24.w),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,184 @@
|
||||
import 'package:akuCommunity/const/resource.dart';
|
||||
import 'package:akuCommunity/constants/api.dart';
|
||||
import 'package:akuCommunity/model/community/activity_detail_model.dart';
|
||||
import 'package:akuCommunity/ui/community/activity_people_list_page.dart';
|
||||
import 'package:akuCommunity/utils/headers.dart';
|
||||
import 'package:akuCommunity/utils/network/base_model.dart';
|
||||
import 'package:akuCommunity/utils/network/net_util.dart';
|
||||
import 'package:akuCommunity/widget/bee_scaffold.dart';
|
||||
import 'package:akuCommunity/widget/others/stack_avatar.dart';
|
||||
import 'package:akuCommunity/widget/picker/bee_image_preview.dart';
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:shimmer/shimmer.dart';
|
||||
|
||||
class ActivityDetailPage extends StatefulWidget {
|
||||
final int id;
|
||||
ActivityDetailPage({Key key, @required this.id}) : super(key: key);
|
||||
|
||||
@override
|
||||
_ActivityDetailPageState createState() => _ActivityDetailPageState();
|
||||
}
|
||||
|
||||
class _ActivityDetailPageState extends State<ActivityDetailPage> {
|
||||
ActivityDetailModel model;
|
||||
EasyRefreshController _refreshController = EasyRefreshController();
|
||||
|
||||
Widget get emptyWidget => Shimmer.fromColors(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
VxBox().white.height(45.w).width(544.w).make(),
|
||||
48.hb,
|
||||
VxBox()
|
||||
.white
|
||||
.height(228.w)
|
||||
.width(double.infinity)
|
||||
.withRounded(value: 8.w)
|
||||
.make(),
|
||||
44.hb,
|
||||
...List.generate(
|
||||
3,
|
||||
(index) => VxBox()
|
||||
.white
|
||||
.height(45.w)
|
||||
.width(544.w)
|
||||
.margin(EdgeInsets.symmetric(vertical: 5.w))
|
||||
.make(),
|
||||
),
|
||||
],
|
||||
).pSymmetric(h: 32.w, v: 24.w),
|
||||
baseColor: Colors.black12,
|
||||
highlightColor: Colors.white,
|
||||
);
|
||||
@override
|
||||
void dispose() {
|
||||
_refreshController?.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
_buildTile(String title, String subTitle) {
|
||||
return Row(
|
||||
children: [
|
||||
title.text.size(28.sp).make().box.width(136.w).make(),
|
||||
subTitle.text.size(28.sp).make().expand(),
|
||||
],
|
||||
).pSymmetric(h: 32.w);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BeeScaffold(
|
||||
title: '活动详情',
|
||||
body: EasyRefresh(
|
||||
header: MaterialHeader(),
|
||||
onRefresh: () async {
|
||||
BaseModel baseModel = await NetUtil().get(
|
||||
API.community.activityDetail,
|
||||
params: {'activityId': widget.id},
|
||||
);
|
||||
model = ActivityDetailModel.fromJson(baseModel.data);
|
||||
setState(() {});
|
||||
},
|
||||
controller: _refreshController,
|
||||
firstRefresh: true,
|
||||
emptyWidget: model == null ? emptyWidget : null,
|
||||
child: model == null
|
||||
? SizedBox()
|
||||
: ListView(
|
||||
children: [
|
||||
model.title.text
|
||||
.size(32.sp)
|
||||
.bold
|
||||
.make()
|
||||
.pSymmetric(h: 32.w, v: 24.w),
|
||||
48.hb,
|
||||
...model.imgUrls
|
||||
.map((e) => GestureDetector(
|
||||
onTap: () {
|
||||
Get.to(
|
||||
BeeImagePreview.path(path: API.image(e.url)),
|
||||
opaque: false,
|
||||
);
|
||||
},
|
||||
child: Hero(
|
||||
tag: API.image(e.url),
|
||||
child: Container(
|
||||
height: 228.w,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.black12,
|
||||
borderRadius: BorderRadius.circular(8.w),
|
||||
),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: FadeInImage.assetNetwork(
|
||||
placeholder: R.ASSETS_IMAGES_LOGO_PNG,
|
||||
image: e.url,
|
||||
),
|
||||
),
|
||||
),
|
||||
).pSymmetric(h: 32.w))
|
||||
.toList(),
|
||||
44.hb,
|
||||
model.content.text.size(28.sp).make().pSymmetric(h: 32.w),
|
||||
44.hb,
|
||||
_buildTile(
|
||||
'开始时间',
|
||||
DateUtil.formatDate(
|
||||
model.startDate,
|
||||
format: 'yyyy年MM月dd日 HH:mm',
|
||||
),
|
||||
),
|
||||
_buildTile(
|
||||
'结束时间',
|
||||
DateUtil.formatDate(
|
||||
model.endDate,
|
||||
format: 'yyyy年MM月dd日 HH:mm',
|
||||
),
|
||||
),
|
||||
_buildTile('地 点', model.location),
|
||||
_buildTile('参与人数', '不限'),
|
||||
_buildTile(
|
||||
'报名截止',
|
||||
DateUtil.formatDate(
|
||||
model.registEndDate,
|
||||
format: 'yyyy年MM月dd日 HH:mm',
|
||||
),
|
||||
),
|
||||
115.hb,
|
||||
Container(
|
||||
height: 24.w,
|
||||
color: Color(0xFFF9F9F9),
|
||||
),
|
||||
MaterialButton(
|
||||
height: 92.w,
|
||||
onPressed: () =>
|
||||
Get.to(ActivityPeopleListPage(id: widget.id)),
|
||||
child: Row(
|
||||
children: [
|
||||
StackAvatar(
|
||||
avatars: model.headImgURls.map((e) => e.url).toList(),
|
||||
),
|
||||
Spacer(),
|
||||
'已有${model.countRegistration}人参加'
|
||||
.text
|
||||
.size(28.sp)
|
||||
.make(),
|
||||
16.wb,
|
||||
Icon(
|
||||
CupertinoIcons.chevron_forward,
|
||||
size: 30.w,
|
||||
color: Color(0xFFD8D8D8),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Divider(height: 1.w, indent: 32.w, endIndent: 32.w),
|
||||
],
|
||||
),
|
||||
).material(color: Colors.white),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
import 'package:akuCommunity/utils/headers.dart';
|
||||
import 'package:akuCommunity/constants/api.dart';
|
||||
import 'package:akuCommunity/model/community/activity_item_model.dart';
|
||||
import 'package:akuCommunity/pages/things_page/widget/bee_list_view.dart';
|
||||
import 'package:akuCommunity/ui/community/activity_card.dart';
|
||||
import 'package:akuCommunity/widget/bee_scaffold.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||
|
||||
class ActivityListPage extends StatefulWidget {
|
||||
ActivityListPage({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_ActivityListPageState createState() => _ActivityListPageState();
|
||||
}
|
||||
|
||||
class _ActivityListPageState extends State<ActivityListPage> {
|
||||
EasyRefreshController _refreshController = EasyRefreshController();
|
||||
@override
|
||||
void dispose() {
|
||||
_refreshController?.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BeeScaffold(
|
||||
title: '往期精彩',
|
||||
body: BeeListView(
|
||||
controller: _refreshController,
|
||||
path: API.community.activityList,
|
||||
convert: (model) =>
|
||||
model.tableList.map((e) => ActivityItemModel.fromJson(e)).toList(),
|
||||
builder: (items) {
|
||||
return ListView.separated(
|
||||
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 20.w),
|
||||
itemBuilder: (context, index) {
|
||||
final ActivityItemModel model = items[index];
|
||||
return ActivityCard(model: model);
|
||||
},
|
||||
separatorBuilder: (_, __) => 20.hb,
|
||||
itemCount: items.length,
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
import 'package:akuCommunity/const/resource.dart';
|
||||
import 'package:akuCommunity/utils/headers.dart';
|
||||
import 'package:akuCommunity/constants/api.dart';
|
||||
import 'package:akuCommunity/model/community/activity_people_model.dart';
|
||||
import 'package:akuCommunity/pages/things_page/widget/bee_list_view.dart';
|
||||
import 'package:akuCommunity/widget/bee_scaffold.dart';
|
||||
import 'package:akuCommunity/widget/others/stack_avatar.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||
|
||||
class ActivityPeopleListPage extends StatefulWidget {
|
||||
final int id;
|
||||
ActivityPeopleListPage({Key key, @required this.id}) : super(key: key);
|
||||
|
||||
@override
|
||||
_ActivityPeopleListPageState createState() => _ActivityPeopleListPageState();
|
||||
}
|
||||
|
||||
class _ActivityPeopleListPageState extends State<ActivityPeopleListPage> {
|
||||
EasyRefreshController _refreshController = EasyRefreshController();
|
||||
@override
|
||||
void dispose() {
|
||||
_refreshController?.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BeeScaffold(
|
||||
title: '参与人员',
|
||||
body: BeeListView(
|
||||
controller: _refreshController,
|
||||
path: API.community.activityPeopleList,
|
||||
extraParams: {'activityId': widget.id},
|
||||
convert: (model) => model.tableList
|
||||
.map((e) => ActivityPeopleModel.fromJson(e))
|
||||
.toList(),
|
||||
builder: (items) {
|
||||
return ListView.separated(
|
||||
padding: EdgeInsets.all(32.w),
|
||||
itemBuilder: (context, index) {
|
||||
final ActivityPeopleModel model = items[index];
|
||||
return Row(
|
||||
children: [
|
||||
96.hb,
|
||||
20.wb,
|
||||
FadeInImage.assetNetwork(
|
||||
placeholder: R.ASSETS_IMAGES_LOGO_PNG,
|
||||
image: API.image(model.imgUrl.first.url),
|
||||
height: 60.w,
|
||||
width: 60.w,
|
||||
),
|
||||
18.wb,
|
||||
model.name.text.size(28.sp).make(),
|
||||
Spacer(),
|
||||
model.tel.text.size(28.sp).make(),
|
||||
],
|
||||
);
|
||||
},
|
||||
separatorBuilder: (_, __) => Divider(height: 1.w),
|
||||
itemCount: items.length,
|
||||
);
|
||||
},
|
||||
).material(color: Colors.white),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
import 'package:akuCommunity/constants/api.dart';
|
||||
import 'package:akuCommunity/model/community/activity_item_model.dart';
|
||||
import 'package:akuCommunity/utils/network/base_list_model.dart';
|
||||
import 'package:akuCommunity/utils/network/net_util.dart';
|
||||
|
||||
class CommunityFunc {
|
||||
static Future<ActivityItemModel> activity() async {
|
||||
BaseListModel model = await NetUtil().getList(
|
||||
API.community.activityList,
|
||||
params: {'pageNum': 1, 'size': 1},
|
||||
);
|
||||
if (model.tableList.length == 0) return null;
|
||||
return ActivityItemModel.fromJson(model.tableList.first);
|
||||
}
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
import 'package:akuCommunity/base/base_style.dart';
|
||||
import 'package:akuCommunity/const/resource.dart';
|
||||
import 'package:akuCommunity/utils/headers.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
class HomeNotification extends StatefulWidget {
|
||||
HomeNotification({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_HomeNotificationState createState() => _HomeNotificationState();
|
||||
}
|
||||
|
||||
class _HomeNotificationState extends State<HomeNotification> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
children: [
|
||||
85.hb,
|
||||
24.wb,
|
||||
Image.asset(
|
||||
R.ASSETS_ICONS_ICON_NOTIFICATION_PNG,
|
||||
height: 40.w,
|
||||
width: 40.w,
|
||||
),
|
||||
24.wb,
|
||||
'TTTTTTTTT'.text.size(28.sp).make(),
|
||||
Spacer(),
|
||||
MaterialButton(
|
||||
shape: StadiumBorder(),
|
||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||||
onPressed: () {},
|
||||
child: Row(
|
||||
children: [
|
||||
'更多公告'.text.size(20.sp).color(Color(0xFF999999)).make(),
|
||||
8.wb,
|
||||
Icon(
|
||||
CupertinoIcons.chevron_forward,
|
||||
size: 24.w,
|
||||
color: Color(0xFF999999),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
12.wb,
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
import 'package:akuCommunity/base/base_style.dart';
|
||||
import 'package:akuCommunity/utils/headers.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
class HomeTitle extends StatelessWidget {
|
||||
final String title;
|
||||
final String suffixTitle;
|
||||
final VoidCallback onTap;
|
||||
|
||||
const HomeTitle({
|
||||
Key key,
|
||||
@required this.title,
|
||||
@required this.suffixTitle,
|
||||
@required this.onTap,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
children: [
|
||||
85.hb,
|
||||
24.wb,
|
||||
Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 4.w,
|
||||
child: Container(
|
||||
color: kPrimaryColor,
|
||||
height: 8.w,
|
||||
),
|
||||
),
|
||||
title.text.size(32.sp).bold.make(),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
MaterialButton(
|
||||
shape: StadiumBorder(),
|
||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||||
onPressed: onTap,
|
||||
child: Row(
|
||||
children: [
|
||||
suffixTitle.text.size(20.sp).color(Color(0xFF999999)).make(),
|
||||
8.wb,
|
||||
Icon(
|
||||
CupertinoIcons.chevron_forward,
|
||||
size: 24.w,
|
||||
color: Color(0xFF999999),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
12.wb,
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
import 'package:akuCommunity/const/resource.dart';
|
||||
import 'package:akuCommunity/constants/api.dart';
|
||||
import 'package:akuCommunity/utils/headers.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class StackAvatar extends StatelessWidget {
|
||||
final List<String> avatars;
|
||||
const StackAvatar({Key key, @required this.avatars}) : super(key: key);
|
||||
double get offset => 35.w;
|
||||
int get length => avatars?.length ?? 0;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Stack(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 44.w * 2 + 26.w,
|
||||
height: 44.w + 6.w,
|
||||
),
|
||||
...List.generate(length, (index) {
|
||||
return Positioned(
|
||||
left: index * offset,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(22.w + 2.w),
|
||||
border: Border.all(color: Color(0xFF999999)),
|
||||
),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: FadeInImage.assetNetwork(
|
||||
height: 44.w,
|
||||
width: 44.w,
|
||||
placeholder: R.ASSETS_IMAGES_LOGO_PNG,
|
||||
image: API.image(avatars[index]),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue