添加社区新的动态页面

hmxc
小赖 4 years ago
parent 7f0c1e2c2e
commit ccdc83bd53

@ -167,6 +167,8 @@ class _Community {
String get topicList => '/user/gambit/list';
String get eventByTopicId => '/user/gambit/listByGambitId';
String get newEventList => '/user/gambit/list';
}
class _Upload {

@ -1,4 +1,9 @@
import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/model/community/event_item_model.dart';
import 'package:akuCommunity/pages/things_page/widget/bee_list_view.dart';
import 'package:akuCommunity/ui/community/community_views/widgets/chat_card.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
class NewCommunityView extends StatefulWidget {
NewCommunityView({Key key}) : super(key: key);
@ -9,10 +14,39 @@ class NewCommunityView extends StatefulWidget {
class _NewCommunityViewState extends State<NewCommunityView>
with AutomaticKeepAliveClientMixin {
EasyRefreshController _refreshController = EasyRefreshController();
@override
void dispose() {
_refreshController?.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
super.build(context);
return Container();
return BeeListView(
path: API.community.newEventList,
controller: _refreshController,
convert: (model) {
return model.tableList.map((e) => EventItemModel.fromJson(e)).toList();
},
builder: (items) {
return ListView.builder(
itemBuilder: (context, index) {
final item = items[index] as EventItemModel;
return ChatCard(
name: item.createName ?? '',
title: item.gambitTitle ?? '',
contentImg: item.imgUrls,
date: item.date,
id: item.id,
headImg: item.headSculptureImgUrl,
);
},
itemCount: items.length,
);
},
);
}
@override

@ -25,10 +25,10 @@ class ChatCard extends StatefulWidget {
final int id;
ChatCard({
Key key,
this.name,
this.title,
this.headImg,
this.contentImg,
@required this.name,
@required this.title,
@required this.headImg,
@required this.contentImg,
@required this.date,
this.initLike = false,
@required this.id,

Loading…
Cancel
Save