浏览代码

dart fix --apply

Neeraj Gupta 1 年之前
父节点
当前提交
0a010994ee

+ 9 - 11
lib/app/view/app_theme_extension.dart

@@ -38,9 +38,7 @@ final darkTheme = ThemeData(
   fontFamily: "Inter",
   brightness: Brightness.dark,
   scaffoldBackgroundColor: Colors.black,
-  backgroundColor: Colors.black,
   appBarTheme: const AppBarTheme(color: Colors.orange),
-  colorScheme: const ColorScheme.dark(primary: Colors.white),
   textTheme: _buildTextTheme(Colors.white),
   outlinedButtonTheme: buildOutlinedButtonThemeData(
     bgDisabled: Colors.grey.shade500,
@@ -59,25 +57,25 @@ final darkTheme = ThemeData(
       borderSide: BorderSide.none,
       borderRadius: BorderRadius.circular(6),
     ),
-  ),
+  ), colorScheme: const ColorScheme.dark(primary: Colors.white).copyWith(background: Colors.black),
 );
 
 TextTheme _buildTextTheme(Color textColor) {
   return const TextTheme().copyWith(
-    headline4: TextStyle(
+    headlineMedium: TextStyle(
       color: textColor,
       fontSize: 32,
       fontWeight: FontWeight.w700,
       fontFamily: "Inter",
     ),
-    headline5: TextStyle(
+    headlineSmall: TextStyle(
       color: textColor,
       fontSize: 24,
       fontWeight: FontWeight.w600,
       fontFamily: "Inter",
     ),
     // AG: Body
-    headline6: TextStyle(
+    titleLarge: TextStyle(
       color: textColor,
       fontSize: 18,
       fontFamily: "Inter",
@@ -92,31 +90,31 @@ TextTheme _buildTextTheme(Color textColor) {
       height: 28,
     ),
 
-    subtitle1: TextStyle(
+    titleMedium: TextStyle(
       color: textColor,
       fontFamily: "Inter",
       fontSize: 16,
       fontWeight: FontWeight.w500,
     ),
-    subtitle2: TextStyle(
+    titleSmall: TextStyle(
       color: textColor,
       fontFamily: "Inter",
       fontSize: 14,
       fontWeight: FontWeight.w500,
     ),
-    bodyText1: TextStyle(
+    bodyLarge: TextStyle(
       fontFamily: "Inter",
       color: textColor,
       fontSize: 16,
       fontWeight: FontWeight.w500,
     ),
-    bodyText2: TextStyle(
+    bodyMedium: TextStyle(
       fontFamily: "Inter",
       color: textColor,
       fontSize: 14,
       fontWeight: FontWeight.w500,
     ),
-    caption: TextStyle(
+    bodySmall: TextStyle(
       color: textColor.withOpacity(0.6),
       fontSize: 14,
       fontWeight: FontWeight.w500,

+ 51 - 25
lib/ente_theme_data.dart

@@ -11,10 +11,6 @@ final lightThemeData = ThemeData(
   iconTheme: const IconThemeData(color: Colors.black),
   primaryIconTheme:
       const IconThemeData(color: Colors.red, opacity: 1.0, size: 50.0),
-  colorScheme: const ColorScheme.light(
-    primary: Colors.black,
-    secondary: Color.fromARGB(255, 163, 163, 163),
-  ),
   outlinedButtonTheme: buildOutlinedButtonThemeData(
     bgDisabled: const Color.fromRGBO(158, 158, 158, 1),
     bgEnabled: const Color.fromRGBO(0, 0, 0, 1),
@@ -25,9 +21,7 @@ final lightThemeData = ThemeData(
     onPrimary: const Color.fromRGBO(255, 255, 255, 1),
     primary: const Color.fromRGBO(0, 0, 0, 1),
   ),
-  toggleableActiveColor: const Color.fromRGBO(102, 187, 106, 1),
   scaffoldBackgroundColor: const Color.fromRGBO(255, 255, 255, 1),
-  backgroundColor: const Color.fromRGBO(255, 255, 255, 1),
   appBarTheme: const AppBarTheme().copyWith(
     backgroundColor: Colors.white,
     foregroundColor: Colors.black,
@@ -37,8 +31,8 @@ final lightThemeData = ThemeData(
   //https://api.flutter.dev/flutter/material/TextTheme-class.html
   textTheme: _buildTextTheme(const Color.fromRGBO(0, 0, 0, 1)),
   primaryTextTheme: const TextTheme().copyWith(
-    bodyText2: const TextStyle(color: Colors.yellow),
-    bodyText1: const TextStyle(color: Colors.orange),
+    bodyMedium: const TextStyle(color: Colors.yellow),
+    bodyLarge: const TextStyle(color: Colors.orange),
   ),
   cardColor: const Color.fromRGBO(250, 250, 250, 1.0),
   dialogTheme: const DialogTheme().copyWith(
@@ -78,7 +72,27 @@ final lightThemeData = ThemeData(
           ? const Color.fromRGBO(255, 255, 255, 1)
           : const Color.fromRGBO(0, 0, 0, 1);
     }),
-  ),
+  ),  radioTheme: RadioThemeData(
+ fillColor: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
+ if (states.contains(MaterialState.disabled)) { return null; }
+ if (states.contains(MaterialState.selected)) { return const Color.fromRGBO(102, 187, 106, 1); }
+ return null;
+ }),
+ ), switchTheme: SwitchThemeData(
+ thumbColor: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
+ if (states.contains(MaterialState.disabled)) { return null; }
+ if (states.contains(MaterialState.selected)) { return const Color.fromRGBO(102, 187, 106, 1); }
+ return null;
+ }),
+ trackColor: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
+ if (states.contains(MaterialState.disabled)) { return null; }
+ if (states.contains(MaterialState.selected)) { return const Color.fromRGBO(102, 187, 106, 1); }
+ return null;
+ }),
+ ), colorScheme: const ColorScheme.light(
+    primary: Colors.black,
+    secondary: Color.fromARGB(255, 163, 163, 163),
+  ).copyWith(background: const Color.fromRGBO(255, 255, 255, 1)),
 );
 
 final darkThemeData = ThemeData(
@@ -89,12 +103,10 @@ final darkThemeData = ThemeData(
   primaryIconTheme:
       const IconThemeData(color: Colors.red, opacity: 1.0, size: 50.0),
   hintColor: const Color.fromRGBO(158, 158, 158, 1),
-  colorScheme: const ColorScheme.dark(primary: Colors.white),
   buttonTheme: const ButtonThemeData().copyWith(
     buttonColor: const Color.fromRGBO(45, 194, 98, 1.0),
   ),
   textTheme: _buildTextTheme(const Color.fromRGBO(255, 255, 255, 1)),
-  toggleableActiveColor: const Color.fromRGBO(102, 187, 106, 1),
   outlinedButtonTheme: buildOutlinedButtonThemeData(
     bgDisabled: const Color.fromRGBO(158, 158, 158, 1),
     bgEnabled: const Color.fromRGBO(255, 255, 255, 1),
@@ -106,7 +118,6 @@ final darkThemeData = ThemeData(
     primary: const Color.fromRGBO(255, 255, 255, 1),
   ),
   scaffoldBackgroundColor: const Color.fromRGBO(0, 0, 0, 1),
-  backgroundColor: const Color.fromRGBO(0, 0, 0, 1),
   appBarTheme: const AppBarTheme().copyWith(
     color: Colors.black,
     elevation: 0,
@@ -153,59 +164,76 @@ final darkThemeData = ThemeData(
         return const Color.fromRGBO(158, 158, 158, 1);
       }
     }),
-  ),
+  ), radioTheme: RadioThemeData(
+ fillColor: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
+ if (states.contains(MaterialState.disabled)) { return null; }
+ if (states.contains(MaterialState.selected)) { return const Color.fromRGBO(102, 187, 106, 1); }
+ return null;
+ }),
+ ), switchTheme: SwitchThemeData(
+ thumbColor: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
+ if (states.contains(MaterialState.disabled)) { return null; }
+ if (states.contains(MaterialState.selected)) { return const Color.fromRGBO(102, 187, 106, 1); }
+ return null;
+ }),
+ trackColor: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
+ if (states.contains(MaterialState.disabled)) { return null; }
+ if (states.contains(MaterialState.selected)) { return const Color.fromRGBO(102, 187, 106, 1); }
+ return null;
+ }),
+ ), colorScheme: const ColorScheme.dark(primary: Colors.white).copyWith(background: const Color.fromRGBO(0, 0, 0, 1)),
 );
 
 TextTheme _buildTextTheme(Color textColor) {
   return const TextTheme().copyWith(
-    headline4: TextStyle(
+    headlineMedium: TextStyle(
       color: textColor,
       fontSize: 32,
       fontWeight: FontWeight.w600,
       fontFamily: 'Inter',
     ),
-    headline5: TextStyle(
+    headlineSmall: TextStyle(
       color: textColor,
       fontSize: 24,
       fontWeight: FontWeight.w600,
       fontFamily: 'Inter',
     ),
-    headline6: TextStyle(
+    titleLarge: TextStyle(
       color: textColor,
       fontSize: 18,
       fontFamily: 'Inter',
       fontWeight: FontWeight.w600,
     ),
-    subtitle1: TextStyle(
+    titleMedium: TextStyle(
       color: textColor,
       fontFamily: 'Inter',
       fontSize: 16,
       fontWeight: FontWeight.w500,
     ),
-    subtitle2: TextStyle(
+    titleSmall: TextStyle(
       color: textColor,
       fontFamily: 'Inter',
       fontSize: 14,
       fontWeight: FontWeight.w500,
     ),
-    bodyText1: TextStyle(
+    bodyLarge: TextStyle(
       fontFamily: 'Inter',
       color: textColor,
       fontSize: 16,
       fontWeight: FontWeight.w500,
     ),
-    bodyText2: TextStyle(
+    bodyMedium: TextStyle(
       fontFamily: 'Inter',
       color: textColor,
       fontSize: 14,
       fontWeight: FontWeight.w500,
     ),
-    caption: TextStyle(
+    bodySmall: TextStyle(
       color: textColor.withOpacity(0.4),
       fontSize: 10,
       fontWeight: FontWeight.w500,
     ),
-    overline: TextStyle(
+    labelSmall: TextStyle(
       fontFamily: 'Inter',
       color: textColor,
       fontSize: 14,
@@ -408,9 +436,7 @@ ElevatedButtonThemeData buildElevatedButtonThemeData({
 }) {
   return ElevatedButtonThemeData(
     style: ElevatedButton.styleFrom(
-      elevation: elevation,
-      onPrimary: onPrimary,
-      primary: primary,
+      foregroundColor: onPrimary, backgroundColor: primary, elevation: elevation,
       alignment: Alignment.center,
       textStyle: const TextStyle(
         fontWeight: FontWeight.w600,

+ 2 - 2
lib/onboarding/view/onboarding_page.dart

@@ -103,14 +103,14 @@ class _OnboardingPageState extends State<OnboardingPage> {
                         const SizedBox(height: 4),
                         Text(
                           "Authenticator",
-                          style: Theme.of(context).textTheme.headline4,
+                          style: Theme.of(context).textTheme.headlineMedium,
                         ),
                         const SizedBox(height: 32),
                         Text(
                           l10n.onBoardingBody,
                           textAlign: TextAlign.center,
                           style:
-                              Theme.of(context).textTheme.headline6!.copyWith(
+                              Theme.of(context).textTheme.titleLarge!.copyWith(
                                     color: Colors.white38,
                                   ),
                         ),

+ 1 - 1
lib/services/user_service.dart

@@ -902,7 +902,7 @@ class UserService {
   }
 
   bool? canDisableEmailMFA() {
-    return _preferences.getBool(kCanDisableEmailMFA);;
+    return _preferences.getBool(kCanDisableEmailMFA);
   }
   bool hasEmailMFAEnabled() {
     return _preferences.getBool(kIsEmailMFAEnabled) ?? true;

+ 2 - 2
lib/ui/account/delete_account_page.dart

@@ -48,7 +48,7 @@ class DeleteAccountPage extends StatelessWidget {
               Center(
                 child: Text(
                   l10n.deleteAccountQuery,
-                  style: Theme.of(context).textTheme.subtitle1,
+                  style: Theme.of(context).textTheme.titleMedium,
                 ),
               ),
               const SizedBox(
@@ -67,7 +67,7 @@ class DeleteAccountPage extends StatelessWidget {
                       text: ", maybe there is a way we can help.",
                     ),
                   ],
-                  style: Theme.of(context).textTheme.subtitle1,
+                  style: Theme.of(context).textTheme.titleMedium,
                 ),
               ),
               const SizedBox(

+ 10 - 16
lib/ui/account/email_entry_page.dart

@@ -135,13 +135,13 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
                       const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
                   child: Text(
                     context.l10n.createNewAccount,
-                    style: Theme.of(context).textTheme.headline4,
+                    style: Theme.of(context).textTheme.headlineMedium,
                   ),
                 ),
                 Padding(
                   padding: const EdgeInsets.fromLTRB(20, 0, 20, 0),
                   child: TextFormField(
-                    style: Theme.of(context).textTheme.subtitle1,
+                    style: Theme.of(context).textTheme.titleMedium,
                     autofillHints: const [AutofillHints.email],
                     decoration: InputDecoration(
                       fillColor: _emailIsValid ? _validFieldValueColor : null,
@@ -372,11 +372,10 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
             child: StyledText(
               text: context.l10n.signUpTerms,
               style:
-                  Theme.of(context).textTheme.subtitle1!.copyWith(fontSize: 12),
+                  Theme.of(context).textTheme.titleMedium!.copyWith(fontSize: 12),
               tags: {
                 'u-terms': StyledTextActionTag(
-                  (String? text, Map<String?, String?> attrs) => {
-                    Navigator.of(context).push(
+                  (String? text, Map<String?, String?> attrs) => Navigator.of(context).push(
                       MaterialPageRoute(
                         builder: (BuildContext context) {
                           return WebPage(
@@ -385,15 +384,13 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
                           );
                         },
                       ),
-                    )
-                  },
+                    ),
                   style: const TextStyle(
                     decoration: TextDecoration.underline,
                   ),
                 ),
                 'u-policy': StyledTextActionTag(
-                  (String? text, Map<String?, String?> attrs) => {
-                    Navigator.of(context).push(
+                  (String? text, Map<String?, String?> attrs) => Navigator.of(context).push(
                       MaterialPageRoute(
                         builder: (BuildContext context) {
                           return WebPage(
@@ -402,8 +399,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
                           );
                         },
                       ),
-                    )
-                  },
+                    ),
                   style: const TextStyle(
                     decoration: TextDecoration.underline,
                   ),
@@ -439,11 +435,10 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
             child: StyledText(
               text: context.l10n.ackPasswordLostWarning,
               style:
-                  Theme.of(context).textTheme.subtitle1!.copyWith(fontSize: 12),
+                  Theme.of(context).textTheme.titleMedium!.copyWith(fontSize: 12),
               tags: {
                 'underline': StyledTextActionTag(
-                  (String? text, Map<String?, String?> attrs) => {
-                    Navigator.of(context).push(
+                  (String? text, Map<String?, String?> attrs) => Navigator.of(context).push(
                       MaterialPageRoute(
                         builder: (BuildContext context) {
                           return WebPage(
@@ -452,8 +447,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
                           );
                         },
                       ),
-                    )
-                  },
+                    ),
                   style: const TextStyle(
                     decoration: TextDecoration.underline,
                   ),

+ 6 - 10
lib/ui/account/login_page.dart

@@ -107,7 +107,7 @@ class _LoginPageState extends State<LoginPage> {
                       const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
                   child: Text(
                     l10n.welcomeBack,
-                    style: Theme.of(context).textTheme.headline4,
+                    style: Theme.of(context).textTheme.headlineMedium,
                   ),
                 ),
                 Padding(
@@ -172,12 +172,11 @@ class _LoginPageState extends State<LoginPage> {
                           text: context.l10n.loginTerms,
                           style: Theme.of(context)
                               .textTheme
-                              .subtitle1!
+                              .titleMedium!
                               .copyWith(fontSize: 12),
                           tags: {
                             'u-terms': StyledTextActionTag(
-                              (String? text, Map<String?, String?> attrs) => {
-                                Navigator.of(context).push(
+                              (String? text, Map<String?, String?> attrs) => Navigator.of(context).push(
                                   MaterialPageRoute(
                                     builder: (BuildContext context) {
                                       return WebPage(
@@ -186,15 +185,13 @@ class _LoginPageState extends State<LoginPage> {
                                       );
                                     },
                                   ),
-                                )
-                              },
+                                ),
                               style: const TextStyle(
                                 decoration: TextDecoration.underline,
                               ),
                             ),
                             'u-policy': StyledTextActionTag(
-                              (String? text, Map<String?, String?> attrs) => {
-                                Navigator.of(context).push(
+                              (String? text, Map<String?, String?> attrs) => Navigator.of(context).push(
                                   MaterialPageRoute(
                                     builder: (BuildContext context) {
                                       return WebPage(
@@ -203,8 +200,7 @@ class _LoginPageState extends State<LoginPage> {
                                       );
                                     },
                                   ),
-                                )
-                              },
+                                ),
                               style: const TextStyle(
                                 decoration: TextDecoration.underline,
                               ),

+ 6 - 7
lib/ui/account/ott_verification_page.dart

@@ -68,8 +68,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
       body: _getBody(),
       floatingActionButton: DynamicFAB(
         isKeypadOpen: isKeypadOpen,
-        isFormValid: !(_verificationCodeController.text == null ||
-            _verificationCodeController.text.isEmpty),
+        isFormValid: !(_verificationCodeController.text.isEmpty),
         buttonText: l10n.verify,
         onPressedFunction: () {
           if (widget.isChangeEmail) {
@@ -102,7 +101,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
               padding: const EdgeInsets.fromLTRB(20, 30, 20, 15),
               child: Text(
                 l10n.verifyEmail,
-                style: Theme.of(context).textTheme.headline4,
+                style: Theme.of(context).textTheme.headlineMedium,
               ),
             ),
             Padding(
@@ -119,7 +118,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
                             text: l10n.weHaveSendEmailTo(widget.email),
                             style: Theme.of(context)
                                 .textTheme
-                                .subtitle1!
+                                .titleMedium!
                                 .copyWith(fontSize: 14),
                             tags: {
                               'green': StyledTextTag(
@@ -144,7 +143,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
                                 l10n.checkInboxAndSpamFolder,
                                 style: Theme.of(context)
                                     .textTheme
-                                    .subtitle1!
+                                    .titleMedium!
                                     .copyWith(fontSize: 14),
                               ),
                       ],
@@ -160,7 +159,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
             Padding(
               padding: const EdgeInsets.fromLTRB(20, 16, 20, 16),
               child: TextFormField(
-                style: Theme.of(context).textTheme.subtitle1,
+                style: Theme.of(context).textTheme.titleMedium,
                 decoration: InputDecoration(
                   filled: true,
                   hintText: l10n.tapToEnterCode,
@@ -199,7 +198,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
                     },
                     child: Text(
                       l10n.resendEmail,
-                      style: Theme.of(context).textTheme.subtitle1!.copyWith(
+                      style: Theme.of(context).textTheme.titleMedium!.copyWith(
                             fontSize: 14,
                             decoration: TextDecoration.underline,
                           ),

+ 5 - 5
lib/ui/account/password_entry_page.dart

@@ -153,7 +153,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
                       const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
                   child: Text(
                     buttonTextAndHeading,
-                    style: Theme.of(context).textTheme.headline4,
+                    style: Theme.of(context).textTheme.headlineMedium,
                   ),
                 ),
                 Padding(
@@ -165,7 +165,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
                     textAlign: TextAlign.start,
                     style: Theme.of(context)
                         .textTheme
-                        .subtitle1!
+                        .titleMedium!
                         .copyWith(fontSize: 14),
                   ),
                 ),
@@ -176,11 +176,11 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
                     text: context.l10n.passwordWarning,
                     style: Theme.of(context)
                         .textTheme
-                        .subtitle1!
+                        .titleMedium!
                         .copyWith(fontSize: 14),
                     tags: {
                       'underline': StyledTextTag(
-                        style: Theme.of(context).textTheme.subtitle1!.copyWith(
+                        style: Theme.of(context).textTheme.titleMedium!.copyWith(
                               fontSize: 14,
                               decoration: TextDecoration.underline,
                             ),
@@ -356,7 +356,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
                     child: RichText(
                       text: TextSpan(
                         text: context.l10n.howItWorks,
-                        style: Theme.of(context).textTheme.subtitle1!.copyWith(
+                        style: Theme.of(context).textTheme.titleMedium!.copyWith(
                               fontSize: 14,
                               decoration: TextDecoration.underline,
                             ),

+ 4 - 4
lib/ui/account/recovery_key_page.dart

@@ -103,14 +103,14 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
                           ? const SizedBox.shrink()
                           : Text(
                               widget.title ?? context.l10n.recoveryKey,
-                              style: Theme.of(context).textTheme.headline4,
+                              style: Theme.of(context).textTheme.headlineMedium,
                             ),
                       Padding(
                         padding: EdgeInsets.all(widget.showAppBar! ? 0 : 12),
                       ),
                       Text(
                         widget.text ?? context.l10n.recoveryKeyOnForgotPassword,
-                        style: Theme.of(context).textTheme.subtitle1,
+                        style: Theme.of(context).textTheme.titleMedium,
                       ),
                       const Padding(padding: EdgeInsets.only(top: 24)),
                       DottedBorder(
@@ -164,7 +164,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
                                   child: Text(
                                     recoveryKey,
                                     style:
-                                        Theme.of(context).textTheme.bodyText1,
+                                        Theme.of(context).textTheme.bodyLarge,
                                   ),
                                 ),
                               ),
@@ -177,7 +177,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
                         child: Text(
                           widget.subText ??
                               context.l10n.recoveryKeySaveDescription,
-                          style: Theme.of(context).textTheme.bodyText1,
+                          style: Theme.of(context).textTheme.bodyLarge,
                         ),
                       ),
                       Expanded(

+ 2 - 2
lib/ui/account/recovery_page.dart

@@ -88,7 +88,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
                       const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
                   child: Text(
                     'Forgot password',
-                    style: Theme.of(context).textTheme.headline4,
+                    style: Theme.of(context).textTheme.headlineMedium,
                   ),
                 ),
                 Padding(
@@ -140,7 +140,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
                           child: Text(
                             "No recovery key?",
                             style:
-                                Theme.of(context).textTheme.subtitle1!.copyWith(
+                                Theme.of(context).textTheme.titleMedium!.copyWith(
                                       fontSize: 14,
                                       decoration: TextDecoration.underline,
                                     ),

+ 1 - 1
lib/ui/account/sessions_page.dart

@@ -162,7 +162,7 @@ class _SessionsPageState extends State<SessionsPage> {
             const Padding(padding: EdgeInsets.all(8)),
             Text(
               session.ua,
-              style: Theme.of(context).textTheme.caption,
+              style: Theme.of(context).textTheme.bodySmall,
             ),
           ],
         ),

+ 4 - 4
lib/ui/code_widget.dart

@@ -156,14 +156,14 @@ class _CodeWidgetState extends State<CodeWidget> {
                               children: [
                                 Text(
                                   safeDecode(widget.code.issuer).trim(),
-                                  style: Theme.of(context).textTheme.headline6,
+                                  style: Theme.of(context).textTheme.titleLarge,
                                 ),
                                 const SizedBox(height: 2),
                                 Text(
                                   safeDecode(widget.code.account).trim(),
                                   style: Theme.of(context)
                                       .textTheme
-                                      .caption
+                                      .bodySmall
                                       ?.copyWith(
                                         fontSize: 12,
                                         color: Colors.grey,
@@ -216,7 +216,7 @@ class _CodeWidgetState extends State<CodeWidget> {
                                       Text(
                                         l10n.nextTotpTitle,
                                         style:
-                                            Theme.of(context).textTheme.caption,
+                                            Theme.of(context).textTheme.bodySmall,
                                       ),
                                       ValueListenableBuilder<String>(
                                         valueListenable: _nextCode,
@@ -238,7 +238,7 @@ class _CodeWidgetState extends State<CodeWidget> {
                                       Text(
                                         l10n.nextTotpTitle,
                                         style:
-                                            Theme.of(context).textTheme.caption,
+                                            Theme.of(context).textTheme.bodySmall,
                                       ),
                                       InkWell(
                                         onTap: _onNextHotpTapped,

+ 1 - 1
lib/ui/common/bottom_shadow.dart

@@ -16,7 +16,7 @@ class BottomShadowWidget extends StatelessWidget {
         color: Colors.transparent,
         boxShadow: [
           BoxShadow(
-            color: shadowColor ?? Theme.of(context).backgroundColor,
+            color: shadowColor ?? Theme.of(context).colorScheme.background,
             spreadRadius: 42,
             blurRadius: 42,
             offset: Offset(0, offsetDy), // changes position of shadow

+ 1 - 1
lib/ui/common/dynamic_fab.dart

@@ -26,7 +26,7 @@ class DynamicFAB extends StatelessWidget {
         decoration: BoxDecoration(
           boxShadow: [
             BoxShadow(
-              color: Theme.of(context).backgroundColor,
+              color: Theme.of(context).colorScheme.background,
               spreadRadius: 200,
               blurRadius: 100,
               offset: const Offset(0, 230),

+ 2 - 2
lib/ui/common/report_bug.dart

@@ -6,10 +6,10 @@ PopupMenuButton<dynamic> reportBugPopupMenu(BuildContext context) {
     itemBuilder: (context) {
       final List<PopupMenuItem> items = [];
       items.add(
-        PopupMenuItem(
+        const PopupMenuItem(
           value: 1,
           child: Row(
-            children: const [
+            children: [
               Text("Contact support"),
             ],
           ),

+ 1 - 1
lib/ui/home/coach_mark_widget.dart

@@ -41,7 +41,7 @@ class CoachMarkWidget extends StatelessWidget {
                         ),
                         Text(
                           l10n.swipeHint,
-                          style: Theme.of(context).textTheme.headline6,
+                          style: Theme.of(context).textTheme.titleLarge,
                         ),
                         const SizedBox(
                           height: 36,

+ 1 - 1
lib/ui/home/home_empty_state.dart

@@ -36,7 +36,7 @@ class HomeEmptyStateWidget extends StatelessWidget {
                   Text(
                     l10n.setupFirstAccount,
                     textAlign: TextAlign.center,
-                    style: Theme.of(context).textTheme.headline4,
+                    style: Theme.of(context).textTheme.headlineMedium,
                   ),
                   const SizedBox(height: 64),
                   SizedBox(

+ 1 - 1
lib/ui/home_page.dart

@@ -248,7 +248,7 @@ class _HomePageState extends State<HomePage> {
                           Code? code;
                           try {
                             code = _filteredCodes[index];
-                            return CodeWidget(code!);
+                            return CodeWidget(code);
                           } catch (e, s) {
                             _logger.severe("code widget error", e, s);
                             return Center(

+ 2 - 2
lib/ui/settings/app_update_dialog.dart

@@ -27,7 +27,7 @@ class _AppUpdateDialogState extends State<AppUpdateDialog> {
           padding: const EdgeInsets.fromLTRB(8, 4, 0, 4),
           child: Text(
             "- " + log,
-            style: Theme.of(context).textTheme.caption!.copyWith(
+            style: Theme.of(context).textTheme.bodySmall!.copyWith(
                   fontSize: 14,
                 ),
           ),
@@ -65,7 +65,7 @@ class _AppUpdateDialogState extends State<AppUpdateDialog> {
             style: Theme.of(context).outlinedButtonTheme.style!.copyWith(
               textStyle: MaterialStateProperty.resolveWith<TextStyle?>(
                 (Set<MaterialState> states) {
-                  return Theme.of(context).textTheme.subtitle1;
+                  return Theme.of(context).textTheme.titleMedium;
                 },
               ),
             ),

+ 1 - 1
lib/ui/settings/app_version_widget.dart

@@ -49,7 +49,7 @@ class _AppVersionWidgetState extends State<AppVersionWidget> {
               padding: const EdgeInsets.all(20),
               child: Text(
                 "Version: " + snapshot.data!,
-                style: Theme.of(context).textTheme.caption,
+                style: Theme.of(context).textTheme.bodySmall,
               ),
             );
           }

+ 0 - 1
lib/ui/settings/data/import/google_auth_import.dart

@@ -13,7 +13,6 @@ import 'package:ente_auth/ui/components/models/button_type.dart';
 import 'package:ente_auth/ui/scanner_gauth_page.dart';
 import 'package:ente_auth/ui/settings/data/import/import_success.dart';
 import 'package:flutter/material.dart';
-import 'package:flutter/widgets.dart';
 import 'package:logging/logging.dart';
 
 const kGoogleAuthExportPrefix = 'otpauth-migration://offline?data=';

+ 1 - 2
lib/ui/settings/data/import/plain_text_import.dart

@@ -10,7 +10,6 @@ import 'package:ente_auth/store/code_store.dart';
 import 'package:ente_auth/ui/settings/data/import/import_success.dart';
 import 'package:ente_auth/utils/dialog_util.dart';
 import 'package:file_picker/file_picker.dart';
-import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:logging/logging.dart';
 
@@ -59,7 +58,7 @@ Future<void> showImportInstructionDialog(BuildContext context) async {
     shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
     title: Text(
       l10n.importCodes,
-      style: Theme.of(context).textTheme.headline6,
+      style: Theme.of(context).textTheme.titleLarge,
     ),
     content: const SingleChildScrollView(
       child: PlainTextImport(),

+ 0 - 1
lib/ui/settings/data/import_page.dart

@@ -7,7 +7,6 @@ import 'package:ente_auth/ui/components/menu_item_widget.dart';
 import 'package:ente_auth/ui/components/title_bar_title_widget.dart';
 import 'package:ente_auth/ui/components/title_bar_widget.dart';
 import 'package:ente_auth/ui/settings/data/import/import_service.dart';
-import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 
 enum ImportType {

+ 2 - 2
lib/ui/settings/settings_section_title.dart

@@ -24,9 +24,9 @@ class SettingsSectionTitle extends StatelessWidget {
             style: color != null
                 ? Theme.of(context)
                     .textTheme
-                    .headline6!
+                    .titleLarge!
                     .merge(TextStyle(color: color))
-                : Theme.of(context).textTheme.headline6,
+                : Theme.of(context).textTheme.titleLarge,
           ),
         ),
         const Padding(padding: EdgeInsets.all(4)),

+ 1 - 1
lib/ui/settings/settings_text_item.dart

@@ -23,7 +23,7 @@ class SettingsTextItem extends StatelessWidget {
           children: [
             Align(
               alignment: Alignment.centerLeft,
-              child: Text(text, style: Theme.of(context).textTheme.subtitle1),
+              child: Text(text, style: Theme.of(context).textTheme.titleMedium),
             ),
             Icon(icon),
           ],

+ 2 - 2
lib/utils/date_time_util.dart

@@ -201,8 +201,8 @@ Widget getDayWidget(
     child: Text(
       getDayTitle(timestamp),
       style: (getDayTitle(timestamp) == "Today" && !smallerTodayFont)
-          ? Theme.of(context).textTheme.headline5
-          : Theme.of(context).textTheme.caption?.copyWith(
+          ? Theme.of(context).textTheme.headlineSmall
+          : Theme.of(context).textTheme.bodySmall?.copyWith(
                 fontSize: 16,
                 fontWeight: FontWeight.w600,
                 fontFamily: 'Inter-SemiBold',

+ 1 - 1
lib/utils/dialog_util.dart

@@ -224,7 +224,7 @@ ProgressDialog createProgressDialog(
   );
   dialog.style(
     message: message,
-    messageTextStyle: Theme.of(context).textTheme.caption,
+    messageTextStyle: Theme.of(context).textTheme.bodySmall,
     backgroundColor: Theme.of(context).dialogTheme.backgroundColor,
     progressWidget: const EnteLoadingWidget(),
     borderRadius: 10,

+ 1 - 1
lib/utils/email_util.dart

@@ -229,7 +229,7 @@ Future<void> sendEmail(
       final Uri params = Uri(
         scheme: 'mailto',
         path: to,
-        query: 'subject=$_subject&body=${_body}',
+        query: 'subject=$_subject&body=$_body',
       );
       if (await canLaunchUrl(params)) {
         await launchUrl(params);