Skip to content

Commit d2bbe37

Browse files
committed
一部のページが開けない問題を修正
1 parent 366d2d2 commit d2bbe37

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

lib/view/misskey_page_page/misskey_page_page.dart

+8-9
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ class PageContent extends ConsumerWidget {
125125
@override
126126
Widget build(BuildContext context, WidgetRef ref) {
127127
final content = this.content;
128-
if (content is misskey.PageText) {
128+
if (content case misskey.PageText(:final text?)) {
129129
final account = AccountScope.of(context);
130-
final nodes = const MfmParser().parse(content.text);
130+
final nodes = const MfmParser().parse(text);
131131
return Column(
132132
children: [
133133
MfmText(
@@ -143,12 +143,11 @@ class PageContent extends ConsumerWidget {
143143
],
144144
);
145145
}
146-
if (content is misskey.PageImage) {
147-
final url = page.attachedFiles
148-
.firstWhereOrNull((e) => e.id == content.fileId)
149-
?.url;
146+
if (content case misskey.PageImage(:final fileId?)) {
147+
final url =
148+
page.attachedFiles.firstWhereOrNull((e) => e.id == fileId)?.url;
150149
final thumbnailUrl = page.attachedFiles
151-
.firstWhereOrNull((e) => e.id == content.fileId)
150+
.firstWhereOrNull((e) => e.id == fileId)
152151
?.thumbnailUrl;
153152
if (url != null) {
154153
return GestureDetector(
@@ -162,14 +161,14 @@ class PageContent extends ConsumerWidget {
162161
return const SizedBox.shrink();
163162
}
164163
}
165-
if (content is misskey.PageNote) {
164+
if (content case misskey.PageNote(note: final noteId?)) {
166165
return FutureBuilder(
167166
future: (() async {
168167
final account = AccountScope.of(context);
169168
final note = await ref
170169
.read(misskeyProvider(account))
171170
.notes
172-
.show(misskey.NotesShowRequest(noteId: content.note));
171+
.show(misskey.NotesShowRequest(noteId: noteId));
173172
ref.read(notesProvider(account)).registerNote(note);
174173
return note;
175174
})(),

0 commit comments

Comments
 (0)