修复话题列表的显示问题

hmxc
小赖 4 years ago
parent 4556db6f8f
commit 7e31df2bca

@ -164,7 +164,7 @@ class _Community {
String get boardDetail => '/user/announcement/findById'; String get boardDetail => '/user/announcement/findById';
/// ///
String get topicList => '/user/gambit/list'; String get topicList => '/user/gambit/listGambit';
String get eventByTopicId => '/user/gambit/listByGambitId'; String get eventByTopicId => '/user/gambit/listByGambitId';

@ -2,153 +2,52 @@ import 'package:akuCommunity/model/common/img_model.dart';
class CommunityTopicModel { class CommunityTopicModel {
int id; int id;
int createId; String title;
int isComment; String summary;
int isLike;
String createName;
String content; String content;
String gambitTitle; List<ImgModel> imgUrl;
String createDate; int activityNum;
List<LikeNames> likeNames;
List<ImgModel> imgUrls;
List<ImgModel> headSculptureImgUrl;
List<GambitThemeCommentVoList> gambitThemeCommentVoList;
String get firstImg { String get firstImg {
var firstImg = ''; if (imgUrl.isEmpty)
if (imgUrls?.isNotEmpty ?? false) { return '';
firstImg = imgUrls?.first?.url ?? ''; else
} return imgUrl.first.url;
return firstImg;
} }
CommunityTopicModel( CommunityTopicModel(
{this.id, {this.id,
this.createId, this.title,
this.isComment, this.summary,
this.isLike,
this.createName,
this.content, this.content,
this.gambitTitle, this.imgUrl,
this.createDate, this.activityNum});
this.likeNames,
this.imgUrls,
this.headSculptureImgUrl,
this.gambitThemeCommentVoList});
CommunityTopicModel.fromJson(Map<String, dynamic> json) { CommunityTopicModel.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
createId = json['createId']; title = json['title'];
isComment = json['isComment']; summary = json['summary'];
isLike = json['isLike'];
createName = json['createName'];
content = json['content']; content = json['content'];
gambitTitle = json['gambitTitle']; if (json['imgUrl'] != null) {
createDate = json['createDate']; imgUrl = new List<ImgModel>();
if (json['likeNames'] != null) { json['imgUrl'].forEach((v) {
likeNames = new List<LikeNames>(); imgUrl.add(new ImgModel.fromJson(v));
json['likeNames'].forEach((v) {
likeNames.add(new LikeNames.fromJson(v));
});
}
if (json['imgUrls'] != null) {
imgUrls = new List<ImgModel>();
json['imgUrls'].forEach((v) {
imgUrls.add(new ImgModel.fromJson(v));
}); });
} else } else
imgUrls = []; imgUrl = [];
if (json['headSculptureImgUrl'] != null) { activityNum = json['activityNum'];
headSculptureImgUrl = new List<ImgModel>();
json['headSculptureImgUrl'].forEach((v) {
headSculptureImgUrl.add(new ImgModel.fromJson(v));
});
} else
headSculptureImgUrl = [];
if (json['gambitThemeCommentVoList'] != null) {
gambitThemeCommentVoList = new List<GambitThemeCommentVoList>();
json['gambitThemeCommentVoList'].forEach((v) {
gambitThemeCommentVoList.add(new GambitThemeCommentVoList.fromJson(v));
});
}
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id; data['id'] = this.id;
data['createId'] = this.createId; data['title'] = this.title;
data['isComment'] = this.isComment; data['summary'] = this.summary;
data['isLike'] = this.isLike;
data['createName'] = this.createName;
data['content'] = this.content; data['content'] = this.content;
data['gambitTitle'] = this.gambitTitle; if (this.imgUrl != null) {
data['createDate'] = this.createDate; data['imgUrl'] = this.imgUrl.map((v) => v.toJson()).toList();
if (this.likeNames != null) {
data['likeNames'] = this.likeNames.map((v) => v.toJson()).toList();
}
if (this.imgUrls != null) {
data['imgUrls'] = this.imgUrls.map((v) => v.toJson()).toList();
}
if (this.headSculptureImgUrl != null) {
data['headSculptureImgUrl'] =
this.headSculptureImgUrl.map((v) => v.toJson()).toList();
} }
if (this.gambitThemeCommentVoList != null) { data['activityNum'] = this.activityNum;
data['gambitThemeCommentVoList'] =
this.gambitThemeCommentVoList.map((v) => v.toJson()).toList();
}
return data;
}
}
class LikeNames {
int id;
String name;
LikeNames({this.id, this.name});
LikeNames.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
return data;
}
}
class GambitThemeCommentVoList {
int id;
String parentName;
String content;
String createName;
String createDate;
GambitThemeCommentVoList(
{this.id,
this.parentName,
this.content,
this.createName,
this.createDate});
GambitThemeCommentVoList.fromJson(Map<String, dynamic> json) {
id = json['id'];
parentName = json['parentName'];
content = json['content'];
createName = json['createName'];
createDate = json['createDate'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['parentName'] = this.parentName;
data['content'] = this.content;
data['createName'] = this.createName;
data['createDate'] = this.createDate;
return data; return data;
} }
} }

@ -56,9 +56,7 @@ class _TopicCommunityViewState extends State<TopicCommunityView>
), ),
child: BackdropFilter( child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5), filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
//TODO child: ('#${model.summary}')
// model.summary
child: ('#${''}')
.text .text
.center .center
.size(28.sp) .size(28.sp)
@ -76,7 +74,7 @@ class _TopicCommunityViewState extends State<TopicCommunityView>
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
(model?.gambitTitle ?? '') (model?.title ?? '')
.text .text
.maxLines(2) .maxLines(2)
.size(28.sp) .size(28.sp)

@ -4,7 +4,6 @@ import 'package:akuCommunity/model/community/event_item_model.dart';
import 'package:akuCommunity/pages/things_page/widget/bee_list_view.dart'; import 'package:akuCommunity/pages/things_page/widget/bee_list_view.dart';
import 'package:akuCommunity/ui/community/community_views/topic/topic_sliver_header.dart'; import 'package:akuCommunity/ui/community/community_views/topic/topic_sliver_header.dart';
import 'package:akuCommunity/ui/community/community_views/widgets/chat_card.dart'; import 'package:akuCommunity/ui/community/community_views/widgets/chat_card.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';

@ -50,14 +50,11 @@ class _BeeImagePreviewState extends State<BeeImagePreview> {
onTap: Get.back, onTap: Get.back,
child: Scaffold( child: Scaffold(
backgroundColor: Colors.black54, backgroundColor: Colors.black54,
body: BackdropFilter( body: InteractiveViewer(
filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5), boundaryMargin: EdgeInsets.all(48),
child: InteractiveViewer( minScale: 0.2,
boundaryMargin: EdgeInsets.all(48), maxScale: 10,
minScale: 0.2, child: Center(child: image),
maxScale: 10,
child: Center(child: image),
),
), ),
), ),
); );

Loading…
Cancel
Save