From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <d.csapak@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 8F7019159C
 for <pve-devel@lists.proxmox.com>; Thu,  8 Sep 2022 11:56:25 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id A3A211ADA6
 for <pve-devel@lists.proxmox.com>; Thu,  8 Sep 2022 11:55:54 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [94.136.29.106])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS
 for <pve-devel@lists.proxmox.com>; Thu,  8 Sep 2022 11:55:51 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 8F1D94457B
 for <pve-devel@lists.proxmox.com>; Thu,  8 Sep 2022 11:55:51 +0200 (CEST)
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Date: Thu,  8 Sep 2022 11:55:39 +0200
Message-Id: <20220908095550.2913416-3-d.csapak@proxmox.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20220908095550.2913416-1-d.csapak@proxmox.com>
References: <20220908095550.2913416-1-d.csapak@proxmox.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.092 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
 T_SCC_BODY_TEXT_LINE    -0.01 -
Subject: [pve-devel] [PATCH proxmox-login-manager 2/3] migrate from
 FlatButton to TextButton
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>
X-List-Received-Date: Thu, 08 Sep 2022 09:56:25 -0000

since flutter 3 removed FlatButton. For this we have to do the colors a
little different, so i moved the color/disabledColor into the
textButtonTheme, which does not modify anything else here.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 lib/proxmox_login_form.dart | 33 +++++++++++++++++++--------------
 lib/proxmox_tfa_form.dart   | 11 +++++++----
 2 files changed, 26 insertions(+), 18 deletions(-)

diff --git a/lib/proxmox_login_form.dart b/lib/proxmox_login_form.dart
index bb00b5c..5e9198f 100644
--- a/lib/proxmox_login_form.dart
+++ b/lib/proxmox_login_form.dart
@@ -212,9 +212,18 @@ class _ProxmoxLoginPageState extends State<ProxmoxLoginPage> {
     return Theme(
       //data: ThemeData.dark().copyWith(accentColor: Color(0xFFE47225)),
       data: ThemeData.dark().copyWith(
-          colorScheme: ColorScheme.dark().copyWith(
-              secondary: ProxmoxColors.orange,
-              onSecondary: ProxmoxColors.supportGrey)),
+        textButtonTheme: TextButtonThemeData(
+          style: TextButton.styleFrom(
+            foregroundColor: Colors.white,
+            backgroundColor: ProxmoxColors.orange,
+            disabledBackgroundColor: Colors.grey,
+          ),
+        ),
+        colorScheme: ColorScheme.dark().copyWith(
+            secondary: ProxmoxColors.orange,
+            onSecondary: ProxmoxColors.supportGrey
+        ),
+      ),
       child: Scaffold(
         backgroundColor: ProxmoxColors.supportBlue,
         extendBodyBehindAppBar: true,
@@ -324,7 +333,7 @@ class _ProxmoxLoginPageState extends State<ProxmoxLoginPage> {
                                       child: Container(
                                         width:
                                             MediaQuery.of(context).size.width,
-                                        child: FlatButton(
+                                        child: TextButton(
                                           onPressed: _submittButtonEnabled
                                               ? () {
                                                   final isValid = _formKey
@@ -339,8 +348,6 @@ class _ProxmoxLoginPageState extends State<ProxmoxLoginPage> {
                                                   }
                                                 }
                                               : null,
-                                          color: ProxmoxColors.orange,
-                                          disabledColor: Colors.grey,
                                           child: Text('Continue'),
                                         ),
                                       ),
@@ -353,7 +360,7 @@ class _ProxmoxLoginPageState extends State<ProxmoxLoginPage> {
                                       child: Container(
                                         width:
                                             MediaQuery.of(context).size.width,
-                                        child: FlatButton(
+                                        child: TextButton(
                                           onPressed: _submittButtonEnabled
                                               ? () {
                                                   final isValid = _formKey
@@ -371,9 +378,7 @@ class _ProxmoxLoginPageState extends State<ProxmoxLoginPage> {
                                                   }
                                                 }
                                               : null,
-                                          color: ProxmoxColors.orange,
                                           child: Text('Continue'),
-                                          disabledColor: Colors.grey,
                                         ),
                                       ),
                                     ),
@@ -459,7 +464,7 @@ class _ProxmoxLoginPageState extends State<ProxmoxLoginPage> {
             content: Text(
                 'Proxmox VE version not supported, please update your instance to use this app.'),
             actions: [
-              FlatButton(
+              TextButton(
                 onPressed: () => Navigator.of(context).pop(),
                 child: Text('Close'),
               ),
@@ -532,7 +537,7 @@ class _ProxmoxLoginPageState extends State<ProxmoxLoginPage> {
             title: Text('Connection error'),
             content: Text('Could not establish connection.'),
             actions: [
-              FlatButton(
+              TextButton(
                 onPressed: () => Navigator.of(context).pop(),
                 child: Text('Close'),
               ),
@@ -616,7 +621,7 @@ class ProxmoxApiErrorDialog extends StatelessWidget {
         child: Text(exception.message),
       ),
       actions: [
-        FlatButton(
+        TextButton(
           onPressed: () => Navigator.of(context).pop(),
           child: Text('Close'),
         ),
@@ -648,11 +653,11 @@ class ProxmoxCertificateErrorDialog extends StatelessWidget {
         ),
       ),
       actions: [
-        FlatButton(
+        TextButton(
           onPressed: () => Navigator.of(context).pop(),
           child: Text('Close'),
         ),
-        FlatButton(
+        TextButton(
           onPressed: () => Navigator.of(context).pushReplacement(
               MaterialPageRoute(
                   builder: (context) => ProxmoxGeneralSettingsForm())),
diff --git a/lib/proxmox_tfa_form.dart b/lib/proxmox_tfa_form.dart
index 3743455..945c75c 100644
--- a/lib/proxmox_tfa_form.dart
+++ b/lib/proxmox_tfa_form.dart
@@ -81,11 +81,14 @@ class _ProxmoxTfaFormState extends State<ProxmoxTfaForm> {
                           alignment: Alignment.bottomCenter,
                           child: Container(
                             width: MediaQuery.of(context).size.width,
-                            child: FlatButton(
+                            child: TextButton(
+                              style: TextButton.styleFrom(
+                                foregroundColor: Colors.white,
+                                backgroundColor: Color(0xFFE47225),
+                                disabledBackgroundColor: Colors.grey,
+                              ),
                               onPressed: () => _submitTfaCode(),
-                              color: Color(0xFFE47225),
                               child: Text('Continue'),
-                              disabledColor: Colors.grey,
                             ),
                           ),
                         ),
@@ -129,7 +132,7 @@ class _ProxmoxTfaFormState extends State<ProxmoxTfaForm> {
           title: Text('Connection error'),
           content: Text('Could not establish connection.'),
           actions: [
-            FlatButton(
+            TextButton(
               onPressed: () => Navigator.of(context).pop(),
               child: Text('Close'),
             ),
-- 
2.30.2