@@ -125,9 +125,9 @@ class PageContent extends ConsumerWidget {
125
125
@override
126
126
Widget build (BuildContext context, WidgetRef ref) {
127
127
final content = this .content;
128
- if (content is misskey.PageText ) {
128
+ if (content case misskey.PageText ( : final text ? ) ) {
129
129
final account = AccountScope .of (context);
130
- final nodes = const MfmParser ().parse (content. text);
130
+ final nodes = const MfmParser ().parse (text);
131
131
return Column (
132
132
children: [
133
133
MfmText (
@@ -143,12 +143,11 @@ class PageContent extends ConsumerWidget {
143
143
],
144
144
);
145
145
}
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;
150
149
final thumbnailUrl = page.attachedFiles
151
- .firstWhereOrNull ((e) => e.id == content. fileId)
150
+ .firstWhereOrNull ((e) => e.id == fileId)
152
151
? .thumbnailUrl;
153
152
if (url != null ) {
154
153
return GestureDetector (
@@ -162,14 +161,14 @@ class PageContent extends ConsumerWidget {
162
161
return const SizedBox .shrink ();
163
162
}
164
163
}
165
- if (content is misskey.PageNote ) {
164
+ if (content case misskey.PageNote (note : final noteId ? ) ) {
166
165
return FutureBuilder (
167
166
future: (() async {
168
167
final account = AccountScope .of (context);
169
168
final note = await ref
170
169
.read (misskeyProvider (account))
171
170
.notes
172
- .show (misskey.NotesShowRequest (noteId: content.note ));
171
+ .show (misskey.NotesShowRequest (noteId: noteId ));
173
172
ref.read (notesProvider (account)).registerNote (note);
174
173
return note;
175
174
})(),
0 commit comments