public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH proxmox_login_manager] refactor: rename `MaterialState` to `WidgetState`
@ 2025-05-13 12:46 Shan Shaji
  2025-05-21 11:12 ` Dominik Csapak
  0 siblings, 1 reply; 3+ messages in thread
From: Shan Shaji @ 2025-05-13 12:46 UTC (permalink / raw)
  To: pve-devel

This commit applys the `dart fix` command to fix all the dart
analysis issues associated with renaming `MaterialState` to
`WidgetState`.

According to the flutter official docs [0] the `MaterialState` and it's
related APIs have been moved out of the material library and renamed to
`WidgetState`. The behaviour of the two are the same.

- [0] https://docs.flutter.dev/release/breaking-changes/material-state

Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---
 lib/proxmox_login_form.dart     | 34 ++++++++++++++++-----------------
 lib/proxmox_login_selector.dart |  2 +-
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/lib/proxmox_login_form.dart b/lib/proxmox_login_form.dart
index 735bd42..06a57e1 100644
--- a/lib/proxmox_login_form.dart
+++ b/lib/proxmox_login_form.dart
@@ -257,46 +257,46 @@ class _ProxmoxLoginPageState extends State<ProxmoxLoginPage> {
             secondary: ProxmoxColors.orange,
             onSecondary: ProxmoxColors.supportGrey),
         checkboxTheme: CheckboxThemeData(
-          fillColor: MaterialStateProperty.resolveWith<Color?>(
-              (Set<MaterialState> states) {
-            if (states.contains(MaterialState.disabled)) {
+          fillColor: WidgetStateProperty.resolveWith<Color?>(
+              (Set<WidgetState> states) {
+            if (states.contains(WidgetState.disabled)) {
               return null;
             }
-            if (states.contains(MaterialState.selected)) {
+            if (states.contains(WidgetState.selected)) {
               return ProxmoxColors.orange;
             }
             return null;
           }),
         ),
         radioTheme: RadioThemeData(
-          fillColor: MaterialStateProperty.resolveWith<Color?>(
-              (Set<MaterialState> states) {
-            if (states.contains(MaterialState.disabled)) {
+          fillColor: WidgetStateProperty.resolveWith<Color?>(
+              (Set<WidgetState> states) {
+            if (states.contains(WidgetState.disabled)) {
               return null;
             }
-            if (states.contains(MaterialState.selected)) {
+            if (states.contains(WidgetState.selected)) {
               return ProxmoxColors.orange;
             }
             return null;
           }),
         ),
         switchTheme: SwitchThemeData(
-          thumbColor: MaterialStateProperty.resolveWith<Color?>(
-              (Set<MaterialState> states) {
-            if (states.contains(MaterialState.disabled)) {
+          thumbColor: WidgetStateProperty.resolveWith<Color?>(
+              (Set<WidgetState> states) {
+            if (states.contains(WidgetState.disabled)) {
               return null;
             }
-            if (states.contains(MaterialState.selected)) {
+            if (states.contains(WidgetState.selected)) {
               return ProxmoxColors.orange;
             }
             return null;
           }),
-          trackColor: MaterialStateProperty.resolveWith<Color?>(
-              (Set<MaterialState> states) {
-            if (states.contains(MaterialState.disabled)) {
+          trackColor: WidgetStateProperty.resolveWith<Color?>(
+              (Set<WidgetState> states) {
+            if (states.contains(WidgetState.disabled)) {
               return null;
             }
-            if (states.contains(MaterialState.selected)) {
+            if (states.contains(WidgetState.selected)) {
               return ProxmoxColors.orange;
             }
             return null;
@@ -729,7 +729,7 @@ class ProxmoxProgressOverlay extends StatelessWidget {
   @override
   Widget build(BuildContext context) {
     return Container(
-      decoration: BoxDecoration(color: Colors.black.withOpacity(0.5)),
+      decoration: BoxDecoration(color: Colors.black.withValues(alpha: 0.5)),
       child: Center(
         child: Column(
           mainAxisAlignment: MainAxisAlignment.center,
diff --git a/lib/proxmox_login_selector.dart b/lib/proxmox_login_selector.dart
index f063699..e5741f2 100644
--- a/lib/proxmox_login_selector.dart
+++ b/lib/proxmox_login_selector.dart
@@ -31,7 +31,7 @@ class _ProxmoxLoginSelectorState extends State<ProxmoxLoginSelector> {
   Widget build(BuildContext context) {
     return SafeArea(
       child: Scaffold(
-        backgroundColor: Theme.of(context).colorScheme.background,
+        backgroundColor: Theme.of(context).colorScheme.surfaceContainer,
         appBar: AppBar(
           title: const Column(
             crossAxisAlignment: CrossAxisAlignment.start,
-- 
2.39.5 (Apple Git-154)



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pve-devel] [PATCH proxmox_login_manager] refactor: rename `MaterialState` to `WidgetState`
  2025-05-13 12:46 [pve-devel] [PATCH proxmox_login_manager] refactor: rename `MaterialState` to `WidgetState` Shan Shaji
@ 2025-05-21 11:12 ` Dominik Csapak
  2025-05-22  7:32   ` Shan Shaji
  0 siblings, 1 reply; 3+ messages in thread
From: Dominik Csapak @ 2025-05-21 11:12 UTC (permalink / raw)
  To: pve-devel

not a super big issue, but 2 hunks seem to be unrelated to the commit message
(see inline)

it would be much nicer to have the commits clean, so I'd appreciate it when you send
a v2 that either
* has separate patches for the different things (i would much prefer that)
* change the commit message to include what is fixed/improved

On 5/13/25 14:46, Shan Shaji wrote:
> This commit applys the `dart fix` command to fix all the dart
> analysis issues associated with renaming `MaterialState` to
> `WidgetState`.
> 
> According to the flutter official docs [0] the `MaterialState` and it's
> related APIs have been moved out of the material library and renamed to
> `WidgetState`. The behaviour of the two are the same.
> 
> - [0] https://docs.flutter.dev/release/breaking-changes/material-state
> 
> Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
> ---
>   lib/proxmox_login_form.dart     | 34 ++++++++++++++++-----------------
>   lib/proxmox_login_selector.dart |  2 +-
>   2 files changed, 18 insertions(+), 18 deletions(-)
> 
> diff --git a/lib/proxmox_login_form.dart b/lib/proxmox_login_form.dart
> index 735bd42..06a57e1 100644
> --- a/lib/proxmox_login_form.dart
> +++ b/lib/proxmox_login_form.dart
> @@ -257,46 +257,46 @@ class _ProxmoxLoginPageState extends State<ProxmoxLoginPage> {
>               secondary: ProxmoxColors.orange,
>               onSecondary: ProxmoxColors.supportGrey),
>           checkboxTheme: CheckboxThemeData(
> -          fillColor: MaterialStateProperty.resolveWith<Color?>(
> -              (Set<MaterialState> states) {
> -            if (states.contains(MaterialState.disabled)) {
> +          fillColor: WidgetStateProperty.resolveWith<Color?>(
> +              (Set<WidgetState> states) {
> +            if (states.contains(WidgetState.disabled)) {
>                 return null;
>               }
> -            if (states.contains(MaterialState.selected)) {
> +            if (states.contains(WidgetState.selected)) {
>                 return ProxmoxColors.orange;
>               }
>               return null;
>             }),
>           ),
>           radioTheme: RadioThemeData(
> -          fillColor: MaterialStateProperty.resolveWith<Color?>(
> -              (Set<MaterialState> states) {
> -            if (states.contains(MaterialState.disabled)) {
> +          fillColor: WidgetStateProperty.resolveWith<Color?>(
> +              (Set<WidgetState> states) {
> +            if (states.contains(WidgetState.disabled)) {
>                 return null;
>               }
> -            if (states.contains(MaterialState.selected)) {
> +            if (states.contains(WidgetState.selected)) {
>                 return ProxmoxColors.orange;
>               }
>               return null;
>             }),
>           ),
>           switchTheme: SwitchThemeData(
> -          thumbColor: MaterialStateProperty.resolveWith<Color?>(
> -              (Set<MaterialState> states) {
> -            if (states.contains(MaterialState.disabled)) {
> +          thumbColor: WidgetStateProperty.resolveWith<Color?>(
> +              (Set<WidgetState> states) {
> +            if (states.contains(WidgetState.disabled)) {
>                 return null;
>               }
> -            if (states.contains(MaterialState.selected)) {
> +            if (states.contains(WidgetState.selected)) {
>                 return ProxmoxColors.orange;
>               }
>               return null;
>             }),
> -          trackColor: MaterialStateProperty.resolveWith<Color?>(
> -              (Set<MaterialState> states) {
> -            if (states.contains(MaterialState.disabled)) {
> +          trackColor: WidgetStateProperty.resolveWith<Color?>(
> +              (Set<WidgetState> states) {
> +            if (states.contains(WidgetState.disabled)) {
>                 return null;
>               }
> -            if (states.contains(MaterialState.selected)) {
> +            if (states.contains(WidgetState.selected)) {
>                 return ProxmoxColors.orange;
>               }
>               return null;
> @@ -729,7 +729,7 @@ class ProxmoxProgressOverlay extends StatelessWidget {
>     @override
>     Widget build(BuildContext context) {
>       return Container(
> -      decoration: BoxDecoration(color: Colors.black.withOpacity(0.5)),
> +      decoration: BoxDecoration(color: Colors.black.withValues(alpha: 0.5)),

this is not part of the `dart fix` output, but just a deprecation AFAICS

>         child: Center(
>           child: Column(
>             mainAxisAlignment: MainAxisAlignment.center,
> diff --git a/lib/proxmox_login_selector.dart b/lib/proxmox_login_selector.dart
> index f063699..e5741f2 100644
> --- a/lib/proxmox_login_selector.dart
> +++ b/lib/proxmox_login_selector.dart
> @@ -31,7 +31,7 @@ class _ProxmoxLoginSelectorState extends State<ProxmoxLoginSelector> {
>     Widget build(BuildContext context) {
>       return SafeArea(
>         child: Scaffold(
> -        backgroundColor: Theme.of(context).colorScheme.background,
> +        backgroundColor: Theme.of(context).colorScheme.surfaceContainer,

this is part of `dart fix` but unrelated to the commit message, as you only mentioned the
MaaterialState -> WidgetState  change

>           appBar: AppBar(
>             title: const Column(
>               crossAxisAlignment: CrossAxisAlignment.start,



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pve-devel] [PATCH proxmox_login_manager] refactor: rename `MaterialState` to `WidgetState`
  2025-05-21 11:12 ` Dominik Csapak
@ 2025-05-22  7:32   ` Shan Shaji
  0 siblings, 0 replies; 3+ messages in thread
From: Shan Shaji @ 2025-05-22  7:32 UTC (permalink / raw)
  To: Proxmox VE development discussion


Thank you so much for the review. I will seperate this into multiple
patches. 


On Wed May 21, 2025 at 1:12 PM CEST, Dominik Csapak wrote:
> not a super big issue, but 2 hunks seem to be unrelated to the commit message
> (see inline)
>
> it would be much nicer to have the commits clean, so I'd appreciate it when you send
> a v2 that either
> * has separate patches for the different things (i would much prefer that)
> * change the commit message to include what is fixed/improved

> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-05-22  7:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-13 12:46 [pve-devel] [PATCH proxmox_login_manager] refactor: rename `MaterialState` to `WidgetState` Shan Shaji
2025-05-21 11:12 ` Dominik Csapak
2025-05-22  7:32   ` Shan Shaji

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal