You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.7 KiB

3 years ago
import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/models/home/home_announce_model.dart';
3 years ago
import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart';
import 'package:aku_new_community/ui/community/notice/notice_card.dart';
import 'package:aku_new_community/utils/headers.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
4 years ago
@Deprecated('暂时弃用')
class NoticePage extends StatefulWidget {
4 years ago
NoticePage({Key? key}) : super(key: key);
@override
_NoticePageState createState() => _NoticePageState();
}
class _NoticePageState extends State<NoticePage> {
EasyRefreshController _refreshController = EasyRefreshController();
3 years ago
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '社区公告',
body: BeeListView<HomeAnnounceModel>(
controller: _refreshController,
3 years ago
path: SAASAPI.announce.list,
convert: (model) =>
model.rows.map((e) => HomeAnnounceModel.fromJson(e)).toList(),
builder: (items) {
return ListView.separated(
padding: EdgeInsets.symmetric(vertical: 32.w),
itemBuilder: (context, index) {
final HomeAnnounceModel model = items[index];
HomeAnnounceModel? preModel;
if (index >= 1) preModel = items[index - 1];
return NoticeCard(
model: model,
preModel: preModel,
);
},
separatorBuilder: (_, __) => 8.hb,
itemCount: items.length,
);
},
),
);
}
}