修改活动公告

hmxc
张萌 4 years ago
parent d43be5986c
commit 84da67f033

@ -1,28 +0,0 @@
// Flutter imports:
class AnouncementCardModel {
String title;
String date;
String body;
AnouncementCardModel(this.title, this.date, {this.body});
static List<AnouncementCardModel> initList() {
return [
AnouncementCardModel(
'关于国庆放假的通知和安排',
'2020-10-22 10:00',
body: '''
201610177108
''',
),
AnouncementCardModel(
'关于国庆放假的通知和安排',
'2020-10-22 10:00',
),
AnouncementCardModel('关于中秋放假通知与工作安排', '2020-10-22 10:00'),
AnouncementCardModel('疫情期间对大家的表扬和鼓励', '2020-10-22 11:00'),
];
}
}

@ -37,4 +37,14 @@ class AnnouncementDetailModel {
data['imgUrls'] = this.imgUrls;
return data;
}
AnnouncementDetailModel.zero() {
this.content = '';
this.fileDocName = '';
this.fileDocUrl = '';
this.id = -1;
this.imgUrls = [];
this.releaseTime = '';
this.title = '';
}
}

@ -1,14 +1,15 @@
// Flutter imports:
import 'package:aku_community_manager/models/announce/announcement_detail_model.dart';
import 'package:aku_community_manager/models/announce/announcement_list_model.dart';
import 'package:flutter/material.dart';
// Project imports:
import 'package:aku_community_manager/mock_models/anouncement/anouncement_model.dart';
class AnouncementProvider extends ChangeNotifier {
List<AnouncementCardModel> _anouncementCardModel =
AnouncementCardModel.initList();
List<AnouncementCardModel> get anouncementCardModels => _anouncementCardModel;
addAnouncementCardModel(AnouncementCardModel model) {
List<AnnouncementListModel> _anouncementCardModel = [];
List<AnnouncementListModel> get anouncementCardModels =>
_anouncementCardModel;
addAnouncementCardModel(AnnouncementListModel model) {
_anouncementCardModel.insert(0, model);
notifyListeners();
}

@ -19,7 +19,6 @@ import 'package:get/get.dart';
// Project imports:
import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/mock_models/anouncement/anouncement_model.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/home/announcement/anouncement_details.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
@ -44,9 +43,11 @@ class AllAnouncementState extends State<AllAnouncement> {
params: {'announcementId': model.id});
AnnouncementDetailModel detailModel =
AnnouncementDetailModel.fromJson(baseModel.data);
Get.to(AnouncementDetails(
model: detailModel,
));
Get.to(
AnouncementDetails(
model: detailModel,
),
);
},
child: Container(
color: Color(0xFFFFFFFF),
@ -116,7 +117,7 @@ class AllAnouncementState extends State<AllAnouncement> {
Widget _anouncementList(
String date,
List<AnouncementCardModel> cards,
List<AnnouncementListModel> cards,
) {
return Column(
children: [

@ -431,10 +431,9 @@ class _HomePageState extends State<HomePage> {
height: 172.w,
child: Stack(children: [
CarouselSlider(
// items: _anouncementProvider.anouncementCardModels
// .map((e) => AllAnouncementState.anounceCard(e))
// .toList(),
items: [],
items: _anouncementProvider.anouncementCardModels
.map((e) => AllAnouncementState.anounceCard(e))
.toList(),
options: CarouselOptions(
viewportFraction: 1.0,
aspectRatio: 686 / 172,

Loading…
Cancel
Save