From a60682be258a69e0e8bbf3d2363dcf6bb28465a9 Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Wed, 7 Apr 2021 18:01:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=B3=BB=E7=BB=9F=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/ui/home/messages/comment_message.dart | 2 -- lib/ui/home/messages/comment_message_card.dart | 2 +- lib/ui/home/messages/system_message.dart | 18 +++++++++++------- lib/ui/home/messages/systen_message_card.dart | 8 +++++--- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/lib/ui/home/messages/comment_message.dart b/lib/ui/home/messages/comment_message.dart index 821a295..4e211e7 100644 --- a/lib/ui/home/messages/comment_message.dart +++ b/lib/ui/home/messages/comment_message.dart @@ -7,12 +7,10 @@ import 'package:flutter/material.dart'; import 'package:velocity_x/velocity_x.dart'; // Package imports: -import 'package:aku_ui/common_widgets/aku_common_widgets.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; // Project imports: -import 'package:aku_community_manager/const/resource.dart'; import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; diff --git a/lib/ui/home/messages/comment_message_card.dart b/lib/ui/home/messages/comment_message_card.dart index 665a603..be47dbd 100644 --- a/lib/ui/home/messages/comment_message_card.dart +++ b/lib/ui/home/messages/comment_message_card.dart @@ -80,7 +80,7 @@ class _CommentMessageCardState extends State { baseColor: kPrimaryColor.withOpacity(0.3), highlightColor: kPrimaryColor.withOpacity(0.1), child: Text( - '', + 'date', style: TextStyle(color: AppStyle.minorTextColor, fontSize: 24.sp), ), ), diff --git a/lib/ui/home/messages/system_message.dart b/lib/ui/home/messages/system_message.dart index 4ac2d48..5a783c2 100644 --- a/lib/ui/home/messages/system_message.dart +++ b/lib/ui/home/messages/system_message.dart @@ -1,18 +1,17 @@ // Flutter imports: import 'package:aku_community_manager/const/api.dart'; import 'package:aku_community_manager/models/message/system_message_item_model.dart'; +import 'package:aku_community_manager/ui/home/messages/systen_message_card.dart'; import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart'; import 'package:flutter/material.dart'; +import 'package:velocity_x/velocity_x.dart'; // Package imports: -import 'package:aku_ui/aku_ui.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; // Project imports: -import 'package:aku_community_manager/const/resource.dart'; import 'package:aku_community_manager/style/app_style.dart'; -import 'package:aku_community_manager/tools/widget_tool.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; class SystemMessage extends StatefulWidget { @@ -33,10 +32,15 @@ class _SystemMessageState extends State { body: BeeListView( controller: _refreshController, builder: (items) { - return ListView( - padding: EdgeInsets.only(left: 32.w, right: 32.w, bottom: 40.w), - children: [], - ); + return ListView.separated( + padding: EdgeInsets.symmetric(horizontal: 32.w), + itemBuilder: (context, index) { + return SystemMessageCard(model: items[index]); + }, + separatorBuilder: (context, index) { + return 10.w.heightBox; + }, + itemCount: items.length); }, path: API.message.systemList, convert: (model) => model.tableList diff --git a/lib/ui/home/messages/systen_message_card.dart b/lib/ui/home/messages/systen_message_card.dart index af97648..513eabe 100644 --- a/lib/ui/home/messages/systen_message_card.dart +++ b/lib/ui/home/messages/systen_message_card.dart @@ -1,5 +1,6 @@ import 'package:aku_community_manager/const/api.dart'; import 'package:aku_community_manager/models/message/system_message_detail_model.dart'; +import 'package:aku_community_manager/models/message/system_message_item_model.dart'; import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/utils/network/base_model.dart'; import 'package:aku_community_manager/utils/network/net_util.dart'; @@ -10,8 +11,8 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:shimmer/shimmer.dart'; class SystemMessageCard extends StatefulWidget { - final int repairId; - SystemMessageCard({Key key, this.repairId}) : super(key: key); + final SystemMessageItemModel model; + SystemMessageCard({Key key, this.model}) : super(key: key); @override _SystemMessageCardState createState() => _SystemMessageCardState(); @@ -24,8 +25,9 @@ class _SystemMessageCardState extends State { void initState() { super.initState(); Future.delayed(Duration(milliseconds: 300), () async { - _systemModel = await getSystemMessage(widget.repairId); + _systemModel = await getSystemMessage(widget.model.relationId); _onLoad = false; + setState(() {}); }); }