mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 07:47:24 +00:00
Fix comment overflow. Close #237
This commit is contained in:
@@ -651,10 +651,16 @@ class _CommentImage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class RichCommentContent extends StatefulWidget {
|
class RichCommentContent extends StatefulWidget {
|
||||||
const RichCommentContent({super.key, required this.text});
|
const RichCommentContent({
|
||||||
|
super.key,
|
||||||
|
required this.text,
|
||||||
|
this.showImages = true,
|
||||||
|
});
|
||||||
|
|
||||||
final String text;
|
final String text;
|
||||||
|
|
||||||
|
final bool showImages;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<RichCommentContent> createState() => _RichCommentContentState();
|
State<RichCommentContent> createState() => _RichCommentContentState();
|
||||||
}
|
}
|
||||||
@@ -808,7 +814,7 @@ class _RichCommentContentState extends State<RichCommentContent> {
|
|||||||
children: textSpan,
|
children: textSpan,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
if (images.isNotEmpty) {
|
if (images.isNotEmpty && widget.showImages) {
|
||||||
content = Column(
|
content = Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
|
@@ -138,7 +138,10 @@ class _CommentWidget extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: RichCommentContent(text: comment.content).fixWidth(324),
|
child: RichCommentContent(
|
||||||
|
text: comment.content,
|
||||||
|
showImages: false,
|
||||||
|
).fixWidth(324),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
if (comment.time != null)
|
if (comment.time != null)
|
||||||
@@ -147,4 +150,4 @@ class _CommentWidget extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user