From 6d6d6c6f041cd9eb2e309026b53877e890e44690 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Sun, 13 Nov 2022 12:47:45 +0100 Subject: [PATCH] fix: Settings profile picture --- lib/widgets/content_banner.dart | 9 +-------- lib/widgets/matrix.dart | 10 ++++++---- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/lib/widgets/content_banner.dart b/lib/widgets/content_banner.dart index 3059357a2..fb6ed90af 100644 --- a/lib/widgets/content_banner.dart +++ b/lib/widgets/content_banner.dart @@ -47,19 +47,12 @@ class ContentBanner extends StatelessWidget { return Hero( tag: heroTag, child: MxcImage( + key: Key(mxContent?.toString() ?? 'NoKey'), uri: mxContent, animated: true, fit: BoxFit.cover, height: 400, width: 800, - placeholder: (c) => Center( - child: Icon( - defaultIcon, - size: 200, - color: - Theme.of(context).colorScheme.onSecondaryContainer, - ), - ), ), ); }), diff --git a/lib/widgets/matrix.dart b/lib/widgets/matrix.dart index 3dfca3ab1..238ccdb29 100644 --- a/lib/widgets/matrix.dart +++ b/lib/widgets/matrix.dart @@ -492,10 +492,12 @@ class MatrixState extends State with WidgetsBindingObserver { if (value != null && int.tryParse(value) != null) { AppConfig.colorSchemeSeed = Color(int.parse(value)); WidgetsBinding.instance.addPostFrameCallback((_) { - AdaptiveTheme.of(context).setTheme( - light: FluffyThemes.buildTheme(Brightness.light), - dark: FluffyThemes.buildTheme(Brightness.dark), - ); + if (mounted) { + AdaptiveTheme.of(context).setTheme( + light: FluffyThemes.buildTheme(Brightness.light), + dark: FluffyThemes.buildTheme(Brightness.dark), + ); + } }); } });