π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Refactor theme usage in dynamic FAB and dialog widget; improve imports and color scheme references
AmanRajSinghMouryae11a6ace8038
diff --git a/mobile/apps/auth/lib/ui/account/logout_dialog.dart b/mobile/apps/auth/lib/ui/account/logout_dialog.dartindex bb5defbe78..a2e7af6e62 100644--- a/mobile/apps/auth/lib/ui/account/logout_dialog.dart+++ b/mobile/apps/auth/lib/ui/account/logout_dialog.dart@@ -1,7 +1,7 @@import 'package:ente_auth/core/configuration.dart';import 'package:ente_auth/l10n/l10n.dart';import 'package:ente_auth/store/authenticator_db.dart';-import 'package:ente_auth/utils/dialog_util.dart';+import 'package:ente_auth/utils/dialog_util.dart';import 'package:flutter/material.dart';import 'package:logging/logging.dart';diff --git a/mobile/packages/ui/lib/components/buttons/dynamic_fab.dart b/mobile/packages/ui/lib/components/buttons/dynamic_fab.dartindex 0cb31406dd..a6e9be9990 100644--- a/mobile/packages/ui/lib/components/buttons/dynamic_fab.dart+++ b/mobile/packages/ui/lib/components/buttons/dynamic_fab.dart@@ -1,6 +1,7 @@import 'dart:math' as math;import 'package:ente_ui/theme/ente_theme.dart';+import 'package:ente_ui/theme/ente_theme_data.dart';import 'package:flutter/material.dart';class DynamicFAB extends StatelessWidget {@@ -24,7 +25,7 @@ class DynamicFAB extends StatelessWidget {decoration: BoxDecoration(boxShadow: [BoxShadow(- color: getEnteColorScheme(context).alternativeColor,+ color: Theme.of(context).colorScheme.surface,spreadRadius: 200,blurRadius: 100,offset: const Offset(0, 230),@@ -38,7 +39,7 @@ class DynamicFAB extends StatelessWidget {FloatingActionButton(heroTag: 'FAB',backgroundColor:- getEnteColorScheme(context).dynamicFABBackgroundColor,+ Theme.of(context).colorScheme.dynamicFABBackgroundColor,foregroundColor: getEnteColorScheme(context).dynamicFABTextColor,onPressed: isFormValid!? onPressedFunction as void Function()?@@ -64,12 +65,7 @@ class DynamicFAB extends StatelessWidget {child: OutlinedButton(onPressed:isFormValid! ? onPressedFunction as void Function()? : null,- child: Text(- buttonText!,- style: isFormValid!- ? getEnteTextTheme(context).body- : getEnteTextTheme(context).bodyFaint,- ),+ child: Text(buttonText!),),);}diff --git a/mobile/packages/ui/lib/components/dialog_widget.dart b/mobile/packages/ui/lib/components/dialog_widget.dartindex 53be98c476..36d849a719 100644--- a/mobile/packages/ui/lib/components/dialog_widget.dart+++ b/mobile/packages/ui/lib/components/dialog_widget.dart@@ -8,6 +8,8 @@ import 'package:ente_ui/components/buttons/models/button_type.dart';import 'package:ente_ui/components/components_constants.dart';import 'package:ente_ui/components/separators.dart';import 'package:ente_ui/components/text_input_widget.dart';+import "package:ente_ui/theme/colors.dart";+import "package:ente_ui/theme/effects.dart";import 'package:ente_ui/theme/ente_theme.dart';import 'package:flutter/material.dart';@@ -24,7 +26,7 @@ Future<ButtonResult?> showDialogWidget({return showDialog(useRootNavigator: useRootNavigator,barrierDismissible: isDismissible,- barrierColor: getEnteColorScheme(context).backdropFaint,+ barrierColor: backdropFaintDark,context: context,builder: (context) {final widthOfScreen = MediaQuery.of(context).size.width;@@ -70,7 +72,7 @@ class DialogWidget extends StatelessWidget {: const EdgeInsets.fromLTRB(6, 8, 6, 6),decoration: BoxDecoration(color: colorScheme.backgroundElevated,- boxShadow: getEnteShadowFloat(context),+ boxShadow: shadowFloatLight,borderRadius: const BorderRadius.all(Radius.circular(8)),),child: Material(@@ -225,7 +227,7 @@ class _TextInputDialogState extends State<TextInputDialog> {: const EdgeInsets.fromLTRB(6, 8, 6, 6),decoration: BoxDecoration(color: colorScheme.backgroundElevated,- boxShadow: getEnteShadowFloat(context),+ boxShadow: shadowFloatLight,borderRadius: const BorderRadius.all(Radius.circular(8)),),child: Padding(diff --git a/mobile/packages/ui/lib/theme/ente_theme.dart b/mobile/packages/ui/lib/theme/ente_theme.dartindex b8825bb70b..1fac82d428 100644--- a/mobile/packages/ui/lib/theme/ente_theme.dart+++ b/mobile/packages/ui/lib/theme/ente_theme.dart@@ -1,5 +1,6 @@import 'package:ente_ui/theme/colors.dart';import 'package:ente_ui/theme/effects.dart';+import "package:ente_ui/theme/ente_theme_data.dart";import 'package:ente_ui/theme/text_style.dart';import 'package:flutter/material.dart';@@ -50,20 +51,17 @@ EnteColorScheme getEnteColorScheme(// Fallback to old system if new system is not availablereturn inverse- ? getEnteColorScheme(context).inverseEnteTheme.colorScheme- : getEnteColorScheme(context);+ ? Theme.of(context).colorScheme.inverseEnteTheme.colorScheme+ : Theme.of(context).colorScheme.enteTheme.colorScheme;}EnteTextTheme getEnteTextTheme(BuildContext context, {bool inverse = false,}) {- final isDark = Theme.of(context).brightness == Brightness.dark;- if (inverse) {- return isDark ? lightTextTheme : darkTextTheme;- } else {- return isDark ? darkTextTheme : lightTextTheme;- }+ return inverse+ ? Theme.of(context).colorScheme.inverseEnteTheme.textTheme+ : Theme.of(context).colorScheme.enteTheme.textTheme;}/// Get theme-aware shadow for floating elements (dialogs, modals, etc.)