π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Share settings item across mobile apps
Neeraj Gupta7a2cb7e9ac4a
diff --git a/mobile/apps/auth/lib/ui/settings/about_settings_page.dart b/mobile/apps/auth/lib/ui/settings/about_settings_page.dartindex ad441b09fd..1ff90f9f12 100644--- a/mobile/apps/auth/lib/ui/settings/about_settings_page.dart+++ b/mobile/apps/auth/lib/ui/settings/about_settings_page.dart@@ -1,6 +1,5 @@import 'package:ente_auth/services/update_service.dart';import 'package:ente_auth/ui/settings/app_update_dialog.dart';-import 'package:ente_auth/ui/settings/components/auth_settings_item.dart';import 'package:ente_auth/ui/settings/components/auth_settings_page_scaffold.dart';import 'package:ente_auth/utils/dialog_util.dart';import 'package:ente_auth/utils/platform_util.dart';@@ -19,7 +18,7 @@ class AboutSettingsPage extends StatelessWidget {return AuthSettingsPageScaffold(title: l10n.about,children: [- AuthSettingsItem(+ SettingsItem(title: l10n.weAreOpenSource,icon: HugeIcons.strokeRoundedGithub,showOnlyLoadingState: true,@@ -27,21 +26,21 @@ class AboutSettingsPage extends StatelessWidget {PlatformUtil.openUrlInBrowser('https://github.com/ente/ente'),),const SizedBox(height: Spacing.sm),- AuthSettingsItem(+ SettingsItem(title: l10n.blog,icon: HugeIcons.strokeRoundedPencilEdit01,showOnlyLoadingState: true,onTap: () => PlatformUtil.openUrlInBrowser('https://ente.com/blog'),),const SizedBox(height: Spacing.sm),- AuthSettingsItem(+ SettingsItem(title: l10n.merchandise,icon: HugeIcons.strokeRoundedShoppingBag01,showOnlyLoadingState: true,onTap: () => PlatformUtil.openUrlInBrowser('https://shop.ente.com'),),const SizedBox(height: Spacing.sm),- AuthSettingsItem(+ SettingsItem(title: l10n.privacy,icon: HugeIcons.strokeRoundedShield01,showOnlyLoadingState: true,@@ -49,7 +48,7 @@ class AboutSettingsPage extends StatelessWidget {PlatformUtil.openUrlInBrowser('https://ente.com/privacy'),),const SizedBox(height: Spacing.sm),- AuthSettingsItem(+ SettingsItem(title: l10n.termsOfServicesTitle,icon: HugeIcons.strokeRoundedFile01,showOnlyLoadingState: true,@@ -57,7 +56,7 @@ class AboutSettingsPage extends StatelessWidget {),if (UpdateService.instance.supportsInAppUpdates()) ...[const SizedBox(height: Spacing.sm),- AuthSettingsItem(+ SettingsItem(title: l10n.checkForUpdates,icon: HugeIcons.strokeRoundedDownload04,showOnlyLoadingState: true,diff --git a/mobile/apps/auth/lib/ui/settings/account_settings_page.dart b/mobile/apps/auth/lib/ui/settings/account_settings_page.dartindex 47d4e5ce98..1cd93d98b6 100644--- a/mobile/apps/auth/lib/ui/settings/account_settings_page.dart+++ b/mobile/apps/auth/lib/ui/settings/account_settings_page.dart@@ -6,7 +6,6 @@ import 'package:ente_accounts/pages/password_entry_page.dart';import 'package:ente_auth/core/configuration.dart';import 'package:ente_auth/ui/components/recovery_key_sheet.dart';import 'package:ente_auth/ui/home_page.dart';-import 'package:ente_auth/ui/settings/components/auth_settings_item.dart';import 'package:ente_auth/ui/settings/components/auth_settings_page_scaffold.dart';import 'package:ente_auth/utils/dialog_util.dart';import 'package:ente_components/ente_components.dart';@@ -25,25 +24,25 @@ class AccountSettingsPage extends StatelessWidget {return AuthSettingsPageScaffold(title: l10n.account,children: [- AuthSettingsItem(+ SettingsItem(title: l10n.changeEmail,icon: HugeIcons.strokeRoundedMailEdit01,onTap: () => _changeEmail(context),),const SizedBox(height: Spacing.sm),- AuthSettingsItem(+ SettingsItem(title: l10n.changePassword,icon: HugeIcons.strokeRoundedLockPassword,onTap: () => _changePassword(context),),const SizedBox(height: Spacing.sm),- AuthSettingsItem(+ SettingsItem(title: l10n.recoveryKey,icon: HugeIcons.strokeRoundedKey01,onTap: () => _showRecoveryKey(context),),const SizedBox(height: Spacing.sm),- AuthSettingsItem(+ SettingsItem(title: l10n.deleteAccount,icon: HugeIcons.strokeRoundedDelete02,isDestructive: true,diff --git a/mobile/apps/auth/lib/ui/settings/components/auth_settings_item.dart b/mobile/apps/auth/lib/ui/settings/components/auth_settings_item.dartdeleted file mode 100644index a16616805d..0000000000--- a/mobile/apps/auth/lib/ui/settings/components/auth_settings_item.dart+++ /dev/null@@ -1,77 +0,0 @@-import 'dart:async';--import 'package:ente_components/ente_components.dart';-import 'package:flutter/material.dart';-import 'package:hugeicons/hugeicons.dart';--/// Auth-local settings composition built from Ente's shared menu primitive.-///-/// Keep this local until the team decides whether the Photos and Locker-/// settings wrappers should be consolidated in `ente_components`.-class AuthSettingsItem extends StatelessWidget {- const AuthSettingsItem({- super.key,- required this.title,- this.subtitle,- this.icon,- this.trailing,- this.onTap,- this.onDoubleTap,- this.showChevron = true,- this.isDestructive = false,- this.showOnlyLoadingState = false,- this.semanticsIdentifier,- });-- final String title;- final String? subtitle;- final List<List<dynamic>>? icon;- final Widget? trailing;- final FutureOr<void> Function()? onTap;- final FutureOr<void> Function()? onDoubleTap;- final bool showChevron;- final bool isDestructive;- final bool showOnlyLoadingState;- final String? semanticsIdentifier;-- @override- Widget build(BuildContext context) {- final colors = context.componentColors;- final foregroundColor = isDestructive ? colors.warning : colors.textBase;- final iconColor = isDestructive ? colors.warning : colors.textLight;-- final item = MenuComponent(- title: title,- subtitle: subtitle,- titleColor: foregroundColor,- iconColor: iconColor,- leading: _leadingIcon(iconColor),- trailing: trailing ?? (showChevron ? _chevron(colors) : null),- showOnlyLoadingState: showOnlyLoadingState,- onTap: onTap,- onDoubleTap: onDoubleTap,- );- final identifier = semanticsIdentifier;- return identifier == null- ? item- : Semantics(identifier: identifier, child: item);- }-- Widget? _leadingIcon(Color color) {- if (icon == null) return null;- return HugeIcon(- icon: icon!,- color: color,- size: IconSizes.small,- strokeWidth: 1.6,- );- }-- Widget _chevron(ColorTokens colors) {- return Icon(- Icons.chevron_right_outlined,- color: colors.textLight,- size: IconSizes.medium,- );- }-}diff --git a/mobile/apps/auth/lib/ui/settings/data/data_settings_page.dart b/mobile/apps/auth/lib/ui/settings/data/data_settings_page.dartindex 2edef4b2e9..abf34e7f5b 100644--- a/mobile/apps/auth/lib/ui/settings/data/data_settings_page.dart+++ b/mobile/apps/auth/lib/ui/settings/data/data_settings_page.dart@@ -2,7 +2,6 @@ import 'dart:async';import 'package:ente_auth/services/deduplication_service.dart';import 'package:ente_auth/services/flagservice.dart';-import 'package:ente_auth/ui/settings/components/auth_settings_item.dart';import 'package:ente_auth/ui/settings/components/auth_settings_navigation.dart';import 'package:ente_auth/ui/settings/components/auth_settings_page_scaffold.dart';import 'package:ente_auth/ui/settings/data/duplicate_code_page.dart';@@ -24,20 +23,20 @@ class DataSettingsPage extends StatelessWidget {return AuthSettingsPageScaffold(title: l10n.data,children: [- AuthSettingsItem(+ SettingsItem(title: l10n.importCodes,icon: HugeIcons.strokeRoundedFileImport,onTap: () => _openImportCodes(context),),const SizedBox(height: Spacing.sm),- AuthSettingsItem(+ SettingsItem(title: l10n.exportCodes,icon: HugeIcons.strokeRoundedFileExport,showOnlyLoadingState: true,onTap: () => handleExportClick(context),),const SizedBox(height: Spacing.sm),- AuthSettingsItem(+ SettingsItem(title: l10n.duplicateCodes,icon: HugeIcons.strokeRoundedCopy01,showOnlyLoadingState: true,@@ -45,7 +44,7 @@ class DataSettingsPage extends StatelessWidget {),if (FeatureFlagService.isLocalBackupEnabled()) ...[const SizedBox(height: Spacing.sm),- AuthSettingsItem(+ SettingsItem(title: l10n.localBackupSidebarTitle,icon: HugeIcons.strokeRoundedHardDrive,onTap: () =>diff --git a/mobile/apps/auth/lib/ui/settings/data/import_page.dart b/mobile/apps/auth/lib/ui/settings/data/import_page.dartindex d30286fd97..6197bc15d4 100644--- a/mobile/apps/auth/lib/ui/settings/data/import_page.dart+++ b/mobile/apps/auth/lib/ui/settings/data/import_page.dart@@ -1,4 +1,3 @@-import 'package:ente_auth/ui/settings/components/auth_settings_item.dart';import 'package:ente_auth/ui/settings/components/auth_settings_page_scaffold.dart';import 'package:ente_auth/ui/settings/data/import/import_service.dart';import 'package:ente_components/ente_components.dart';@@ -72,7 +71,7 @@ class ImportCodePage extends StatelessWidget {showDividers: true,items: [for (final type in importOptions)- AuthSettingsItem(+ SettingsItem(title: getTitle(context, type),semanticsIdentifier: 'auth_import_${type.name}',onTap: () => _import(context, type),diff --git a/mobile/apps/auth/lib/ui/settings/data/local_backup_settings_page.dart b/mobile/apps/auth/lib/ui/settings/data/local_backup_settings_page.dartindex 1848c257df..d56ce84692 100644--- a/mobile/apps/auth/lib/ui/settings/data/local_backup_settings_page.dart+++ b/mobile/apps/auth/lib/ui/settings/data/local_backup_settings_page.dart@@ -1,4 +1,3 @@-import 'package:ente_auth/ui/settings/components/auth_settings_item.dart';import 'package:ente_auth/ui/settings/components/auth_settings_page_scaffold.dart';import 'package:ente_auth/ui/settings/data/local_backup/local_backup_experience.dart';import 'package:ente_components/ente_components.dart';@@ -40,7 +39,7 @@ class LocalBackupSettingsPage extends StatelessWidget {return [MenuGroupComponent(items: [- AuthSettingsItem(+ SettingsItem(title: l10n.enableAutomaticBackups,showChevron: false,trailing: Semantics(@@ -68,20 +67,21 @@ class LocalBackupSettingsPage extends StatelessWidget {final title = snapshot.data == true? l10n.updateBackupPassword: l10n.setBackupPassword;- return AuthSettingsItem(+ return SettingsItem(title: title,semanticsIdentifier: 'auth_local_backup_password',onTap: () => controller.updatePassword(context),);},),- AuthSettingsItem(+ SettingsItem(title: l10n.setBackupFolder,subtitle: _locationDescription(context, controller),+ subtitleMaxLines: 2,semanticsIdentifier: 'auth_local_backup_folder',onTap: controller.changeLocation,),- AuthSettingsItem(+ SettingsItem(title: l10n.createBackupNow,semanticsIdentifier: 'auth_local_backup_create_now',showOnlyLoadingState: true,@@ -97,13 +97,13 @@ class LocalBackupSettingsPage extends StatelessWidget {showDividers: true,dividerPadding: const EdgeInsets.only(left: Spacing.lg),items: [- AuthSettingsItem(+ SettingsItem(title: l10n.clearBackupFolder,showChevron: false,showOnlyLoadingState: true,onTap: controller.resetBackupLocation,),- AuthSettingsItem(+ SettingsItem(title: l10n.clearBackupPassword,showChevron: false,showOnlyLoadingState: true,diff --git a/mobile/apps/auth/lib/ui/settings/general_settings_page.dart b/mobile/apps/auth/lib/ui/settings/general_settings_page.dartindex 0ed75f0b10..fc1eeea00e 100644--- a/mobile/apps/auth/lib/ui/settings/general_settings_page.dart+++ b/mobile/apps/auth/lib/ui/settings/general_settings_page.dart@@ -5,7 +5,6 @@ import 'package:ente_auth/events/icons_changed_event.dart';import 'package:ente_auth/locale.dart';import 'package:ente_auth/services/preference_service.dart';import 'package:ente_auth/ui/settings/app_icon_selection_screen.dart';-import 'package:ente_auth/ui/settings/components/auth_settings_item.dart';import 'package:ente_auth/ui/settings/components/auth_settings_navigation.dart';import 'package:ente_auth/ui/settings/components/auth_settings_page_scaffold.dart';import 'package:ente_auth/ui/settings/language_picker.dart';@@ -27,14 +26,14 @@ class GeneralSettingsPage extends StatelessWidget {return AuthSettingsPageScaffold(title: l10n.general,children: [- AuthSettingsItem(+ SettingsItem(title: l10n.language,icon: HugeIcons.strokeRoundedLanguageSquare,onTap: () => _openLanguage(context),),if (Platform.isIOS || Platform.isAndroid) ...[const SizedBox(height: Spacing.sm),- AuthSettingsItem(+ SettingsItem(title: l10n.appIcon,icon: HugeIcons.strokeRoundedImage01,onTap: () =>@@ -115,12 +114,12 @@ class GeneralSettingsPage extends StatelessWidget {);}- AuthSettingsItem _toggleItem({+ SettingsItem _toggleItem({required String title,required ValueGetter<bool> value,required Future<void> Function() onChanged,}) {- return AuthSettingsItem(+ return SettingsItem(title: title,showChevron: false,trailing: ToggleSwitchComponent.async(value: value, onChanged: onChanged),diff --git a/mobile/apps/auth/lib/ui/settings/security_settings_page.dart b/mobile/apps/auth/lib/ui/settings/security_settings_page.dartindex 464740e152..e73c3e54f3 100644--- a/mobile/apps/auth/lib/ui/settings/security_settings_page.dart+++ b/mobile/apps/auth/lib/ui/settings/security_settings_page.dart@@ -8,7 +8,6 @@ import 'package:ente_accounts/services/user_service.dart';import 'package:ente_auth/core/configuration.dart';import 'package:ente_auth/ui/components/buttons/button_widget.dart';import 'package:ente_auth/ui/components/models/button_result.dart';-import 'package:ente_auth/ui/settings/components/auth_settings_item.dart';import 'package:ente_auth/ui/settings/components/auth_settings_page_scaffold.dart';import 'package:ente_auth/utils/dialog_util.dart';import 'package:ente_auth/utils/toast_util.dart';@@ -49,7 +48,7 @@ class _SecuritySettingsPageState extends State<SecuritySettingsPage> {title: context.strings.security,children: [if (_hasLoggedIn) ...[- AuthSettingsItem(+ SettingsItem(title: context.strings.emailVerificationToggle,icon: HugeIcons.strokeRoundedMailSecure01,showChevron: false,@@ -59,14 +58,14 @@ class _SecuritySettingsPageState extends State<SecuritySettingsPage> {),),const SizedBox(height: Spacing.sm),- AuthSettingsItem(+ SettingsItem(title: context.strings.passkey,icon: HugeIcons.strokeRoundedFingerAccess,showOnlyLoadingState: true,onTap: _openPasskey,),const SizedBox(height: Spacing.sm),- AuthSettingsItem(+ SettingsItem(title: context.strings.viewActiveSessions,icon: HugeIcons.strokeRoundedSmartPhone01,showOnlyLoadingState: true,@@ -74,7 +73,7 @@ class _SecuritySettingsPageState extends State<SecuritySettingsPage> {),const SizedBox(height: Spacing.sm),],- AuthSettingsItem(+ SettingsItem(title: context.strings.appLock,icon: HugeIcons.strokeRoundedSquareLock02,showOnlyLoadingState: true,diff --git a/mobile/apps/auth/lib/ui/settings/support_settings_page.dart b/mobile/apps/auth/lib/ui/settings/support_settings_page.dartindex ec8ff349eb..98c63bfbb0 100644--- a/mobile/apps/auth/lib/ui/settings/support_settings_page.dart+++ b/mobile/apps/auth/lib/ui/settings/support_settings_page.dart@@ -1,5 +1,4 @@import 'package:ente_auth/core/constants.dart';-import 'package:ente_auth/ui/settings/components/auth_settings_item.dart';import 'package:ente_auth/ui/settings/components/auth_settings_page_scaffold.dart';import 'package:ente_auth/utils/email_util.dart';import 'package:ente_auth/utils/platform_util.dart';@@ -19,21 +18,21 @@ class SupportSettingsPage extends StatelessWidget {return AuthSettingsPageScaffold(title: l10n.support,children: [- AuthSettingsItem(+ SettingsItem(title: l10n.faq,icon: HugeIcons.strokeRoundedHelpCircle,showOnlyLoadingState: true,onTap: () => _openFaq(),),const SizedBox(height: Spacing.sm),- AuthSettingsItem(+ SettingsItem(title: l10n.suggestFeatures,icon: HugeIcons.strokeRoundedIdea01,showOnlyLoadingState: true,onTap: _suggestFeatures,),const SizedBox(height: Spacing.sm),- AuthSettingsItem(+ SettingsItem(title: l10n.reportABug,icon: HugeIcons.strokeRoundedBug01,showOnlyLoadingState: true,diff --git a/mobile/apps/auth/lib/ui/settings/theme_settings_page.dart b/mobile/apps/auth/lib/ui/settings/theme_settings_page.dartindex b19781c772..8f2e6fada5 100644--- a/mobile/apps/auth/lib/ui/settings/theme_settings_page.dart+++ b/mobile/apps/auth/lib/ui/settings/theme_settings_page.dart@@ -1,5 +1,4 @@import 'package:ente_auth/app/view/app.dart';-import 'package:ente_auth/ui/settings/components/auth_settings_item.dart';import 'package:ente_auth/ui/settings/components/auth_settings_page_scaffold.dart';import 'package:ente_components/ente_components.dart';import 'package:ente_lock_screen/ui/app_lock.dart';@@ -62,7 +61,7 @@ class _ThemeSettingsPageState extends State<ThemeSettingsPage> {required ThemeMode currentMode,required Color checkColor,}) {- return AuthSettingsItem(+ return SettingsItem(title: label,icon: icon,showChevron: false,diff --git a/mobile/apps/auth/lib/ui/settings_page.dart b/mobile/apps/auth/lib/ui/settings_page.dartindex f829e430fd..8d2dfb979d 100644--- a/mobile/apps/auth/lib/ui/settings_page.dart+++ b/mobile/apps/auth/lib/ui/settings_page.dart@@ -8,7 +8,6 @@ import 'package:ente_auth/ui/components/buttons/button_widget.dart';import 'package:ente_auth/ui/settings/about_settings_page.dart';import 'package:ente_auth/ui/settings/account_settings_page.dart';import 'package:ente_auth/ui/settings/app_version_widget.dart';-import 'package:ente_auth/ui/settings/components/auth_settings_item.dart';import 'package:ente_auth/ui/settings/components/auth_settings_navigation.dart';import 'package:ente_auth/ui/settings/components/auth_settings_page_scaffold.dart';import 'package:ente_auth/ui/settings/data/data_settings_page.dart';@@ -65,7 +64,7 @@ class SettingsPage extends StatelessWidget {final contents = <Widget>[];if (hasLoggedIn) {contents.add(- AuthSettingsItem(+ SettingsItem(title: l10n.account,icon: HugeIcons.strokeRoundedUser,semanticsIdentifier: 'auth_settings_account',@@ -87,14 +86,14 @@ class SettingsPage extends StatelessWidget {}contents.addAll([- AuthSettingsItem(+ SettingsItem(title: l10n.data,icon: HugeIcons.strokeRoundedDatabase01,semanticsIdentifier: 'auth_settings_data',onTap: () => _openDataSettings(context),),const SizedBox(height: Spacing.sm),- AuthSettingsItem(+ SettingsItem(title: l10n.security,icon: HugeIcons.strokeRoundedSecurityCheck,semanticsIdentifier: 'auth_settings_security',@@ -109,7 +108,7 @@ class SettingsPage extends StatelessWidget {kDebugMode) {contents.addAll([const SizedBox(height: Spacing.sm),- AuthSettingsItem(+ SettingsItem(title: l10n.theme,icon: Theme.of(context).brightness == Brightness.light? HugeIcons.strokeRoundedSun03@@ -122,21 +121,21 @@ class SettingsPage extends StatelessWidget {contents.addAll([const SizedBox(height: Spacing.sm),- AuthSettingsItem(+ SettingsItem(title: l10n.general,icon: HugeIcons.strokeRoundedSettings01,semanticsIdentifier: 'auth_settings_general',onTap: () => pushAuthSettingsPage(context, const GeneralSettingsPage()),),const SizedBox(height: Spacing.sm),- AuthSettingsItem(+ SettingsItem(title: l10n.support,icon: HugeIcons.strokeRoundedHelpCircle,semanticsIdentifier: 'auth_settings_support',onTap: () => pushAuthSettingsPage(context, const SupportSettingsPage()),),const SizedBox(height: Spacing.sm),- AuthSettingsItem(+ SettingsItem(title: l10n.about,icon: HugeIcons.strokeRoundedInformationCircle,semanticsIdentifier: 'auth_settings_about',@@ -147,7 +146,7 @@ class SettingsPage extends StatelessWidget {if (hasLoggedIn) {contents.addAll([const SizedBox(height: Spacing.sm),- AuthSettingsItem(+ SettingsItem(title: l10n.logout,icon: HugeIcons.strokeRoundedLogout05,semanticsIdentifier: 'auth_settings_logout',diff --git a/mobile/apps/auth/test/ui/settings/components/auth_settings_components_test.dart b/mobile/apps/auth/test/ui/settings/components/auth_settings_components_test.dartindex c8892148ee..fe57b94616 100644--- a/mobile/apps/auth/test/ui/settings/components/auth_settings_components_test.dart+++ b/mobile/apps/auth/test/ui/settings/components/auth_settings_components_test.dart@@ -1,63 +1,9 @@-import 'package:ente_auth/ui/settings/components/auth_settings_item.dart';import 'package:ente_auth/ui/settings/components/auth_settings_page_scaffold.dart';import 'package:ente_components/ente_components.dart';import 'package:flutter/material.dart';import 'package:flutter_test/flutter_test.dart';-import 'package:hugeicons/hugeicons.dart';void main() {- testWidgets('settings item exposes its identifier and handles taps', (- tester,- ) async {- var tapped = false;-- await _pump(- tester,- AuthSettingsItem(- title: 'Security',- icon: HugeIcons.strokeRoundedSquareLock02,- semanticsIdentifier: 'auth_settings_security',- onTap: () => tapped = true,- ),- );-- expect(find.text('Security'), findsOneWidget);- expect(find.byType(HugeIcon), findsOneWidget);- expect(find.byIcon(Icons.chevron_right_outlined), findsOneWidget);-- final semantics = tester.widget<Semantics>(- find.byWidgetPredicate(- (widget) =>- widget is Semantics &&- widget.properties.identifier == 'auth_settings_security',- ),- );- expect(semantics.properties.identifier, 'auth_settings_security');-- await tester.tap(find.text('Security'));- await tester.pump();- expect(tapped, isTrue);- });-- testWidgets('settings item supports destructive and non-navigation rows', (- tester,- ) async {- await _pump(- tester,- const AuthSettingsItem(- title: 'Delete account',- isDestructive: true,- showChevron: false,- trailing: Switch(value: true, onChanged: null),- ),- );-- final title = tester.widget<Text>(find.text('Delete account'));- expect(title.style?.color, ColorTokens.light.warning);- expect(find.byIcon(Icons.chevron_right_outlined), findsNothing);- expect(find.byType(Switch), findsOneWidget);- });-testWidgets('settings scaffold uses the component surface and renders body', (tester,) async {diff --git a/mobile/apps/auth/test/ui/settings/settings_subpages_test.dart b/mobile/apps/auth/test/ui/settings/settings_subpages_test.dartindex 88ea539df7..00d2aa3f59 100644--- a/mobile/apps/auth/test/ui/settings/settings_subpages_test.dart+++ b/mobile/apps/auth/test/ui/settings/settings_subpages_test.dart@@ -1,10 +1,8 @@-import 'package:ente_auth/ui/settings/data/local_backup_settings_page.dart';import 'package:ente_auth/ui/settings/language_picker.dart';import 'package:ente_components/ente_components.dart';import 'package:ente_strings/ente_strings.dart';import 'package:flutter/material.dart';import 'package:flutter_test/flutter_test.dart';-import 'package:shared_preferences/shared_preferences.dart';void main() {testWidgets(@@ -28,49 +26,6 @@ void main() {expect(find.byType(MenuGroupComponent), findsOneWidget);},);-- testWidgets('local backup uses component settings controls', (tester) async {- SharedPreferences.setMockInitialValues({- 'isAutoBackupEnabled': true,- 'autoBackupPath': '/tmp/EnteAuthBackups',- });-- await _pumpPage(tester, const LocalBackupSettingsPage());- await tester.pumpAndSettle();-- expect(find.text('Automatic backups'), findsOneWidget);- expect(find.byType(ToggleSwitchComponent), findsOneWidget);- expect(find.byType(MenuGroupComponent), findsNWidgets(2));- expect(- find.byWidgetPredicate(- (widget) =>- widget is Semantics &&- widget.properties.identifier == 'auth_local_backup_settings',- ),- findsOneWidget,- );- expect(- find.byWidgetPredicate(- (widget) =>- widget is Semantics &&- widget.properties.identifier == 'auth_local_backup_toggle',- ),- findsOneWidget,- );- for (final identifier in [- 'auth_local_backup_password',- 'auth_local_backup_folder',- 'auth_local_backup_create_now',- ]) {- expect(- find.byWidgetPredicate(- (widget) =>- widget is Semantics && widget.properties.identifier == identifier,- ),- findsOneWidget,- );- }- });}Future<void> _pumpPage(WidgetTester tester, Widget page) {diff --git a/mobile/apps/locker/lib/ui/components/legacy_collections_trash_widget.dart b/mobile/apps/locker/lib/ui/components/legacy_collections_trash_widget.dartindex fa4221cef0..32124250f8 100644--- a/mobile/apps/locker/lib/ui/components/legacy_collections_trash_widget.dart+++ b/mobile/apps/locker/lib/ui/components/legacy_collections_trash_widget.dart@@ -1,3 +1,4 @@+import "package:ente_components/ente_components.dart";import 'package:ente_pure_utils/ente_pure_utils.dart';import "package:ente_strings/ente_strings.dart";import "package:flutter/material.dart";@@ -5,7 +6,6 @@ import "package:hugeicons/hugeicons.dart";import "package:locker/services/trash/trash_service.dart";import "package:locker/ui/pages/all_collections_page.dart";import "package:locker/ui/pages/trash_page.dart";-import "package:locker/ui/settings/components/settings_item.dart";import "package:locker/ui/utils/legacy_utils.dart";class LegacyCollectionsTrashWidget extends StatelessWidget {diff --git a/mobile/apps/locker/lib/ui/settings/language_selector_page.dart b/mobile/apps/locker/lib/ui/settings/language_selector_page.dartindex a258712f08..bd0b66e415 100644--- a/mobile/apps/locker/lib/ui/settings/language_selector_page.dart+++ b/mobile/apps/locker/lib/ui/settings/language_selector_page.dart@@ -3,7 +3,6 @@ import "package:ente_pure_utils/ente_pure_utils.dart";import "package:ente_strings/ente_strings.dart";import "package:flutter/foundation.dart";import "package:flutter/material.dart";-import "package:locker/ui/settings/components/settings_item.dart";import "package:locker/ui/settings/components/settings_page_scaffold.dart";class LanguageSelectorPage extends StatelessWidget {diff --git a/mobile/apps/locker/lib/ui/settings/pages/about_page.dart b/mobile/apps/locker/lib/ui/settings/pages/about_page.dartindex 842957a79b..2721dde38f 100644--- a/mobile/apps/locker/lib/ui/settings/pages/about_page.dart+++ b/mobile/apps/locker/lib/ui/settings/pages/about_page.dart@@ -1,10 +1,10 @@+import "package:ente_components/ente_components.dart";import "package:ente_strings/ente_strings.dart";import "package:ente_ui/utils/toast_util.dart";import "package:ente_utils/platform_util.dart";import "package:flutter/material.dart";import "package:hugeicons/hugeicons.dart";import "package:locker/services/update_service.dart";-import "package:locker/ui/settings/components/settings_item.dart";import "package:locker/ui/settings/components/settings_page_scaffold.dart";import "package:locker/ui/settings/widgets/app_update_dialog.dart";import "package:url_launcher/url_launcher.dart";diff --git a/mobile/apps/locker/lib/ui/settings/pages/account_settings_page.dart b/mobile/apps/locker/lib/ui/settings/pages/account_settings_page.dartindex 2b313fccbf..70bb0579c0 100644--- a/mobile/apps/locker/lib/ui/settings/pages/account_settings_page.dart+++ b/mobile/apps/locker/lib/ui/settings/pages/account_settings_page.dart@@ -15,7 +15,6 @@ import "package:hugeicons/hugeicons.dart";import "package:locker/services/configuration.dart";import "package:locker/ui/components/recovery_key_sheet.dart";import "package:locker/ui/pages/home_page.dart";-import "package:locker/ui/settings/components/settings_item.dart";import "package:locker/ui/settings/components/settings_page_scaffold.dart";class AccountSettingsPage extends StatelessWidget {diff --git a/mobile/apps/locker/lib/ui/settings/pages/general_settings_page.dart b/mobile/apps/locker/lib/ui/settings/pages/general_settings_page.dartindex 8f8d737cec..1f35e1dd40 100644--- a/mobile/apps/locker/lib/ui/settings/pages/general_settings_page.dart+++ b/mobile/apps/locker/lib/ui/settings/pages/general_settings_page.dart@@ -1,9 +1,9 @@+import "package:ente_components/ente_components.dart";import "package:ente_strings/ente_strings.dart";import "package:flutter/material.dart";import "package:hugeicons/hugeicons.dart";import "package:locker/app.dart";import "package:locker/core/locale.dart";-import "package:locker/ui/settings/components/settings_item.dart";import "package:locker/ui/settings/components/settings_page_scaffold.dart";import "package:locker/ui/settings/language_selector_page.dart";diff --git a/mobile/apps/locker/lib/ui/settings/pages/security_settings_page.dart b/mobile/apps/locker/lib/ui/settings/pages/security_settings_page.dartindex a3bcf256dc..813aaf162d 100644--- a/mobile/apps/locker/lib/ui/settings/pages/security_settings_page.dart+++ b/mobile/apps/locker/lib/ui/settings/pages/security_settings_page.dart@@ -15,7 +15,6 @@ import "package:ente_utils/email_util.dart";import "package:flutter/material.dart";import "package:hugeicons/hugeicons.dart";import "package:locker/services/configuration.dart";-import "package:locker/ui/settings/components/settings_item.dart";import "package:locker/ui/settings/components/settings_page_scaffold.dart";import "package:locker/utils/bottom_sheet_illustration.dart";import "package:logging/logging.dart";diff --git a/mobile/apps/locker/lib/ui/settings/pages/settings_search_page.dart b/mobile/apps/locker/lib/ui/settings/pages/settings_search_page.dartindex d80f12b4e5..92c9149512 100644--- a/mobile/apps/locker/lib/ui/settings/pages/settings_search_page.dart+++ b/mobile/apps/locker/lib/ui/settings/pages/settings_search_page.dart@@ -9,7 +9,6 @@ import "package:flutter/material.dart";import "package:hugeicons/hugeicons.dart";import "package:locker/services/configuration.dart";import "package:locker/services/update_service.dart";-import "package:locker/ui/settings/components/settings_item.dart";import "package:locker/ui/settings/pages/about_page.dart";import "package:locker/ui/settings/pages/account_settings_page.dart";import "package:locker/ui/settings/pages/general_settings_page.dart";diff --git a/mobile/apps/locker/lib/ui/settings/pages/support_page.dart b/mobile/apps/locker/lib/ui/settings/pages/support_page.dartindex 8b21a65866..3b56f724b7 100644--- a/mobile/apps/locker/lib/ui/settings/pages/support_page.dart+++ b/mobile/apps/locker/lib/ui/settings/pages/support_page.dart@@ -10,7 +10,6 @@ import "package:flutter/foundation.dart";import "package:flutter/material.dart";import "package:hugeicons/hugeicons.dart";import "package:locker/core/constants.dart";-import "package:locker/ui/settings/components/settings_item.dart";import "package:locker/ui/settings/components/settings_page_scaffold.dart";import "package:url_launcher/url_launcher_string.dart";diff --git a/mobile/apps/locker/lib/ui/settings/pages/theme_settings_page.dart b/mobile/apps/locker/lib/ui/settings/pages/theme_settings_page.dartindex 8c0bf8ff92..132238dcf9 100644--- a/mobile/apps/locker/lib/ui/settings/pages/theme_settings_page.dart+++ b/mobile/apps/locker/lib/ui/settings/pages/theme_settings_page.dart@@ -3,7 +3,6 @@ import "package:ente_components/ente_components.dart";import "package:ente_strings/ente_strings.dart";import "package:flutter/material.dart";import "package:hugeicons/hugeicons.dart";-import "package:locker/ui/settings/components/settings_item.dart";import "package:locker/ui/settings/components/settings_page_scaffold.dart";class ThemeSettingsPage extends StatefulWidget {diff --git a/mobile/apps/locker/lib/ui/settings/settings_page.dart b/mobile/apps/locker/lib/ui/settings/settings_page.dartindex b39e6286ca..e8afff18ef 100644--- a/mobile/apps/locker/lib/ui/settings/settings_page.dart+++ b/mobile/apps/locker/lib/ui/settings/settings_page.dart@@ -6,7 +6,6 @@ import "package:ente_strings/ente_strings.dart";import "package:flutter/foundation.dart";import "package:flutter/material.dart";import "package:hugeicons/hugeicons.dart";-import "package:locker/ui/settings/components/settings_item.dart";import "package:locker/ui/settings/pages/about_page.dart";import "package:locker/ui/settings/pages/account_settings_page.dart";import "package:locker/ui/settings/pages/general_settings_page.dart";diff --git a/mobile/apps/photos/lib/ui/settings/about/about_us_page.dart b/mobile/apps/photos/lib/ui/settings/about/about_us_page.dartindex e5a960468f..908793573d 100644--- a/mobile/apps/photos/lib/ui/settings/about/about_us_page.dart+++ b/mobile/apps/photos/lib/ui/settings/about/about_us_page.dart@@ -1,3 +1,4 @@+import "package:ente_components/ente_components.dart";import "package:ente_strings/ente_strings.dart";import "package:flutter/material.dart";import "package:hugeicons/hugeicons.dart";@@ -5,7 +6,6 @@ import "package:photos/service_locator.dart";import "package:photos/ui/common/web_page.dart";import "package:photos/ui/notification/toast.dart";import "package:photos/ui/settings/app_update_dialog.dart";-import "package:photos/ui/settings/components/settings_item.dart";import "package:photos/ui/settings/components/settings_page_scaffold.dart";import "package:photos/utils/dialog_util.dart";import "package:url_launcher/url_launcher.dart";diff --git a/mobile/apps/photos/lib/ui/settings/account/account_settings_page.dart b/mobile/apps/photos/lib/ui/settings/account/account_settings_page.dartindex 3084d8a0e1..9755607edc 100644--- a/mobile/apps/photos/lib/ui/settings/account/account_settings_page.dart+++ b/mobile/apps/photos/lib/ui/settings/account/account_settings_page.dart@@ -1,6 +1,7 @@import "dart:async";import "package:ente_account_deletion/account_deletion.dart";+import "package:ente_components/ente_components.dart";import "package:ente_crypto/ente_crypto.dart";import "package:ente_lock_screen/local_authentication_service.dart";import "package:ente_strings/ente_strings.dart";@@ -12,7 +13,6 @@ import "package:photos/ui/account/change_email_dialog.dart";import "package:photos/ui/account/password_entry_page.dart";import "package:photos/ui/account/recovery_key_page.dart";import "package:photos/ui/payment/subscription.dart";-import "package:photos/ui/settings/components/settings_item.dart";import "package:photos/ui/settings/components/settings_page_scaffold.dart";import "package:photos/utils/dialog_util.dart";import "package:url_launcher/url_launcher_string.dart";@@ -31,7 +31,6 @@ class AccountSettingsPage extends StatelessWidget {title: l10n.manageSubscription,icon: HugeIcons.strokeRoundedCreditCard,showOnlyLoadingState: true,- shouldSurfaceExecutionStates: true,onTap: () async => _onManageSubscriptionTapped(context),),const SizedBox(height: 8),diff --git a/mobile/apps/photos/lib/ui/settings/appearance/appearance_settings_page.dart b/mobile/apps/photos/lib/ui/settings/appearance/appearance_settings_page.dartindex c65cd28232..773442843f 100644--- a/mobile/apps/photos/lib/ui/settings/appearance/appearance_settings_page.dart+++ b/mobile/apps/photos/lib/ui/settings/appearance/appearance_settings_page.dart@@ -10,7 +10,6 @@ import "package:hugeicons/hugeicons.dart";import "package:photos/app.dart";import "package:photos/locale.dart";import "package:photos/ui/settings/app_icon_selection_screen.dart";-import "package:photos/ui/settings/components/settings_item.dart";import "package:photos/ui/settings/components/settings_page_scaffold.dart";import "package:photos/ui/settings/gallery_settings_screen.dart";import "package:photos/ui/settings/language_picker.dart";diff --git a/mobile/apps/photos/lib/ui/settings/backup/backup_settings_page.dart b/mobile/apps/photos/lib/ui/settings/backup/backup_settings_page.dartindex bd22fbda51..d1f8835e2b 100644--- a/mobile/apps/photos/lib/ui/settings/backup/backup_settings_page.dart+++ b/mobile/apps/photos/lib/ui/settings/backup/backup_settings_page.dart@@ -1,3 +1,4 @@+import "package:ente_components/ente_components.dart";import "package:ente_pure_utils/ente_pure_utils.dart";import "package:ente_strings/ente_strings.dart";import "package:flutter/material.dart";@@ -5,7 +6,6 @@ import "package:hugeicons/hugeicons.dart";import "package:photos/ui/common/backup_flow_helper.dart";import "package:photos/ui/settings/backup/backup_settings_screen.dart";import "package:photos/ui/settings/backup/backup_status_screen.dart";-import "package:photos/ui/settings/components/settings_item.dart";import "package:photos/ui/settings/components/settings_page_scaffold.dart";class BackupSettingsPage extends StatelessWidget {diff --git a/mobile/apps/photos/lib/ui/settings/backup/free_space_options.dart b/mobile/apps/photos/lib/ui/settings/backup/free_space_options.dartindex dc94bff64f..85ac93f406 100644--- a/mobile/apps/photos/lib/ui/settings/backup/free_space_options.dart+++ b/mobile/apps/photos/lib/ui/settings/backup/free_space_options.dart@@ -15,7 +15,6 @@ import "package:photos/services/deduplication_service.dart";import "package:photos/services/files_service.dart";import "package:photos/ui/components/models/button_type.dart";import "package:photos/ui/notification/toast.dart";-import "package:photos/ui/settings/components/settings_item.dart";import "package:photos/ui/settings/components/settings_page_scaffold.dart";import "package:photos/ui/tools/debug/app_storage_viewer.dart";import "package:photos/ui/tools/deduplicate_page.dart";diff --git a/mobile/apps/photos/lib/ui/settings/cast/cast_settings_page.dart b/mobile/apps/photos/lib/ui/settings/cast/cast_settings_page.dartindex 9f0c95e492..4cb2844780 100644--- a/mobile/apps/photos/lib/ui/settings/cast/cast_settings_page.dart+++ b/mobile/apps/photos/lib/ui/settings/cast/cast_settings_page.dart@@ -12,7 +12,6 @@ import "package:photos/service_locator.dart";import "package:photos/services/collections_service.dart";import "package:photos/theme/ente_theme.dart";import "package:photos/ui/common/loading_widget.dart";-import "package:photos/ui/settings/components/settings_item.dart";import "package:photos/ui/settings/components/settings_page_scaffold.dart";import 'package:timeago/timeago.dart' as timeago;@@ -185,7 +184,6 @@ class _CastSessionItem extends StatelessWidget {icon: HugeIcons.strokeRoundedTvSmart,showChevron: false,showOnlyLoadingState: true,- shouldSurfaceExecutionStates: false,trailing: IconButtonComponent(icon: const HugeIcon(icon: HugeIcons.strokeRoundedCancel01,diff --git a/mobile/apps/photos/lib/ui/settings/components/settings_item.dart b/mobile/apps/photos/lib/ui/settings/components/settings_item.dartdeleted file mode 100644index 65a395ad88..0000000000--- a/mobile/apps/photos/lib/ui/settings/components/settings_item.dart+++ /dev/null@@ -1,96 +0,0 @@-import "dart:async";--import "package:ente_components/ente_components.dart";-import "package:flutter/material.dart";-import "package:flutter_svg/flutter_svg.dart";-import "package:hugeicons/hugeicons.dart";--class SettingsItem extends StatelessWidget {- const SettingsItem({- super.key,- required this.title,- this.subtitle,- this.icon,- this.svgIconPath,- this.leading,- this.trailing,- this.onTap,- this.onDoubleTap,- this.showChevron = true,- this.isDestructive = false,- this.selected = false,- this.showOnlyLoadingState = false,- this.shouldSurfaceExecutionStates = false,- this.titleMaxLines = 2,- this.subtitleMaxLines = 1,- });-- final String title;- final String? subtitle;- final List<List<dynamic>>? icon;- final String? svgIconPath;- final Widget? leading;- final Widget? trailing;- final FutureOr<void> Function()? onTap;- final FutureOr<void> Function()? onDoubleTap;- final bool showChevron;- final bool isDestructive;- final bool selected;- final bool showOnlyLoadingState;- final bool shouldSurfaceExecutionStates;- final int titleMaxLines;- final int subtitleMaxLines;-- @override- Widget build(BuildContext context) {- final colors = context.componentColors;- final effectiveTextColor = isDestructive ? colors.warning : colors.textBase;- final effectiveIconColor = isDestructive- ? colors.warning- : colors.textLight;-- return MenuComponent(- title: title,- subtitle: subtitle,- titleColor: effectiveTextColor,- iconColor: effectiveIconColor,- selected: selected,- leading: leading ?? _buildLeading(effectiveIconColor),- trailing: trailing ?? (showChevron ? _chevron(colors) : null),- showOnlyLoadingState: showOnlyLoadingState,- shouldSurfaceExecutionStates: shouldSurfaceExecutionStates,- titleMaxLines: titleMaxLines,- subtitleMaxLines: subtitleMaxLines,- onTap: onTap,- onDoubleTap: onDoubleTap,- );- }-- Widget? _buildLeading(Color color) {- if (icon != null) {- return HugeIcon(- icon: icon!,- color: color,- size: IconSizes.small,- strokeWidth: 1.6,- );- }- if (svgIconPath != null) {- return SvgPicture.asset(- svgIconPath!,- colorFilter: ColorFilter.mode(color, BlendMode.srcIn),- width: IconSizes.small,- height: IconSizes.small,- );- }- return null;- }-- Widget _chevron(ColorTokens colors) {- return Icon(- Icons.chevron_right_outlined,- color: colors.textLight,- size: IconSizes.medium,- );- }-}diff --git a/mobile/apps/photos/lib/ui/settings/gallery_settings_screen.dart b/mobile/apps/photos/lib/ui/settings/gallery_settings_screen.dartindex 911ed92da6..05e6eef5f9 100644--- a/mobile/apps/photos/lib/ui/settings/gallery_settings_screen.dart+++ b/mobile/apps/photos/lib/ui/settings/gallery_settings_screen.dart@@ -6,7 +6,6 @@ import "package:photos/core/event_bus.dart";import "package:photos/events/force_reload_home_gallery_event.dart";import "package:photos/events/hide_shared_items_from_home_gallery_event.dart";import "package:photos/service_locator.dart";-import "package:photos/ui/settings/components/settings_item.dart";import "package:photos/ui/settings/components/settings_page_scaffold.dart";import "package:photos/ui/viewer/gallery/component/group/type.dart";diff --git a/mobile/apps/photos/lib/ui/settings/notification_settings_screen.dart b/mobile/apps/photos/lib/ui/settings/notification_settings_screen.dartindex b56b4ae142..b7ba2d612a 100644--- a/mobile/apps/photos/lib/ui/settings/notification_settings_screen.dart+++ b/mobile/apps/photos/lib/ui/settings/notification_settings_screen.dart@@ -3,7 +3,6 @@ import "package:ente_strings/ente_strings.dart";import "package:flutter/material.dart";import "package:photos/service_locator.dart";import "package:photos/services/notification_service.dart";-import "package:photos/ui/settings/components/settings_item.dart";import "package:photos/ui/settings/components/settings_page_scaffold.dart";class NotificationSettingsScreen extends StatefulWidget {diff --git a/mobile/apps/photos/lib/ui/settings/security/security_settings_page.dart b/mobile/apps/photos/lib/ui/settings/security/security_settings_page.dartindex 1cdd1347d1..58741af2c5 100644--- a/mobile/apps/photos/lib/ui/settings/security/security_settings_page.dart+++ b/mobile/apps/photos/lib/ui/settings/security/security_settings_page.dart@@ -23,7 +23,6 @@ import "package:photos/services/account/user_service.dart";import "package:photos/ui/account/request_pwd_verification_page.dart";import "package:photos/ui/account/sessions_page.dart";import "package:photos/ui/notification/toast.dart";-import "package:photos/ui/settings/components/settings_item.dart";import "package:photos/ui/settings/components/settings_page_scaffold.dart";import "package:photos/utils/dialog_util.dart";diff --git a/mobile/apps/photos/lib/ui/settings/support/help_support_page.dart b/mobile/apps/photos/lib/ui/settings/support/help_support_page.dartindex 6b000ee719..8326632a16 100644--- a/mobile/apps/photos/lib/ui/settings/support/help_support_page.dart+++ b/mobile/apps/photos/lib/ui/settings/support/help_support_page.dart@@ -9,7 +9,6 @@ import "package:photos/core/error-reporting/super_logging.dart";import "package:photos/service_locator.dart";import "package:photos/ui/common/web_page.dart";import "package:photos/ui/notification/toast.dart";-import "package:photos/ui/settings/components/settings_item.dart";import "package:photos/ui/settings/components/settings_page_scaffold.dart";import "package:photos/ui/settings/support/report_issue_page.dart";import "package:photos/ui/tools/debug/log_file_viewer.dart";diff --git a/mobile/apps/photos/lib/ui/settings/widget_settings_screen.dart b/mobile/apps/photos/lib/ui/settings/widget_settings_screen.dartindex a9b3d3e143..a02217e999 100644--- a/mobile/apps/photos/lib/ui/settings/widget_settings_screen.dart+++ b/mobile/apps/photos/lib/ui/settings/widget_settings_screen.dart@@ -1,8 +1,8 @@+import "package:ente_components/ente_components.dart";import "package:ente_pure_utils/ente_pure_utils.dart";import "package:ente_strings/ente_strings.dart";import "package:flutter/material.dart";import "package:photos/service_locator.dart";-import "package:photos/ui/settings/components/settings_item.dart";import "package:photos/ui/settings/components/settings_page_scaffold.dart";import "package:photos/ui/settings/ml/machine_learning_settings_page.dart";import "package:photos/ui/settings/widgets/albums_widget_settings.dart";diff --git a/mobile/apps/photos/lib/ui/settings_page.dart b/mobile/apps/photos/lib/ui/settings_page.dartindex c7d233a00f..7efc942661 100644--- a/mobile/apps/photos/lib/ui/settings_page.dart+++ b/mobile/apps/photos/lib/ui/settings_page.dart@@ -24,7 +24,6 @@ import "package:photos/ui/settings/appearance/appearance_settings_page.dart";import "package:photos/ui/settings/backup/backup_settings_page.dart";import "package:photos/ui/settings/backup/free_space_options.dart";import "package:photos/ui/settings/cast/cast_settings_page.dart";-import "package:photos/ui/settings/components/settings_item.dart";import "package:photos/ui/settings/components/settings_page_scaffold.dart";import "package:photos/ui/settings/debug/debug_settings_page.dart";import "package:photos/ui/settings/debug/ml_debug_settings_page.dart";@@ -241,7 +240,6 @@ class _SettingsBody extends StatelessWidget {Widget? trailing,Future<void> Function()? onTap,bool showOnlyLoadingState = false,- bool shouldSurfaceExecutionStates = false,bool isDestructive = false,}) {return SettingsItem(@@ -250,7 +248,6 @@ class _SettingsBody extends StatelessWidget {icon: icon,trailing: trailing,showOnlyLoadingState: showOnlyLoadingState,- shouldSurfaceExecutionStates: shouldSurfaceExecutionStates,isDestructive: isDestructive,onTap: onTap,);@@ -347,7 +344,6 @@ class _SettingsBody extends StatelessWidget {title: context.strings.family,icon: HugeIcons.strokeRoundedUserMultiple,showOnlyLoadingState: true,- shouldSurfaceExecutionStates: true,onTap: () async {late final UserDetails userDetails;try {diff --git a/mobile/apps/locker/lib/ui/settings/components/settings_item.dart b/mobile/packages/ente_components/lib/components/settings_item.dartsimilarity index 67%rename from mobile/apps/locker/lib/ui/settings/components/settings_item.dartrename to mobile/packages/ente_components/lib/components/settings_item.dartindex 65a395ad88..e0a0c1760c 100644--- a/mobile/apps/locker/lib/ui/settings/components/settings_item.dart+++ b/mobile/packages/ente_components/lib/components/settings_item.dart@@ -1,9 +1,12 @@-import "dart:async";+import 'dart:async';-import "package:ente_components/ente_components.dart";-import "package:flutter/material.dart";-import "package:flutter_svg/flutter_svg.dart";-import "package:hugeicons/hugeicons.dart";+import 'package:ente_components/components/menu_component.dart';+import 'package:ente_components/theme/colors.dart';+import 'package:ente_components/theme/icon_sizes.dart';+import 'package:ente_components/theme/theme.dart';+import 'package:flutter/material.dart';+import 'package:flutter_svg/flutter_svg.dart';+import 'package:hugeicons/hugeicons.dart';class SettingsItem extends StatelessWidget {const SettingsItem({@@ -12,58 +15,54 @@ class SettingsItem extends StatelessWidget {this.subtitle,this.icon,this.svgIconPath,- this.leading,this.trailing,this.onTap,this.onDoubleTap,this.showChevron = true,this.isDestructive = false,- this.selected = false,this.showOnlyLoadingState = false,- this.shouldSurfaceExecutionStates = false,this.titleMaxLines = 2,this.subtitleMaxLines = 1,+ this.semanticsIdentifier,});final String title;final String? subtitle;final List<List<dynamic>>? icon;final String? svgIconPath;- final Widget? leading;final Widget? trailing;final FutureOr<void> Function()? onTap;final FutureOr<void> Function()? onDoubleTap;final bool showChevron;final bool isDestructive;- final bool selected;final bool showOnlyLoadingState;- final bool shouldSurfaceExecutionStates;final int titleMaxLines;final int subtitleMaxLines;+ final String? semanticsIdentifier;@overrideWidget build(BuildContext context) {final colors = context.componentColors;- final effectiveTextColor = isDestructive ? colors.warning : colors.textBase;- final effectiveIconColor = isDestructive- ? colors.warning- : colors.textLight;+ final textColor = isDestructive ? colors.warning : colors.textBase;+ final iconColor = isDestructive ? colors.warning : colors.textLight;- return MenuComponent(+ final item = MenuComponent(title: title,subtitle: subtitle,- titleColor: effectiveTextColor,- iconColor: effectiveIconColor,- selected: selected,- leading: leading ?? _buildLeading(effectiveIconColor),+ titleColor: textColor,+ iconColor: iconColor,+ leading: _buildLeading(iconColor),trailing: trailing ?? (showChevron ? _chevron(colors) : null),showOnlyLoadingState: showOnlyLoadingState,- shouldSurfaceExecutionStates: shouldSurfaceExecutionStates,titleMaxLines: titleMaxLines,subtitleMaxLines: subtitleMaxLines,onTap: onTap,onDoubleTap: onDoubleTap,);+ final identifier = semanticsIdentifier;+ return identifier == null+ ? item+ : Semantics(identifier: identifier, child: item);}Widget? _buildLeading(Color color) {diff --git a/mobile/packages/ente_components/lib/ente_components.dart b/mobile/packages/ente_components/lib/ente_components.dartindex 936e06921d..adcc80ec63 100644--- a/mobile/packages/ente_components/lib/ente_components.dart+++ b/mobile/packages/ente_components/lib/ente_components.dart@@ -18,6 +18,7 @@ export 'components/selection_controls/labeled_control_component.dart';export 'components/selection_controls/radio_component.dart';export 'components/selection_controls/toggle_switch_component.dart';export 'components/selection_summary_chip_component.dart';+export 'components/settings_item.dart';export 'components/slider_component.dart';export 'components/stepper_component.dart';export 'components/tag_chip_component.dart';diff --git a/mobile/packages/ente_components/pubspec.yaml b/mobile/packages/ente_components/pubspec.yamlindex 3b23e51b0e..9b93bf59fc 100644--- a/mobile/packages/ente_components/pubspec.yaml+++ b/mobile/packages/ente_components/pubspec.yaml@@ -9,6 +9,7 @@ environment:dependencies:flutter:sdk: flutter+ flutter_svg: 2.3.0fluttertoast: 8.2.14hugeicons: 1.1.7