From 6baeb68cbf1b63c964ebf990cbca79695626e562 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Fri, 2 Apr 2021 11:50:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B6=88=E6=81=AF=E5=A4=B4?= =?UTF-8?q?=E5=83=8F=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/constants/app_theme.dart | 8 ++++ lib/model/message/comment_message_model.dart | 46 ++++++------------- .../comment_message/comment_message_page.dart | 7 ++- .../topic/topic_detail_page.dart | 3 +- lib/ui/community/notice/notice_card.dart | 2 +- lib/ui/home/home_notification.dart | 7 ++- 6 files changed, 35 insertions(+), 38 deletions(-) diff --git a/lib/constants/app_theme.dart b/lib/constants/app_theme.dart index 25244a9e..475a4d21 100644 --- a/lib/constants/app_theme.dart +++ b/lib/constants/app_theme.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -108,3 +109,10 @@ class AppTheme { ); } } + +class SystemStyle { + static const lightStatusBar = SystemUiOverlayStyle( + statusBarIconBrightness: Brightness.light, + systemNavigationBarColor: Colors.white, + ); +} diff --git a/lib/model/message/comment_message_model.dart b/lib/model/message/comment_message_model.dart index e9e7cbde..fe66c058 100644 --- a/lib/model/message/comment_message_model.dart +++ b/lib/model/message/comment_message_model.dart @@ -1,3 +1,5 @@ +import 'package:akuCommunity/model/common/img_model.dart'; + class CommentMessageModel { int id; int gambitThemeId; @@ -8,7 +10,8 @@ class CommentMessageModel { int sendStatus; String createName; String createDate; - List imgUrls; + List imgUrls; + List headSculpture; CommentMessageModel( {this.id, @@ -20,7 +23,8 @@ class CommentMessageModel { this.sendStatus, this.createName, this.createDate, - this.imgUrls}); + this.imgUrls, + this.headSculpture}); CommentMessageModel.fromJson(Map json) { id = json['id']; @@ -33,9 +37,15 @@ class CommentMessageModel { createName = json['createName']; createDate = json['createDate']; if (json['imgUrls'] != null) { - imgUrls = new List(); + imgUrls = []; json['imgUrls'].forEach((v) { - imgUrls.add(new ImgUrls.fromJson(v)); + imgUrls.add(new ImgModel.fromJson(v)); + }); + } + if (json['headSculpture'] != null) { + headSculpture = []; + json['headSculpture'].forEach((v) { + headSculpture.add(new ImgModel.fromJson(v)); }); } } @@ -57,31 +67,3 @@ class CommentMessageModel { return data; } } - -class ImgUrls { - String url; - String size; - int longs; - int paragraph; - int sort; - - ImgUrls({this.url, this.size, this.longs, this.paragraph, this.sort}); - - ImgUrls.fromJson(Map json) { - url = json['url']; - size = json['size']; - longs = json['longs']; - paragraph = json['paragraph']; - sort = json['sort']; - } - - Map toJson() { - final Map data = new Map(); - data['url'] = this.url; - data['size'] = this.size; - data['longs'] = this.longs; - data['paragraph'] = this.paragraph; - data['sort'] = this.sort; - return data; - } -} diff --git a/lib/pages/message_center_page/comment_message/comment_message_page.dart b/lib/pages/message_center_page/comment_message/comment_message_page.dart index 65e14a77..989c8192 100644 --- a/lib/pages/message_center_page/comment_message/comment_message_page.dart +++ b/lib/pages/message_center_page/comment_message/comment_message_page.dart @@ -1,3 +1,4 @@ +import 'package:akuCommunity/model/common/img_model.dart'; import 'package:flutter/material.dart'; import 'package:flustars/flustars.dart'; @@ -56,7 +57,8 @@ class _CommentMessagePageState extends State { clipBehavior: Clip.antiAlias, child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: model.imgUrls.first.url, + image: API.image(ImgModel.first(model.headSculpture)), + fit: BoxFit.cover, ), ), 10.wb, @@ -85,7 +87,8 @@ class _CommentMessagePageState extends State { height: 160.w, child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: model.imgUrls.first.url, + image: API.image(ImgModel.first(model.imgUrls)), + fit: BoxFit.cover, ), ), ], diff --git a/lib/ui/community/community_views/topic/topic_detail_page.dart b/lib/ui/community/community_views/topic/topic_detail_page.dart index a364d232..780c30e5 100644 --- a/lib/ui/community/community_views/topic/topic_detail_page.dart +++ b/lib/ui/community/community_views/topic/topic_detail_page.dart @@ -1,3 +1,4 @@ +import 'package:akuCommunity/constants/app_theme.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -33,7 +34,7 @@ class _TopicDetailPageState extends State { @override Widget build(BuildContext context) { return AnnotatedRegion( - value: SystemUiOverlayStyle.light, + value: SystemStyle.lightStatusBar, child: Scaffold( floatingActionButton: FloatingActionButton( heroTag: 'event_add', diff --git a/lib/ui/community/notice/notice_card.dart b/lib/ui/community/notice/notice_card.dart index eeea3df3..1332e6bb 100644 --- a/lib/ui/community/notice/notice_card.dart +++ b/lib/ui/community/notice/notice_card.dart @@ -100,7 +100,7 @@ class NoticeCard extends StatelessWidget { tag: ImgModel.first(model.imgUrls), child: FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: ImgModel.first(model.imgUrls), + image: API.image(ImgModel.first(model.imgUrls)), width: 152.w, height: 152.w, fit: BoxFit.cover, diff --git a/lib/ui/home/home_notification.dart b/lib/ui/home/home_notification.dart index a2f44d7c..6bfd702b 100644 --- a/lib/ui/home/home_notification.dart +++ b/lib/ui/home/home_notification.dart @@ -19,7 +19,6 @@ class HomeNotification extends StatefulWidget { } class _HomeNotificationState extends State { - @override Widget build(BuildContext context) { return Row( @@ -38,8 +37,12 @@ class _HomeNotificationState extends State { alignment: Alignment.centerLeft, height: 85.w, child: AnimatedTextKit( + pause: Duration(milliseconds: 2000), animatedTexts: widget.items - .map((e) => RotateAnimatedText(e.title)) + .map((e) => RotateAnimatedText( + e.title, + duration: Duration(milliseconds: 3000), + )) .toList(), repeatForever: true, ),