From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pve-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9])
	by lore.proxmox.com (Postfix) with ESMTPS id 1D3E11FF16E
	for <inbox@lore.proxmox.com>; Mon, 28 Apr 2025 17:47:09 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id 9CE67351F9;
	Mon, 28 Apr 2025 17:47:17 +0200 (CEST)
From: Shan Shaji <s.shaji@proxmox.com>
To: pve-devel@lists.proxmox.com
Date: Mon, 28 Apr 2025 17:45:12 +0200
Message-Id: <20250428154512.99559-1-s.shaji@proxmox.com>
X-Mailer: git-send-email 2.39.5
MIME-Version: 1.0
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.074 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DMARC_MISSING             0.1 Missing DMARC policy
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery
 methods
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to
 Validity was blocked. See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more
 information.
 RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to
 Validity was blocked. See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more
 information.
 RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to
 Validity was blocked. See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more
 information.
 RDNS_NONE 0.793 Delivered to internal network by a host with no rDNS
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_NONE                0.001 SPF: sender does not publish an SPF Record
Subject: [pve-devel] [PATCH pve_flutter_frontend] ui: replace deprecated
 `withOpacity` function
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Cc: Shan Shaji <s.shaji@proxmox.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: pve-devel-bounces@lists.proxmox.com
Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com>

As of flutter v3.27 the `withOpacity` function
is deprecated. This patch replaces all occurrences
of `withOpacity` with `withValues` function.

Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---
 lib/main.dart                                      |  4 ++--
 lib/pages/main_layout_slim.dart                    | 12 ++++++------
 lib/utils/dot_indicator.dart                       |  2 +-
 lib/widgets/proxmox_capacity_indicator.dart        |  6 +++---
 lib/widgets/proxmox_line_chart.dart                |  2 +-
 lib/widgets/pve_file_selector_widget.dart          |  4 ++--
 lib/widgets/pve_guest_migrate_widget.dart          |  4 ++--
 lib/widgets/pve_guest_overview_header.dart         |  4 ++--
 lib/widgets/pve_node_overview.dart                 |  4 ++--
 lib/widgets/pve_rrd_chart_widget.dart              |  3 ++-
 lib/widgets/pve_task_log_expansiontile_widget.dart |  2 +-
 11 files changed, 24 insertions(+), 23 deletions(-)

diff --git a/lib/main.dart b/lib/main.dart
index a985e3a..6b7d7f1 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -130,7 +130,7 @@ class MyApp extends StatelessWidget {
             foregroundColor: Colors.white, // onPrimary
           ),
           textSelectionTheme: TextSelectionThemeData(
-            selectionColor: ProxmoxColors.orange.withOpacity(0.4),
+            selectionColor: ProxmoxColors.orange.withValues(alpha: 0.4),
             selectionHandleColor: ProxmoxColors.orange,
             cursorColor: ProxmoxColors.orange,
           ),
@@ -173,7 +173,7 @@ class MyApp extends StatelessWidget {
           ),
           scaffoldBackgroundColor: ProxmoxColors.grey,
           textSelectionTheme: TextSelectionThemeData(
-            selectionColor: ProxmoxColors.orange.withOpacity(0.4),
+            selectionColor: ProxmoxColors.orange.withValues(alpha: 0.4),
             selectionHandleColor: ProxmoxColors.orange,
             cursorColor: ProxmoxColors.orange,
           ),
diff --git a/lib/pages/main_layout_slim.dart b/lib/pages/main_layout_slim.dart
index 322bcac..58146ea 100644
--- a/lib/pages/main_layout_slim.dart
+++ b/lib/pages/main_layout_slim.dart
@@ -897,7 +897,7 @@ class _MobileResourceFilterSheet extends StatelessWidget {
                             color: Theme.of(context)
                                 .colorScheme
                                 .onSurface
-                                .withOpacity(0.75)),
+                                .withValues(alpha: 0.75)),
                       ),
                       value: state.typeFilter.contains('node'),
                       onChanged: (v) => rBloc.events.add(FilterResources(
@@ -912,7 +912,7 @@ class _MobileResourceFilterSheet extends StatelessWidget {
                             color: Theme.of(context)
                                 .colorScheme
                                 .onSurface
-                                .withOpacity(0.75)),
+                                .withValues(alpha: 0.75)),
                       ),
                       value: state.typeFilter.contains('qemu'),
                       onChanged: (v) => rBloc.events.add(FilterResources(
@@ -927,7 +927,7 @@ class _MobileResourceFilterSheet extends StatelessWidget {
                             color: Theme.of(context)
                                 .colorScheme
                                 .onSurface
-                                .withOpacity(0.75)),
+                                .withValues(alpha: 0.75)),
                       ),
                       value: state.typeFilter.contains('lxc'),
                       onChanged: (v) => rBloc.events.add(FilterResources(
@@ -942,7 +942,7 @@ class _MobileResourceFilterSheet extends StatelessWidget {
                             color: Theme.of(context)
                                 .colorScheme
                                 .onSurface
-                                .withOpacity(0.75)),
+                                .withValues(alpha: 0.75)),
                       ),
                       value: state.typeFilter.contains('storage'),
                       onChanged: (v) => rBloc.events.add(FilterResources(
@@ -971,7 +971,7 @@ class _MobileResourceFilterSheet extends StatelessWidget {
                             color: Theme.of(context)
                                 .colorScheme
                                 .onSurface
-                                .withOpacity(0.75)),
+                                .withValues(alpha: 0.75)),
                       ),
                       value: state.statusFilter
                           .contains(PveResourceStatusType.running),
@@ -988,7 +988,7 @@ class _MobileResourceFilterSheet extends StatelessWidget {
                             color: Theme.of(context)
                                 .colorScheme
                                 .onSurface
-                                .withOpacity(0.75)),
+                                .withValues(alpha: 0.75)),
                       ),
                       value: state.statusFilter
                           .contains(PveResourceStatusType.stopped),
diff --git a/lib/utils/dot_indicator.dart b/lib/utils/dot_indicator.dart
index c77e7e5..5096e24 100644
--- a/lib/utils/dot_indicator.dart
+++ b/lib/utils/dot_indicator.dart
@@ -36,7 +36,7 @@ class Dot extends StatelessWidget {
             shape: BoxShape.circle,
             boxShadow: [
               BoxShadow(
-                  color: Colors.white.withOpacity(0.72),
+                  color: Colors.white.withValues(alpha: 0.72),
                   blurRadius: shadowBlurRadius!,
                   spreadRadius: shadowSpreadRadius!,
                   offset: const Offset(0.0, 0.0))
diff --git a/lib/widgets/proxmox_capacity_indicator.dart b/lib/widgets/proxmox_capacity_indicator.dart
index 8e87ab0..ad95c29 100644
--- a/lib/widgets/proxmox_capacity_indicator.dart
+++ b/lib/widgets/proxmox_capacity_indicator.dart
@@ -45,7 +45,7 @@ class ProxmoxCapacityIndicator extends StatelessWidget {
                                 : Theme.of(context)
                                     .colorScheme
                                     .onBackground
-                                    .withOpacity(0.75))),
+                                    .withValues(alpha: 0.75))),
                   ),
                   Text(usedValue,
                       style: TextStyle(
@@ -55,7 +55,7 @@ class ProxmoxCapacityIndicator extends StatelessWidget {
                                       : Theme.of(context)
                                           .colorScheme
                                           .onBackground)
-                                  .withOpacity(0.66),
+                                  .withValues(alpha: 0.66),
                           fontWeight: FontWeight.bold)),
                 ],
               ),
@@ -65,7 +65,7 @@ class ProxmoxCapacityIndicator extends StatelessWidget {
                           (selected
                                   ? Theme.of(context).colorScheme.onPrimary
                                   : Theme.of(context).colorScheme.onBackground)
-                              .withOpacity(0.66),
+                              .withValues(alpha: 0.66),
                       fontWeight: FontWeight.bold))
             ],
           ),
diff --git a/lib/widgets/proxmox_line_chart.dart b/lib/widgets/proxmox_line_chart.dart
index 2b79e03..1e0b420 100644
--- a/lib/widgets/proxmox_line_chart.dart
+++ b/lib/widgets/proxmox_line_chart.dart
@@ -87,7 +87,7 @@ class ProxmoxLineChart extends CustomPainter {
         text: TextSpan(
           style: TextStyle(
             color: textColor ?? Colors.white,
-            backgroundColor: shadeColorBottom.withOpacity(0.75),
+            backgroundColor: shadeColorBottom.withValues(alpha: 0.75),
           ),
           text: selectedLabel,
         ),
diff --git a/lib/widgets/pve_file_selector_widget.dart b/lib/widgets/pve_file_selector_widget.dart
index 87a547f..9770ff8 100644
--- a/lib/widgets/pve_file_selector_widget.dart
+++ b/lib/widgets/pve_file_selector_widget.dart
@@ -279,7 +279,7 @@ class PveStorageCard extends StatelessWidget {
                           color: (isSelected
                                   ? Theme.of(context).colorScheme.onPrimary
                                   : Theme.of(context).colorScheme.onBackground)
-                              .withOpacity(0.75),
+                              .withValues(alpha: 0.75),
                           fontWeight: FontWeight.bold,
                         ),
                         maxLines: 1,
@@ -308,7 +308,7 @@ class PveStorageCard extends StatelessWidget {
                                 color: Theme.of(context)
                                     .colorScheme
                                     .onBackground
-                                    .withOpacity(0.75),
+                                    .withValues(alpha: 0.75),
                                 fontWeight: FontWeight.bold,
                               ),
                             ),
diff --git a/lib/widgets/pve_guest_migrate_widget.dart b/lib/widgets/pve_guest_migrate_widget.dart
index 402fca0..d467dd7 100644
--- a/lib/widgets/pve_guest_migrate_widget.dart
+++ b/lib/widgets/pve_guest_migrate_widget.dart
@@ -63,7 +63,7 @@ class PveGuestMigrate extends StatelessWidget {
                           subtitle: Text(
                             migrateState.mode.name,
                             style: TextStyle(
-                                color: colorScheme.onPrimary.withOpacity(0.66)),
+                                color: colorScheme.onPrimary.withValues(alpha: 0.66)),
                           ),
                         ),
                         ListTile(
@@ -75,7 +75,7 @@ class PveGuestMigrate extends StatelessWidget {
                           subtitle: Text(
                             migrateState.nodeID,
                             style: TextStyle(
-                                color: colorScheme.onPrimary.withOpacity(0.66)),
+                                color: colorScheme.onPrimary.withValues(alpha: 0.66)),
                           ),
                         ),
                         Padding(
diff --git a/lib/widgets/pve_guest_overview_header.dart b/lib/widgets/pve_guest_overview_header.dart
index 2382f2d..1429ac1 100644
--- a/lib/widgets/pve_guest_overview_header.dart
+++ b/lib/widgets/pve_guest_overview_header.dart
@@ -37,7 +37,7 @@ class PveGuestOverviewHeader extends StatelessWidget {
   @override
   Widget build(BuildContext context) {
     final haError = ha?.state == 'error';
-    final fgColor = Theme.of(context).colorScheme.onPrimary.withOpacity(0.75);
+    final fgColor = Theme.of(context).colorScheme.onPrimary.withValues(alpha: 0.75);
     return Container(
       height: 250,
       width: width,
@@ -175,7 +175,7 @@ class _PveGuestHeaderRRDPageViewState extends State<PveGuestHeaderRRDPageView> {
     }
     var rrdData = widget.rrdData! // safety: checked for null above...
         .where((e) => e.time != null);
-    final fgColor = Theme.of(context).colorScheme.onPrimary.withOpacity(0.75);
+    final fgColor = Theme.of(context).colorScheme.onPrimary.withValues(alpha: 0.75);
     return ScrollConfiguration(
       behavior: PVEScrollBehavior(),
       child: PageView.builder(
diff --git a/lib/widgets/pve_node_overview.dart b/lib/widgets/pve_node_overview.dart
index 23f0edc..275a547 100644
--- a/lib/widgets/pve_node_overview.dart
+++ b/lib/widgets/pve_node_overview.dart
@@ -30,7 +30,7 @@ class PveNodeOverview extends StatelessWidget {
     } else if (s.unitState == 'masked' || s.unitState == 'not-found') {
       return Icon(
         Icons.play_disabled,
-        color: IconTheme.of(context).color!.withOpacity(0.75),
+        color: IconTheme.of(context).color!.withValues(alpha: 0.75),
       );
     } else {
       return Icon(Icons.stop, color: Theme.of(context).colorScheme.error);
@@ -49,7 +49,7 @@ class PveNodeOverview extends StatelessWidget {
         final status = state.status;
         final rrd = state.rrdData.where((e) => e.time != null);
         final fgColor =
-            Theme.of(context).colorScheme.onPrimary.withOpacity(0.75);
+            Theme.of(context).colorScheme.onPrimary.withValues(alpha: 0.75);
         return ColoredSafeArea(
           child: Scaffold(
             appBar: AppBar(
diff --git a/lib/widgets/pve_rrd_chart_widget.dart b/lib/widgets/pve_rrd_chart_widget.dart
index aa6406e..d61deea 100644
--- a/lib/widgets/pve_rrd_chart_widget.dart
+++ b/lib/widgets/pve_rrd_chart_widget.dart
@@ -55,7 +55,8 @@ class _PveRRDChartState extends State<PveRRDChart> {
     final timeWindow = DateTime.fromMillisecondsSinceEpoch(data.last.x as int)
         .difference(DateTime.fromMillisecondsSinceEpoch(data.first.x as int));
 
-    final fgColor = Theme.of(context).colorScheme.onPrimary.withOpacity(0.85);
+    final fgColor =
+        Theme.of(context).colorScheme.onPrimary.withValues(alpha: 0.85);
     return Column(
       crossAxisAlignment: widget.titleAlginment,
       children: <Widget>[
diff --git a/lib/widgets/pve_task_log_expansiontile_widget.dart b/lib/widgets/pve_task_log_expansiontile_widget.dart
index 6491b6b..de71187 100644
--- a/lib/widgets/pve_task_log_expansiontile_widget.dart
+++ b/lib/widgets/pve_task_log_expansiontile_widget.dart
@@ -86,7 +86,7 @@ class _PveTaskExpansionTileState extends State<PveTaskExpansionTile> {
           ? Text(DateFormat.Md().add_Hms().format(widget.task.endTime!),
               style: TextStyle(color: headerColor))
           : LinearProgressIndicator(
-              backgroundColor: headerColor.withOpacity(0.5),
+              backgroundColor: headerColor.withValues(alpha: 0.5),
               valueColor: AlwaysStoppedAnimation<Color>(headerColor),
             ),
       trailing: Icon(
-- 
2.39.5


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