From 6f32eb89722d4ed39a106ab7f3cafac5ffaa4497 Mon Sep 17 00:00:00 2001 From: Welton Moura Date: Fri, 25 Sep 2026 13:15:03 -0300 Subject: [PATCH] fix: incluir o wallpaper padrao no bundle e mostrar na previa O Flutter nao empacota subdirectorios de forma recursiva, e assets/logo/ nao estava listado no pubspec, portanto assets/logo/background.png nunca chegava ao bundle e o wallpaper padrao das conversas nao aparecia. - pubspec: declara assets/logo/background.png - chat_view: normaliza o path do asset - settings_style_view: a previa passa a mostrar o wallpaper padrao quando nao ha imagem custom, com opacidade 0.3 e sem blur, em vez de ficar sem fundo --- lib/pages/chat/chat_view.dart | 2 +- .../settings_style/settings_style_view.dart | 58 +++++++++++-------- pubspec.yaml | 1 + 3 files changed, 36 insertions(+), 25 deletions(-) diff --git a/lib/pages/chat/chat_view.dart b/lib/pages/chat/chat_view.dart index 39a2517..7772f00 100644 --- a/lib/pages/chat/chat_view.dart +++ b/lib/pages/chat/chat_view.dart @@ -377,7 +377,7 @@ class ChatView extends StatelessWidget { placeholder: (_) => Container(), ) : Image.asset( - './assets/logo/background.png', + 'assets/logo/background.png', fit: BoxFit.cover, height: MediaQuery.sizeOf(context).height, width: MediaQuery.sizeOf(context).width, diff --git a/lib/pages/settings_style/settings_style_view.dart b/lib/pages/settings_style/settings_style_view.dart index 3587275..97a6062 100644 --- a/lib/pages/settings_style/settings_style_view.dart +++ b/lib/pages/settings_style/settings_style_view.dart @@ -176,24 +176,38 @@ class SettingsStyleView extends StatelessWidget { child: Stack( alignment: Alignment.center, children: [ - if (accountConfig.wallpaperUrl != null) - Opacity( - opacity: controller.wallpaperOpacity, - child: ImageFiltered( - imageFilter: ImageFilter.blur( - sigmaX: controller.wallpaperBlur, - sigmaY: controller.wallpaperBlur, - ), - child: MxcImage( - key: ValueKey(accountConfig.wallpaperUrl), - uri: accountConfig.wallpaperUrl, - fit: BoxFit.cover, - isThumbnail: true, - width: FluffyThemes.columnWidth * 2, - height: 212, - ), + Opacity( + opacity: accountConfig.wallpaperUrl != null + ? controller.wallpaperOpacity + : 0.3, + child: ImageFiltered( + imageFilter: ImageFilter.blur( + sigmaX: accountConfig.wallpaperUrl != null + ? controller.wallpaperBlur + : 0.0, + sigmaY: accountConfig.wallpaperUrl != null + ? controller.wallpaperBlur + : 0.0, ), + child: accountConfig.wallpaperUrl != null + ? MxcImage( + key: ValueKey( + accountConfig.wallpaperUrl, + ), + uri: accountConfig.wallpaperUrl, + fit: BoxFit.cover, + isThumbnail: true, + width: FluffyThemes.columnWidth * 2, + height: 212, + ) + : Image.asset( + 'assets/logo/background.png', + fit: BoxFit.cover, + width: FluffyThemes.columnWidth * 2, + height: 212, + ), ), + ), Column( mainAxisSize: .min, children: [ @@ -213,12 +227,10 @@ class SettingsStyleView extends StatelessWidget { ), ), Padding( - padding: EdgeInsets.only( + padding: const EdgeInsets.only( left: 12 + 12 + Avatar.defaultSize, right: 12, - top: accountConfig.wallpaperUrl == null - ? 0 - : 12, + top: 12, bottom: 12, ), child: DecoratedBox( @@ -246,12 +258,10 @@ class SettingsStyleView extends StatelessWidget { Align( alignment: Alignment.centerLeft, child: Padding( - padding: EdgeInsets.only( + padding: const EdgeInsets.only( right: 12, left: 12, - top: accountConfig.wallpaperUrl == null - ? 0 - : 12, + top: 12, bottom: 12, ), child: Material( diff --git a/pubspec.yaml b/pubspec.yaml index d667f11..a3e1e49 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -118,6 +118,7 @@ flutter: uses-material-design: true assets: - assets/ + - assets/logo/background.png - assets/logo/mini/ - assets/miniapps/ - assets/sounds/