refactor: Null safe dependencies

This commit is contained in:
Christian Pauly 2021-04-21 14:19:54 +02:00
commit 1a477adcb1
34 changed files with 320 additions and 381 deletions

View file

@ -80,9 +80,10 @@ class _ImageBubbleState extends State<ImageBubble> {
@override
void initState() {
thumbnailUrl =
widget.event.getAttachmentUrl(getThumbnail: true, animated: true);
attachmentUrl = widget.event.getAttachmentUrl(animated: true);
thumbnailUrl = widget.event
.getAttachmentUrl(getThumbnail: true, animated: true)
.toString();
attachmentUrl = widget.event.getAttachmentUrl(animated: true).toString();
if (thumbnailUrl == null) {
_requestFile(getThumbnail: true);
}
@ -195,12 +196,15 @@ class _ImageBubbleState extends State<ImageBubble> {
_requestedThumbnailOnFailure = true;
WidgetsBinding.instance.addPostFrameCallback((_) {
setState(() {
thumbnailUrl = widget.event.getAttachmentUrl(
getThumbnail: true,
useThumbnailMxcUrl: true,
animated: true);
thumbnailUrl = widget.event
.getAttachmentUrl(
getThumbnail: true,
useThumbnailMxcUrl: true,
animated: true)
.toString();
attachmentUrl = widget.event
.getAttachmentUrl(useThumbnailMxcUrl: true, animated: true);
.getAttachmentUrl(useThumbnailMxcUrl: true, animated: true)
.toString();
});
});
}