添加社区新的动态页面

hmxc
小赖 4 years ago
parent 7f0c1e2c2e
commit ccdc83bd53

@ -167,6 +167,8 @@ class _Community {
String get topicList => '/user/gambit/list'; String get topicList => '/user/gambit/list';
String get eventByTopicId => '/user/gambit/listByGambitId'; String get eventByTopicId => '/user/gambit/listByGambitId';
String get newEventList => '/user/gambit/list';
} }
class _Upload { 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/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
class NewCommunityView extends StatefulWidget { class NewCommunityView extends StatefulWidget {
NewCommunityView({Key key}) : super(key: key); NewCommunityView({Key key}) : super(key: key);
@ -9,10 +14,39 @@ class NewCommunityView extends StatefulWidget {
class _NewCommunityViewState extends State<NewCommunityView> class _NewCommunityViewState extends State<NewCommunityView>
with AutomaticKeepAliveClientMixin { with AutomaticKeepAliveClientMixin {
EasyRefreshController _refreshController = EasyRefreshController();
@override
void dispose() {
_refreshController?.dispose();
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(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 @override

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

Loading…
Cancel
Save