]> git.proxmox.com Git - flutter/proxmox_login_manager.git/commitdiff
adapt to toggleableActiveColor property having been deprecated
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 3 Apr 2024 06:11:06 +0000 (08:11 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 3 Apr 2024 06:15:19 +0000 (08:15 +0200)
ThemeData's toggleableActiveColor property has been deprecated [0].
This fix was done by `dart fix --apply` and thus is naturally a
relative broad automatic fix where we might only require a subset
from, but for now just trust the linter to do the safe thing.

[0]: https://docs.flutter.dev/release/breaking-changes/toggleable-active-color

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
lib/proxmox_login_form.dart

index 1509e1032e83b04cfbeb40f86ff400c4e1090170..b6a4c832622d48cfd791369f6b09a99484eed4e9 100644 (file)
@@ -251,11 +251,56 @@ class _ProxmoxLoginPageState extends State<ProxmoxLoginPage> {
             disabledBackgroundColor: Colors.grey,
           ),
         ),
-        toggleableActiveColor: ProxmoxColors.orange,
         colorScheme: ColorScheme.dark().copyWith(
             primary: ProxmoxColors.orange,
             secondary: ProxmoxColors.orange,
             onSecondary: ProxmoxColors.supportGrey),
+        checkboxTheme: CheckboxThemeData(
+          fillColor: MaterialStateProperty.resolveWith<Color?>(
+              (Set<MaterialState> states) {
+            if (states.contains(MaterialState.disabled)) {
+              return null;
+            }
+            if (states.contains(MaterialState.selected)) {
+              return ProxmoxColors.orange;
+            }
+            return null;
+          }),
+        ),
+        radioTheme: RadioThemeData(
+          fillColor: MaterialStateProperty.resolveWith<Color?>(
+              (Set<MaterialState> states) {
+            if (states.contains(MaterialState.disabled)) {
+              return null;
+            }
+            if (states.contains(MaterialState.selected)) {
+              return ProxmoxColors.orange;
+            }
+            return null;
+          }),
+        ),
+        switchTheme: SwitchThemeData(
+          thumbColor: MaterialStateProperty.resolveWith<Color?>(
+              (Set<MaterialState> states) {
+            if (states.contains(MaterialState.disabled)) {
+              return null;
+            }
+            if (states.contains(MaterialState.selected)) {
+              return ProxmoxColors.orange;
+            }
+            return null;
+          }),
+          trackColor: MaterialStateProperty.resolveWith<Color?>(
+              (Set<MaterialState> states) {
+            if (states.contains(MaterialState.disabled)) {
+              return null;
+            }
+            if (states.contains(MaterialState.selected)) {
+              return ProxmoxColors.orange;
+            }
+            return null;
+          }),
+        ),
       ),
       child: Scaffold(
         backgroundColor: ProxmoxColors.supportBlue,
@@ -735,7 +780,7 @@ class ProxmoxCertificateErrorDialog extends StatelessWidget {
             Text(
               'Note: Consider to disable SSL validation,'
               ' if you use a self signed, not commonly trusted, certificate.',
-              style: Theme.of(context).textTheme.caption,
+              style: Theme.of(context).textTheme.bodySmall,
             ),
           ],
         ),