Skip to content

Commit

Permalink
caption suit
Browse files Browse the repository at this point in the history
  • Loading branch information
Notsfsssf committed May 19, 2024
1 parent f822507 commit a6019ef
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/page/picture/illust_detail_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class _IllustDetailContentState extends State<IllustDetailContent> {
@override
void didUpdateWidget(covariant IllustDetailContent oldWidget) {
super.didUpdateWidget(oldWidget);
if (oldWidget.illusts.caption.isNotEmpty &&
if (widget.illusts.caption.isNotEmpty &&
widget.illusts.caption != oldWidget.illusts.caption) {
setState(() {
_illusts = widget.illusts;
Expand Down Expand Up @@ -259,8 +259,10 @@ class _IllustDetailContentState extends State<IllustDetailContent> {
}

Widget _buildCaptionArea(Illusts data) {
if (data.caption.isEmpty == true &&
_illustStore?.captionFetchError == true) {
final caption = data.caption.isEmpty
? _illustStore?.illusts?.caption ?? ""
: data.caption;
if (caption.isEmpty && _illustStore?.captionFetchError == true) {
return Container(
margin: EdgeInsets.only(top: 4),
child: Container(
Expand All @@ -274,7 +276,7 @@ class _IllustDetailContentState extends State<IllustDetailContent> {
),
);
}
if (data.caption.isEmpty && _illustStore?.captionFetching == true) {
if (caption.isEmpty && _illustStore?.captionFetching == true) {
return Container(
child: Center(
child: Padding(
Expand All @@ -283,7 +285,7 @@ class _IllustDetailContentState extends State<IllustDetailContent> {
),
));
}
if (data.caption.isEmpty) {
if (caption.isEmpty) {
return Container(height: 1);
}
return Container(
Expand All @@ -308,7 +310,7 @@ class _IllustDetailContentState extends State<IllustDetailContent> {
return _buildSelectionMenu(selectableRegionState, context);
},
child: SelectableHtml(
data: data.caption.isEmpty ? "~" : data.caption,
data: caption.isEmpty ? "~" : caption,
),
),
),
Expand Down

0 comments on commit a6019ef

Please sign in to comment.