修复话题列表的显示问题

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

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

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

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

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

Loading…
Cancel
Save