|
|
|
@ -1,5 +1,7 @@
|
|
|
|
|
import 'dart:ui';
|
|
|
|
|
|
|
|
|
|
import 'package:aku_community_manager/mock_models/anouncement/anouncement_model.dart';
|
|
|
|
|
import 'package:aku_community_manager/provider/anouncement_provider.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';
|
|
|
|
@ -8,40 +10,27 @@ import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
import 'package:aku_community_manager/const/resource.dart';
|
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
|
|
|
|
|
class AnouncementCardModel {
|
|
|
|
|
String title;
|
|
|
|
|
String date;
|
|
|
|
|
AnouncementCardModel(
|
|
|
|
|
this.title,
|
|
|
|
|
this.date,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
class AllAnouncement extends StatefulWidget {
|
|
|
|
|
AllAnouncement({Key key}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_AllAnouncementState createState() => _AllAnouncementState();
|
|
|
|
|
AllAnouncementState createState() => AllAnouncementState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _AllAnouncementState extends State<AllAnouncement> {
|
|
|
|
|
Widget _anounceCard(
|
|
|
|
|
String title,
|
|
|
|
|
String date,
|
|
|
|
|
class AllAnouncementState extends State<AllAnouncement> {
|
|
|
|
|
static Widget anounceCard(
|
|
|
|
|
AnouncementCardModel model
|
|
|
|
|
) {
|
|
|
|
|
return Column(
|
|
|
|
|
children: [
|
|
|
|
|
AkuButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Get.to(AnouncementDetails(
|
|
|
|
|
title: title,
|
|
|
|
|
date: date,
|
|
|
|
|
body: '''
|
|
|
|
|
各位同事:
|
|
|
|
|
深圳永成物业员工2016年国庆节放假通知如下10月1日至7日放假调休,共7天。10月8日(星期六)上班。调休期间,值班室至少三人,请各级主管自行安排。请将此消息转达给我们所有的同事、客户、供应商和任何有品要迅知的伙伴
|
|
|
|
|
|
|
|
|
|
祝全体员工度过一个欢乐样和的国庆节假日''',
|
|
|
|
|
title: model.title,
|
|
|
|
|
date: model.date,
|
|
|
|
|
body: model.body==null?'':model.body,
|
|
|
|
|
));
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
@ -74,7 +63,7 @@ class _AllAnouncementState extends State<AllAnouncement> {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
title,
|
|
|
|
|
model.title,
|
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 12.w),
|
|
|
|
@ -85,7 +74,7 @@ class _AllAnouncementState extends State<AllAnouncement> {
|
|
|
|
|
width: 24.w,
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
date,
|
|
|
|
|
model.date,
|
|
|
|
|
style: AppStyle().minorStyle,
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
@ -121,7 +110,7 @@ class _AllAnouncementState extends State<AllAnouncement> {
|
|
|
|
|
)),
|
|
|
|
|
...(cards
|
|
|
|
|
.map(
|
|
|
|
|
(e) => _anounceCard(e.title, e.date),
|
|
|
|
|
(e) => anounceCard(e),
|
|
|
|
|
)
|
|
|
|
|
.toList()),
|
|
|
|
|
],
|
|
|
|
@ -130,25 +119,14 @@ class _AllAnouncementState extends State<AllAnouncement> {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
final AnouncementProvider _anouncementProvider=Provider.of<AnouncementProvider>(context);
|
|
|
|
|
return AkuScaffold(
|
|
|
|
|
title: '全部公告',
|
|
|
|
|
body: ListView(
|
|
|
|
|
padding: EdgeInsets.only(left: 32.w, right: 32.w),
|
|
|
|
|
children: [
|
|
|
|
|
_anouncementList('2020-10-22', [
|
|
|
|
|
AnouncementCardModel(
|
|
|
|
|
'关于国庆放假的通知和安排',
|
|
|
|
|
'2020-10-22 10:00',
|
|
|
|
|
),
|
|
|
|
|
AnouncementCardModel(
|
|
|
|
|
'关于绿化组人员调动通知',
|
|
|
|
|
'2020-10-22 11:00',
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
_anouncementList('2020-10-20', [
|
|
|
|
|
AnouncementCardModel('关于中秋放假通知与工作安排', '2020-10-22 10:00'),
|
|
|
|
|
AnouncementCardModel('疫情期间对大家的表扬和鼓励', '2020-10-22 11:00'),
|
|
|
|
|
]),
|
|
|
|
|
_anouncementList('2020-10-22', _anouncementProvider.anouncementCardModels.sublist(0,2)),
|
|
|
|
|
_anouncementList('2020-10-20', _anouncementProvider.anouncementCardModels.sublist(2,2)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|