mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-23 22:12:34 +01:00
chore: Follow up null safety fixes
This commit is contained in:
parent
566b9155d1
commit
79a2db9e63
@ -76,15 +76,17 @@ class HtmlMessage extends StatelessWidget {
|
||||
onImageTap: (String mxc) => showDialog(
|
||||
context: Matrix.of(context).navigatorContext,
|
||||
useRootNavigator: false,
|
||||
builder: (_) => ImageViewer(Event.fromJson({
|
||||
'type': EventTypes.Message,
|
||||
'content': <String, dynamic>{
|
||||
'body': mxc,
|
||||
'url': mxc,
|
||||
'msgtype': MessageTypes.Image,
|
||||
},
|
||||
'event_id': 'fake_event',
|
||||
}, room))),
|
||||
builder: (_) => ImageViewer(Event(
|
||||
type: EventTypes.Message,
|
||||
content: <String, dynamic>{
|
||||
'body': mxc,
|
||||
'url': mxc,
|
||||
'msgtype': MessageTypes.Image,
|
||||
},
|
||||
senderId: room.client.userID!,
|
||||
originServerTs: DateTime.now(),
|
||||
eventId: 'fake_event',
|
||||
room: room))),
|
||||
setCodeLanguage: (String key, String value) async {
|
||||
await matrix.store.setItem('${SettingKeys.codeLanguage}.$key', value);
|
||||
},
|
||||
|
@ -63,14 +63,17 @@ class StickerPickerDialogState extends State<StickerPickerDialog> {
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemBuilder: (BuildContext context, int imageIndex) {
|
||||
final image = pack.images[imageKeys[imageIndex]]!;
|
||||
final fakeEvent = Event.fromJson(<String, dynamic>{
|
||||
'type': EventTypes.Sticker,
|
||||
'content': <String, dynamic>{
|
||||
final fakeEvent = Event(
|
||||
type: EventTypes.Sticker,
|
||||
content: {
|
||||
'url': image.url.toString(),
|
||||
'info': image.info,
|
||||
},
|
||||
'event_id': 'fake_event',
|
||||
}, widget.room);
|
||||
originServerTs: DateTime.now(),
|
||||
room: widget.room,
|
||||
eventId: 'fake_event',
|
||||
senderId: widget.room.client.userID!,
|
||||
);
|
||||
return InkWell(
|
||||
key: ValueKey(image.url.toString()),
|
||||
onTap: () {
|
||||
|
@ -33,10 +33,10 @@ class EmotesSettingsController extends State<EmotesSettings> {
|
||||
final event = (room != null
|
||||
? room!.getState('im.ponies.room_emotes', stateKey ?? '')
|
||||
: client.accountData['im.ponies.user_emotes']) ??
|
||||
BasicEvent.fromJson(<String, dynamic>{
|
||||
'type': 'm.dummy',
|
||||
'content': <String, dynamic>{},
|
||||
});
|
||||
BasicEvent(
|
||||
type: 'm.dummy',
|
||||
content: {},
|
||||
);
|
||||
// make sure we work on a *copy* of the event
|
||||
return BasicEvent.fromJson(event.toJson()).parsedImagePackContent;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user