From 6cc39c509988a2ede0e6dd3acbebc720b87b4853 Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Wed, 7 Apr 2021 10:51:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=20=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E5=B7=A5=E5=8D=95=E4=B8=BB=E9=94=AEid=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=8A=A5=E4=BA=8B=E6=8A=A5=E4=BF=AE=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=EF=BC=88=E5=90=8C=E6=AD=A5=20=E6=B7=BB=E5=8A=A0=20?= =?UTF-8?q?=E4=B8=BB=E9=A1=B5=E5=8F=8A=E6=B6=88=E6=81=AF=E9=A1=B5=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/const/api.dart | 5 + .../message/comment_message_detail_model.dart | 21 + lib/ui/home/home_page.dart | 388 +++++++++--------- lib/ui/home/messages/comment_message.dart | 134 +----- .../home/messages/comment_message_card.dart | 321 +++++++++++++++ pubspec.lock | 7 + pubspec.yaml | 1 + 7 files changed, 567 insertions(+), 310 deletions(-) create mode 100644 lib/models/message/comment_message_detail_model.dart create mode 100644 lib/ui/home/messages/comment_message_card.dart diff --git a/lib/const/api.dart b/lib/const/api.dart index 1151aed..dd84d52 100644 --- a/lib/const/api.dart +++ b/lib/const/api.dart @@ -220,4 +220,9 @@ class _Message { ///公告管理(管家app):根据社区公告主键id查询社区公告信息 String get announcementFindByld => '/user/announcement/findById'; + + ///消息中心:根据工单主键id同步查询报事报修评论(同步) + String get getCommentByDispatchId => '/user/message/findCommentByDispatchId'; + + } diff --git a/lib/models/message/comment_message_detail_model.dart b/lib/models/message/comment_message_detail_model.dart new file mode 100644 index 0000000..490a310 --- /dev/null +++ b/lib/models/message/comment_message_detail_model.dart @@ -0,0 +1,21 @@ +class CommentMessageDetailModel { + int id; + String name; + int level; + + CommentMessageDetailModel({this.id, this.name, this.level}); + + CommentMessageDetailModel.fromJson(Map json) { + id = json['id']; + name = json['name']; + level = json['level']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['name'] = this.name; + data['level'] = this.level; + return data; + } +} diff --git a/lib/ui/home/home_page.dart b/lib/ui/home/home_page.dart index d3fbec5..b04dee0 100644 --- a/lib/ui/home/home_page.dart +++ b/lib/ui/home/home_page.dart @@ -7,6 +7,8 @@ import 'package:aku_community_manager/utils/network/net_util.dart'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:shimmer/shimmer.dart'; +import 'package:velocity_x/velocity_x.dart'; // Package imports: import 'package:aku_ui/aku_ui.dart'; @@ -38,7 +40,6 @@ import 'package:aku_community_manager/ui/sub_pages/business_and_fix/business_and import 'package:aku_community_manager/ui/sub_pages/business_and_fix/business_fix_card.dart'; import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_manager_card.dart'; import 'package:aku_community_manager/ui/sub_pages/visitor_manager/visitor_manager_page.dart'; -import 'package:aku_community_manager/ui/tool_pages/scan_page.dart'; import 'package:aku_community_manager/ui/tool_pages/warning/warning_page.dart'; import 'package:aku_community_manager/ui/widgets/app_widgets/aku_avatar.dart'; @@ -53,6 +54,7 @@ class HomePage extends StatefulWidget { class _HomePageState extends State { ItemNumModel _itemNumModel; + bool _onload = true; ///自定义bar的菜单按钮 Widget _menuButton(String assetPath, String text, Widget page) { @@ -139,12 +141,16 @@ class _HomePageState extends State { } @override - void initState() async { + void initState() { super.initState(); SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle( statusBarColor: Colors.transparent, )); - _itemNumModel = await _getItemNum(); + Future.delayed(Duration(milliseconds: 300), () async { + _itemNumModel = await _getItemNum(); + _onload = false; + setState(() {}); + }); } int _currentIndicator = 0; @@ -365,214 +371,224 @@ class _HomePageState extends State { ), ), ), - body: ListView( - padding: EdgeInsets.all(32.w), - children: [ - Container( - //公告标题行 - width: double.infinity, - height: 45.w, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, + body: _onload + ? Center( + child: Shimmer.fromColors( + child: 'LOADING······'.text.black.size(50.sp).make(), + baseColor: Colors.white, + highlightColor: kPrimaryColor), + ) + : ListView( + padding: EdgeInsets.all(32.w), children: [ - Text( - '今日公告', - style: TextStyle( - color: Color(0xFF4A4B51), - fontSize: 32.sp, - fontWeight: FontWeight.bold, - ), - ), - Spacer(), - AkuButton( - //全部公告按钮 - onPressed: () { - Get.to(() => AllAnouncement()); - }, + Container( + //公告标题行 + width: double.infinity, + height: 45.w, child: Row( + mainAxisAlignment: MainAxisAlignment.center, children: [ Text( - '全部公告', + '今日公告', style: TextStyle( - color: AppStyle.minorTextColor, - fontSize: 24.sp, + color: Color(0xFF4A4B51), + fontSize: 32.sp, fontWeight: FontWeight.bold, ), ), - Icon( - Icons.arrow_forward_ios, - size: 22.w, - color: AppStyle.minorTextColor, - ) + Spacer(), + AkuButton( + //全部公告按钮 + onPressed: () { + Get.to(() => AllAnouncement()); + }, + child: Row( + children: [ + Text( + '全部公告', + style: TextStyle( + color: AppStyle.minorTextColor, + fontSize: 24.sp, + fontWeight: FontWeight.bold, + ), + ), + Icon( + Icons.arrow_forward_ios, + size: 22.w, + color: AppStyle.minorTextColor, + ) + ], + ), + ), ], ), ), - ], - ), - ), - SizedBox(height: 16.w), - //公告栏 - Container( - color: Color(0xFFFFFFFF), - width: double.infinity, - height: 172.w, - child: Stack(children: [ - CarouselSlider( - // items: _anouncementProvider.anouncementCardModels - // .map((e) => AllAnouncementState.anounceCard(e)) - // .toList(), - items: [], - options: CarouselOptions( - viewportFraction: 1.0, - aspectRatio: 686 / 172, - autoPlay: true, - onPageChanged: (index, _) { - setState(() { - _currentIndicator = index; - }); - }, - ), - ), - Positioned( - top: 144.w, - left: 0, - bottom: 16.w, - right: 0, - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: - _anouncementProvider.anouncementCardModels.map((e) { - int index = - _anouncementProvider.anouncementCardModels.indexOf(e); - return Container( - width: 12.w, - height: 12.w, - margin: EdgeInsets.symmetric(horizontal: 12.w), - decoration: BoxDecoration( - shape: BoxShape.circle, - color: _currentIndicator == index - ? Color(0xFFFFC40C) - : Color(0xFFE8E8E8), - ), - ); - }).toList(), - ), - ), - ]), - ), - SizedBox(height: 16.w), - //待办事项标题行 - !userProvider.isLogin - ? SizedBox() - : Row( - children: [ - Text( - '待办事项', - style: TextStyle( - color: Color(0xFF4A4B51), - fontSize: 32.sp, - fontWeight: FontWeight.bold, + SizedBox(height: 16.w), + //公告栏 + Container( + color: Color(0xFFFFFFFF), + width: double.infinity, + height: 172.w, + child: Stack(children: [ + CarouselSlider( + // items: _anouncementProvider.anouncementCardModels + // .map((e) => AllAnouncementState.anounceCard(e)) + // .toList(), + items: [], + options: CarouselOptions( + viewportFraction: 1.0, + aspectRatio: 686 / 172, + autoPlay: true, + onPageChanged: (index, _) { + setState(() { + _currentIndicator = index; + }); + }, ), ), - Spacer(), - AkuButton( - padding: EdgeInsets.symmetric(vertical: 16.w), - onPressed: () { - Get.to(BusinessPage(initIndex: 3)); - }, + Positioned( + top: 144.w, + left: 0, + bottom: 16.w, + right: 0, child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: _anouncementProvider.anouncementCardModels + .map((e) { + int index = _anouncementProvider + .anouncementCardModels + .indexOf(e); + return Container( + width: 12.w, + height: 12.w, + margin: EdgeInsets.symmetric(horizontal: 12.w), + decoration: BoxDecoration( + shape: BoxShape.circle, + color: _currentIndicator == index + ? Color(0xFFFFC40C) + : Color(0xFFE8E8E8), + ), + ); + }).toList(), + ), + ), + ]), + ), + SizedBox(height: 16.w), + //待办事项标题行 + !userProvider.isLogin + ? SizedBox() + : Row( children: [ Text( - '全部事项', + '待办事项', style: TextStyle( - color: AppStyle.minorTextColor, - fontSize: 24.sp, - fontWeight: FontWeight.bold), + color: Color(0xFF4A4B51), + fontSize: 32.sp, + fontWeight: FontWeight.bold, + ), ), - Icon( - Icons.arrow_forward_ios, - size: 22.w, - color: AppStyle.minorTextColor, + Spacer(), + AkuButton( + padding: EdgeInsets.symmetric(vertical: 16.w), + onPressed: () { + Get.to(BusinessPage(initIndex: 3)); + }, + child: Row( + children: [ + Text( + '全部事项', + style: TextStyle( + color: AppStyle.minorTextColor, + fontSize: 24.sp, + fontWeight: FontWeight.bold), + ), + Icon( + Icons.arrow_forward_ios, + size: 22.w, + color: AppStyle.minorTextColor, + ), + ], + ), ), ], ), - ), - ], - ), - SizedBox(height: 16.w), - //待办事项栏 - !userProvider.isLogin - ? SizedBox() - : Container( - height: 480.w, - child: ListView.separated( - separatorBuilder: (context, index) { - return AkuBox.w(16); - }, - scrollDirection: Axis.horizontal, - itemBuilder: (context, index) { - return Container( - width: 526.w, - child: Builder( - builder: (context) { - final item = AllModel(context).waitThings[index]; - if (item is DecorationListModel) { - return DecorationManagerCard(model: item); - } else if (item is BussinessAndFixModel) { - return BusinessFixCard( - model: item, homeDisplay: true); - } else - return SizedBox(); + SizedBox(height: 16.w), + //待办事项栏 + !userProvider.isLogin + ? SizedBox() + : Container( + height: 480.w, + child: ListView.separated( + separatorBuilder: (context, index) { + return AkuBox.w(16); }, + scrollDirection: Axis.horizontal, + itemBuilder: (context, index) { + return Container( + width: 526.w, + child: Builder( + builder: (context) { + final item = + AllModel(context).waitThings[index]; + if (item is DecorationListModel) { + return DecorationManagerCard(model: item); + } else if (item is BussinessAndFixModel) { + return BusinessFixCard( + model: item, homeDisplay: true); + } else + return SizedBox(); + }, + ), + ); + }, + itemCount: AllModel(context).waitThings.length, ), - ); - }, - itemCount: AllModel(context).waitThings.length, - ), - ), - SizedBox(height: 24.w), - //底部信息栏 - !userProvider.isLogin - ? SizedBox() - : Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8.w), - color: Colors.white, - ), - child: Column( - children: [ - Row( - children: [ - _card(_itemNumModel.unProcessedNum ?? 0, '未处理事项', - Color(0xFFFF4E0D), 0), - GridientDiveder().verticalDivider(166.5.w), - _card(_itemNumModel.processingNum ?? 0, '处理中事项', - Color(0xFFFFC40C), 1), - ], ), - Row(children: [ - GridientDiveder().horizontalDivider(343.w), - GridientDiveder(isReverse: true) - .horizontalDivider(343.w) - ]), - Row( - children: [ - _card(_itemNumModel.processedNum ?? 0, '已处理事项', - Color(0xFF3F8FFE), 2), - GridientDiveder(isReverse: true).verticalDivider( - 166.5.w, - ), - _card(_itemNumModel.allNum ?? 0, '全部事项', - Color(0xFF333333), 3), - ], + SizedBox(height: 24.w), + //底部信息栏 + !userProvider.isLogin + ? SizedBox() + : Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.w), + color: Colors.white, + ), + child: Column( + children: [ + Row( + children: [ + _card(_itemNumModel.unProcessedNum ?? 0, + '未处理事项', Color(0xFFFF4E0D), 0), + GridientDiveder().verticalDivider(166.5.w), + _card(_itemNumModel.processingNum ?? 0, + '处理中事项', Color(0xFFFFC40C), 1), + ], + ), + Row(children: [ + GridientDiveder().horizontalDivider(343.w), + GridientDiveder(isReverse: true) + .horizontalDivider(343.w) + ]), + Row( + children: [ + _card(_itemNumModel.processedNum ?? 0, + '已处理事项', Color(0xFF3F8FFE), 2), + GridientDiveder(isReverse: true) + .verticalDivider( + 166.5.w, + ), + _card(_itemNumModel.allNum ?? 0, '全部事项', + Color(0xFF333333), 3), + ], + ), + ], + ), ), - ], - ), - ), - ], - ), + ], + ), ), value: SystemUiOverlayStyle.dark, ); diff --git a/lib/ui/home/messages/comment_message.dart b/lib/ui/home/messages/comment_message.dart index c8e7913..9994b0c 100644 --- a/lib/ui/home/messages/comment_message.dart +++ b/lib/ui/home/messages/comment_message.dart @@ -1,8 +1,10 @@ // Flutter imports: import 'package:aku_community_manager/const/api.dart'; import 'package:aku_community_manager/models/message/comment_message_item_model.dart'; +import 'package:aku_community_manager/ui/home/messages/comment_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/common_widgets/aku_common_widgets.dart'; @@ -23,126 +25,6 @@ class CommentMessage extends StatefulWidget { class _CommentMessageState extends State { EasyRefreshController _refreshController = EasyRefreshController(); - Widget _messageList( - String date, - String name, - String comment, - ) { - return Column( - children: [ - Container( - margin: EdgeInsets.only(top: 24.w, bottom: 24.w), - alignment: Alignment.center, - width: double.infinity, - child: Text( - date, - style: TextStyle(color: AppStyle.minorTextColor, fontSize: 24.sp), - ), - ), - Container( - padding: EdgeInsets.only(top: 24.w, left: 24.w, right: 24.w), - color: Color(0xFFFFFFFF), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row(children: [ - Container( - width: 16.w, - height: 16.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8.w), - color: Color(0xFFFF4501)), - ), - SizedBox( - width: 16.w, - ), - Text( - '评论消息', - style: TextStyle( - color: AppStyle.primaryTextColor, - fontSize: 32.sp, - fontWeight: FontWeight.w600), - ), - SizedBox(height: 8.w), - ]), - Text( - '你有一条新的评论消息,请立即查看', - style: TextStyle( - color: AppStyle.primaryTextColor, - fontSize: 28.sp, - fontWeight: FontWeight.bold), - ), - SizedBox(height: 24.w), - Row( - children: [ - Image.asset( - R.ASSETS_MESSAGE_IC_PEOPLE_PNG, - width: 40.w, - height: 40.w, - ), - SizedBox( - width: 4.w, - ), - Text( - '评论人', - style: TextStyle( - color: AppStyle.minorTextColor, fontSize: 28.sp), - ), - Spacer(), - Text( - name, - style: TextStyle( - color: AppStyle.primaryTextColor, fontSize: 28.sp), - ), - ], - ), - SizedBox(height: 16.w), - Row( - children: [ - Image.asset( - R.ASSETS_MESSAGE_IC_STAR_PNG, - width: 40.w, - height: 40.w, - ), - SizedBox( - width: 4.w, - ), - Text('综合评分', - style: TextStyle( - color: AppStyle.minorTextColor, fontSize: 28.sp)), - Spacer(), - Text(comment, - style: TextStyle( - color: AppStyle.primaryTextColor, fontSize: 28.sp)), - ], - ), - SizedBox(height: 16.w), - Divider(height: 1.w), - AkuButton( - onPressed: () {}, - child: Container( - height: 88.w, - alignment: Alignment.center, - padding: EdgeInsets.only(left: 24.w), - child: Row( - children: [ - Text( - '查看详情', - style: TextStyle( - color: AppStyle.primaryTextColor, fontSize: 28.sp), - ), - Spacer(), - Icon(Icons.arrow_forward_ios, size: 22.w), - ], - ), - ), - ), - ], - ), - ), - ], - ); - } @override Widget build(BuildContext context) { @@ -155,10 +37,14 @@ class _CommentMessageState extends State { .map((e) => CommentMessageItemModel.fromJson(e)) .toList(), builder: (items) { - return ListView( - padding: EdgeInsets.only(left: 32.w, right: 32.w, bottom: 40.w), - children: [], - ); + return ListView.separated( + itemBuilder: (context, index) { + return CommentMessageCard(itemModel: items[index]); + }, + separatorBuilder: (context, index) { + return 10.w.heightBox; + }, + itemCount: items.length); }, ), ); diff --git a/lib/ui/home/messages/comment_message_card.dart b/lib/ui/home/messages/comment_message_card.dart new file mode 100644 index 0000000..9409e5f --- /dev/null +++ b/lib/ui/home/messages/comment_message_card.dart @@ -0,0 +1,321 @@ +import 'package:aku_community_manager/const/api.dart'; +import 'package:aku_community_manager/models/message/comment_message_detail_model.dart'; +import 'package:aku_community_manager/models/message/comment_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'; +import 'package:aku_ui/aku_ui.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:shimmer/shimmer.dart'; +import 'package:velocity_x/velocity_x.dart'; + +class CommentMessageCard extends StatefulWidget { + final CommentMessageItemModel itemModel; + CommentMessageCard({Key key, @required this.itemModel}) : super(key: key); + + @override + _CommentMessageCardState createState() => _CommentMessageCardState(); +} + +class _CommentMessageCardState extends State { + CommentMessageDetailModel _model; + bool _onload = true; + + @override + void initState() { + super.initState(); + Future.delayed(Duration(milliseconds: 300), () async { + BaseModel baseModel = + await NetUtil().get(API.message.getCommentByDispatchId, params: { + "dispatchId": widget.itemModel.relationId, + }); + _model = CommentMessageDetailModel.fromJson(baseModel.data); + _onload = false; + setState(() {}); + }); + } + + @override + Widget build(BuildContext context) { + return _messageList(_model); + } + + String getComment(int level) { + switch (level) { + case 1: + return '半星'; + break; + case 2: + return '一星'; + case 3: + return '一星半'; + case 4: + return '二星'; + case 5: + return '二星半'; + case 6: + return '三星'; + case 7: + return '三星半'; + case 8: + return '四星'; + case 9: + return '四星半'; + case 10: + return '五星'; + default: + return '零星'; + } + } + + Widget _loadingWidget() { + return Column( + children: [ + Container( + margin: EdgeInsets.only(top: 24.w, bottom: 24.w), + alignment: Alignment.center, + width: double.infinity, + child: Shimmer.fromColors( + baseColor: kPrimaryColor.withOpacity(0.3), + highlightColor: kPrimaryColor.withOpacity(0.1), + child: Text( + '', + style: TextStyle(color: AppStyle.minorTextColor, fontSize: 24.sp), + ), + ), + ), + Container( + padding: EdgeInsets.only(top: 24.w, left: 24.w, right: 24.w), + color: Color(0xFFFFFFFF), + child: Shimmer.fromColors( + baseColor: kPrimaryColor.withOpacity(0.3), + highlightColor: kPrimaryColor.withOpacity(0.1), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row(children: [ + Container( + width: 16.w, + height: 16.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.w), + color: Color(0xFFFF4501)), + ), + SizedBox( + width: 16.w, + ), + Text( + '', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 32.sp, + fontWeight: FontWeight.w600), + ), + SizedBox(height: 8.w), + ]), + Text( + '', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.sp, + fontWeight: FontWeight.bold), + ), + SizedBox(height: 24.w), + Row( + children: [ + Image.asset( + R.ASSETS_MESSAGE_IC_PEOPLE_PNG, + width: 40.w, + height: 40.w, + ), + SizedBox( + width: 4.w, + ), + Text( + '', + style: TextStyle( + color: AppStyle.minorTextColor, fontSize: 28.sp), + ), + Spacer(), + Text( + '', + style: TextStyle( + color: AppStyle.primaryTextColor, fontSize: 28.sp), + ), + ], + ), + SizedBox(height: 16.w), + Row( + children: [ + Image.asset( + R.ASSETS_MESSAGE_IC_STAR_PNG, + width: 40.w, + height: 40.w, + ), + SizedBox( + width: 4.w, + ), + Text('', + style: TextStyle( + color: AppStyle.minorTextColor, fontSize: 28.sp)), + Spacer(), + Text('', + style: TextStyle( + color: AppStyle.primaryTextColor, fontSize: 28.sp)), + ], + ), + SizedBox(height: 16.w), + Divider(height: 1.w), + AkuButton( + onPressed: () {}, + child: Container( + height: 88.w, + alignment: Alignment.center, + padding: EdgeInsets.only(left: 24.w), + child: Row( + children: [ + Text( + '', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.sp), + ), + Spacer(), + Icon(Icons.arrow_forward_ios, size: 22.w), + ], + ), + ), + ), + ], + ), + ), + ), + ], + ); + } + + Widget _messageList(CommentMessageDetailModel model) { + return _onload + ? _loadingWidget() + : Column( + children: [ + Container( + margin: EdgeInsets.only(top: 24.w, bottom: 24.w), + alignment: Alignment.center, + width: double.infinity, + child: Text( + '', + style: TextStyle( + color: AppStyle.minorTextColor, fontSize: 24.sp), + ), + ), + Container( + padding: EdgeInsets.only(top: 24.w, left: 24.w, right: 24.w), + color: Color(0xFFFFFFFF), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row(children: [ + Container( + width: 16.w, + height: 16.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.w), + color: Color(0xFFFF4501)), + ), + SizedBox( + width: 16.w, + ), + Text( + '评论消息', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 32.sp, + fontWeight: FontWeight.w600), + ), + SizedBox(height: 8.w), + ]), + Text( + '你有一条新的评论消息,请立即查看', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.sp, + fontWeight: FontWeight.bold), + ), + SizedBox(height: 24.w), + Row( + children: [ + Image.asset( + R.ASSETS_MESSAGE_IC_PEOPLE_PNG, + width: 40.w, + height: 40.w, + ), + SizedBox( + width: 4.w, + ), + Text( + '评论人', + style: TextStyle( + color: AppStyle.minorTextColor, fontSize: 28.sp), + ), + Spacer(), + Text( + '${model.name}', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.sp), + ), + ], + ), + SizedBox(height: 16.w), + Row( + children: [ + Image.asset( + R.ASSETS_MESSAGE_IC_STAR_PNG, + width: 40.w, + height: 40.w, + ), + SizedBox( + width: 4.w, + ), + Text('综合评分', + style: TextStyle( + color: AppStyle.minorTextColor, + fontSize: 28.sp)), + Spacer(), + Text(getComment(model.level), + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.sp)), + ], + ), + SizedBox(height: 16.w), + Divider(height: 1.w), + AkuButton( + onPressed: () {}, + child: Container( + height: 88.w, + alignment: Alignment.center, + padding: EdgeInsets.only(left: 24.w), + child: Row( + children: [ + Text( + '查看详情', + style: TextStyle( + color: AppStyle.primaryTextColor, + fontSize: 28.sp), + ), + Spacer(), + Icon(Icons.arrow_forward_ios, size: 22.w), + ], + ), + ), + ), + ], + ), + ), + ], + ); + } +} diff --git a/pubspec.lock b/pubspec.lock index bf06d93..360945c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -620,6 +620,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" + shimmer: + dependency: "direct dev" + description: + name: shimmer + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.0-nullsafety.0" sky_engine: dependency: transitive description: flutter diff --git a/pubspec.yaml b/pubspec.yaml index 3d5974b..ddbffce 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -69,6 +69,7 @@ dev_dependencies: import_sorter: grinder: flutter_asset_generator: ^0.6.1 + shimmer: ^2.0.0-nullsafety.0 flutter: uses-material-design: true