From 9069975bf0dc4f8c0ce71e6ef9941c2cfd3137b9 Mon Sep 17 00:00:00 2001 From: ashilkn Date: Mon, 26 May 2025 19:22:51 +0530 Subject: [PATCH] Avoid confusion on empty widget settings pages --- .../ui/settings/widgets/albums_widget_settings.dart | 12 +++--------- .../settings/widgets/memories_widget_settings.dart | 11 +++-------- .../ui/settings/widgets/people_widget_settings.dart | 10 +++------- 3 files changed, 9 insertions(+), 24 deletions(-) diff --git a/mobile/lib/ui/settings/widgets/albums_widget_settings.dart b/mobile/lib/ui/settings/widgets/albums_widget_settings.dart index cbf250986e..76aafb7c7c 100644 --- a/mobile/lib/ui/settings/widgets/albums_widget_settings.dart +++ b/mobile/lib/ui/settings/widgets/albums_widget_settings.dart @@ -6,7 +6,6 @@ import "package:photos/models/selected_albums.dart"; import "package:photos/services/album_home_widget_service.dart"; import "package:photos/services/collections_service.dart"; import "package:photos/services/favorites_service.dart"; -import 'package:photos/theme/ente_theme.dart'; import "package:photos/ui/collections/flex_grid_view.dart"; import "package:photos/ui/common/loading_widget.dart"; import "package:photos/ui/components/buttons/button_widget.dart"; @@ -85,7 +84,6 @@ class _AlbumsWidgetSettingsState extends State { @override Widget build(BuildContext context) { - final textTheme = getEnteTextTheme(context); return Scaffold( bottomNavigationBar: hasInstalledAny ? Padding( @@ -122,7 +120,9 @@ class _AlbumsWidgetSettingsState extends State { title: S.of(context).albums, ), expandedHeight: 120, - flexibleSpaceCaption: S.of(context).albumsWidgetDesc, + flexibleSpaceCaption: hasInstalledAny + ? S.of(context).albumsWidgetDesc + : "Add an album widget to your homescreen and come back here to customize", actionIcons: [ IconButtonWidget( icon: Icons.close_outlined, @@ -150,12 +150,6 @@ class _AlbumsWidgetSettingsState extends State { "assets/albums-widget-static.png", height: 160, ), - const SizedBox(height: 20), - Text( - "Add an album widget to your homescreen and come back here to customize", - style: textTheme.smallFaint, - textAlign: TextAlign.center, - ), ], ), ), diff --git a/mobile/lib/ui/settings/widgets/memories_widget_settings.dart b/mobile/lib/ui/settings/widgets/memories_widget_settings.dart index 542e7b6ea5..8306a47c62 100644 --- a/mobile/lib/ui/settings/widgets/memories_widget_settings.dart +++ b/mobile/lib/ui/settings/widgets/memories_widget_settings.dart @@ -88,7 +88,6 @@ class _MemoriesWidgetSettingsState extends State { @override Widget build(BuildContext context) { - final textTheme = getEnteTextTheme(context); final colorScheme = getEnteColorScheme(context); return Scaffold( @@ -100,7 +99,9 @@ class _MemoriesWidgetSettingsState extends State { title: S.of(context).memories, ), expandedHeight: 120, - flexibleSpaceCaption: S.of(context).memoriesWidgetDesc, + flexibleSpaceCaption: hasInstalledAny + ? S.of(context).memoriesWidgetDesc + : "Add a memories widget to your homescreen and come back here to customize", actionIcons: [ IconButtonWidget( icon: Icons.close_outlined, @@ -128,12 +129,6 @@ class _MemoriesWidgetSettingsState extends State { "assets/memories-widget-static.png", height: 160, ), - const SizedBox(height: 20), - Text( - "Add a memories widget to your homescreen and come back here to customize", - style: textTheme.smallFaint, - textAlign: TextAlign.center, - ), ], ), ), diff --git a/mobile/lib/ui/settings/widgets/people_widget_settings.dart b/mobile/lib/ui/settings/widgets/people_widget_settings.dart index d420ebfba5..c77b1ed2e9 100644 --- a/mobile/lib/ui/settings/widgets/people_widget_settings.dart +++ b/mobile/lib/ui/settings/widgets/people_widget_settings.dart @@ -94,7 +94,9 @@ class _PeopleWidgetSettingsState extends State { title: S.of(context).people, ), expandedHeight: 120, - flexibleSpaceCaption: S.of(context).peopleWidgetDesc, + flexibleSpaceCaption: hasInstalledAny + ? S.of(context).peopleWidgetDesc + : "Add a people widget to your homescreen and come back here to customize.", actionIcons: [ IconButtonWidget( icon: Icons.close_outlined, @@ -122,12 +124,6 @@ class _PeopleWidgetSettingsState extends State { "assets/people-widget-static.png", height: 160, ), - const SizedBox(height: 20), - Text( - "Add a people widget to your homescreen and come back here to customize", - style: textTheme.smallFaint, - textAlign: TextAlign.center, - ), ], ), ),