修改系统消息显示

hmxc
张萌 4 years ago
parent 1ee9719ee1
commit a60682be25

@ -7,12 +7,10 @@ import 'package:flutter/material.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
// Package imports: // Package imports:
import 'package:aku_ui/common_widgets/aku_common_widgets.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
// Project imports: // Project imports:
import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';

@ -80,7 +80,7 @@ class _CommentMessageCardState extends State<CommentMessageCard> {
baseColor: kPrimaryColor.withOpacity(0.3), baseColor: kPrimaryColor.withOpacity(0.3),
highlightColor: kPrimaryColor.withOpacity(0.1), highlightColor: kPrimaryColor.withOpacity(0.1),
child: Text( child: Text(
'', 'date',
style: TextStyle(color: AppStyle.minorTextColor, fontSize: 24.sp), style: TextStyle(color: AppStyle.minorTextColor, fontSize: 24.sp),
), ),
), ),

@ -1,18 +1,17 @@
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/const/api.dart'; 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/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:aku_community_manager/ui/widgets/common/bee_list_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:velocity_x/velocity_x.dart';
// Package imports: // Package imports:
import 'package:aku_ui/aku_ui.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
// Project imports: // Project imports:
import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/style/app_style.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'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
class SystemMessage extends StatefulWidget { class SystemMessage extends StatefulWidget {
@ -33,10 +32,15 @@ class _SystemMessageState extends State<SystemMessage> {
body: BeeListView( body: BeeListView(
controller: _refreshController, controller: _refreshController,
builder: (items) { builder: (items) {
return ListView( return ListView.separated(
padding: EdgeInsets.only(left: 32.w, right: 32.w, bottom: 40.w), padding: EdgeInsets.symmetric(horizontal: 32.w),
children: [], itemBuilder: (context, index) {
); return SystemMessageCard(model: items[index]);
},
separatorBuilder: (context, index) {
return 10.w.heightBox;
},
itemCount: items.length);
}, },
path: API.message.systemList, path: API.message.systemList,
convert: (model) => model.tableList convert: (model) => model.tableList

@ -1,5 +1,6 @@
import 'package:aku_community_manager/const/api.dart'; 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_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/style/app_style.dart';
import 'package:aku_community_manager/utils/network/base_model.dart'; import 'package:aku_community_manager/utils/network/base_model.dart';
import 'package:aku_community_manager/utils/network/net_util.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'; import 'package:shimmer/shimmer.dart';
class SystemMessageCard extends StatefulWidget { class SystemMessageCard extends StatefulWidget {
final int repairId; final SystemMessageItemModel model;
SystemMessageCard({Key key, this.repairId}) : super(key: key); SystemMessageCard({Key key, this.model}) : super(key: key);
@override @override
_SystemMessageCardState createState() => _SystemMessageCardState(); _SystemMessageCardState createState() => _SystemMessageCardState();
@ -24,8 +25,9 @@ class _SystemMessageCardState extends State<SystemMessageCard> {
void initState() { void initState() {
super.initState(); super.initState();
Future.delayed(Duration(milliseconds: 300), () async { Future.delayed(Duration(milliseconds: 300), () async {
_systemModel = await getSystemMessage(widget.repairId); _systemModel = await getSystemMessage(widget.model.relationId);
_onLoad = false; _onLoad = false;
setState(() {});
}); });
} }

Loading…
Cancel
Save