修复消息头像显示

hmxc
小赖 4 years ago
parent 6425e6956a
commit 6baeb68cbf

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.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,
);
}

@ -1,3 +1,5 @@
import 'package:akuCommunity/model/common/img_model.dart';
class CommentMessageModel { class CommentMessageModel {
int id; int id;
int gambitThemeId; int gambitThemeId;
@ -8,7 +10,8 @@ class CommentMessageModel {
int sendStatus; int sendStatus;
String createName; String createName;
String createDate; String createDate;
List<ImgUrls> imgUrls; List<ImgModel> imgUrls;
List<ImgModel> headSculpture;
CommentMessageModel( CommentMessageModel(
{this.id, {this.id,
@ -20,7 +23,8 @@ class CommentMessageModel {
this.sendStatus, this.sendStatus,
this.createName, this.createName,
this.createDate, this.createDate,
this.imgUrls}); this.imgUrls,
this.headSculpture});
CommentMessageModel.fromJson(Map<String, dynamic> json) { CommentMessageModel.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
@ -33,9 +37,15 @@ class CommentMessageModel {
createName = json['createName']; createName = json['createName'];
createDate = json['createDate']; createDate = json['createDate'];
if (json['imgUrls'] != null) { if (json['imgUrls'] != null) {
imgUrls = new List<ImgUrls>(); imgUrls = [];
json['imgUrls'].forEach((v) { 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; 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<String, dynamic> json) {
url = json['url'];
size = json['size'];
longs = json['longs'];
paragraph = json['paragraph'];
sort = json['sort'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['url'] = this.url;
data['size'] = this.size;
data['longs'] = this.longs;
data['paragraph'] = this.paragraph;
data['sort'] = this.sort;
return data;
}
}

@ -1,3 +1,4 @@
import 'package:akuCommunity/model/common/img_model.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flustars/flustars.dart'; import 'package:flustars/flustars.dart';
@ -56,7 +57,8 @@ class _CommentMessagePageState extends State<CommentMessagePage> {
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
child: FadeInImage.assetNetwork( child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: model.imgUrls.first.url, image: API.image(ImgModel.first(model.headSculpture)),
fit: BoxFit.cover,
), ),
), ),
10.wb, 10.wb,
@ -85,7 +87,8 @@ class _CommentMessagePageState extends State<CommentMessagePage> {
height: 160.w, height: 160.w,
child: FadeInImage.assetNetwork( child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: model.imgUrls.first.url, image: API.image(ImgModel.first(model.imgUrls)),
fit: BoxFit.cover,
), ),
), ),
], ],

@ -1,3 +1,4 @@
import 'package:akuCommunity/constants/app_theme.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -33,7 +34,7 @@ class _TopicDetailPageState extends State<TopicDetailPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AnnotatedRegion<SystemUiOverlayStyle>( return AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle.light, value: SystemStyle.lightStatusBar,
child: Scaffold( child: Scaffold(
floatingActionButton: FloatingActionButton( floatingActionButton: FloatingActionButton(
heroTag: 'event_add', heroTag: 'event_add',

@ -100,7 +100,7 @@ class NoticeCard extends StatelessWidget {
tag: ImgModel.first(model.imgUrls), tag: ImgModel.first(model.imgUrls),
child: FadeInImage.assetNetwork( child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: ImgModel.first(model.imgUrls), image: API.image(ImgModel.first(model.imgUrls)),
width: 152.w, width: 152.w,
height: 152.w, height: 152.w,
fit: BoxFit.cover, fit: BoxFit.cover,

@ -19,7 +19,6 @@ class HomeNotification extends StatefulWidget {
} }
class _HomeNotificationState extends State<HomeNotification> { class _HomeNotificationState extends State<HomeNotification> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Row( return Row(
@ -38,8 +37,12 @@ class _HomeNotificationState extends State<HomeNotification> {
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
height: 85.w, height: 85.w,
child: AnimatedTextKit( child: AnimatedTextKit(
pause: Duration(milliseconds: 2000),
animatedTexts: widget.items animatedTexts: widget.items
.map((e) => RotateAnimatedText(e.title)) .map((e) => RotateAnimatedText(
e.title,
duration: Duration(milliseconds: 3000),
))
.toList(), .toList(),
repeatForever: true, repeatForever: true,
), ),

Loading…
Cancel
Save