public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH proxmox-login-manager 2/3] migrate from FlatButton to TextButton
Date: Thu,  8 Sep 2022 11:55:39 +0200	[thread overview]
Message-ID: <20220908095550.2913416-3-d.csapak@proxmox.com> (raw)
In-Reply-To: <20220908095550.2913416-1-d.csapak@proxmox.com>

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





  parent reply	other threads:[~2022-09-08  9:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08  9:55 [pve-devel] [PATCH proxmox-login-manager/pve-flutter-frontend] fixes & update to flutter 3.3 Dominik Csapak
2022-09-08  9:55 ` [pve-devel] [PATCH proxmox-login-manager 1/3] login_form: keep Continue button above Android softnav Dominik Csapak
2022-09-08  9:55 ` Dominik Csapak [this message]
2022-09-08  9:55 ` [pve-devel] [PATCH proxmox-login-manager 3/3] improve colors of login screen Dominik Csapak
2022-09-08  9:55 ` [pve-devel] [PATCH pve-flutter-frontend 01/10] avoid elements hiding behind Android softnav buttons Dominik Csapak
2022-09-08  9:55 ` [pve-devel] [PATCH pve-flutter-frontend 02/10] increase compileSdkVersion to 32 Dominik Csapak
2022-09-08  9:55 ` [pve-devel] [PATCH pve-flutter-frontend 03/10] fix null handling in MainActivity.kt Dominik Csapak
2022-09-08  9:55 ` [pve-devel] [PATCH pve-flutter-frontend 04/10] move to OutlinedButton from OutlineButton Dominik Csapak
2022-09-08  9:55 ` [pve-devel] [PATCH pve-flutter-frontend 05/10] move to TextButton from FlatButton Dominik Csapak
2022-09-08  9:55 ` [pve-devel] [PATCH pve-flutter-frontend 06/10] move to ElevatedButton from RaisedButton Dominik Csapak
2022-09-08  9:55 ` [pve-devel] [PATCH pve-flutter-frontend 07/10] improve colors for indicator/toggles Dominik Csapak
2022-09-08  9:55 ` [pve-devel] [PATCH pve-flutter-frontend 08/10] fix typo Opague -> Opaque Dominik Csapak
2022-09-08  9:55 ` [pve-devel] [PATCH pve-flutter-frontend 09/10] fix guest backup widget start display Dominik Csapak
2022-09-08  9:55 ` [pve-devel] [PATCH pve-flutter-frontend 10/10] fix options view when ostype is null Dominik Csapak
2022-09-08 15:31 ` [pve-devel] applied-series: [PATCH proxmox-login-manager/pve-flutter-frontend] fixes & update to flutter 3.3 Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220908095550.2913416-3-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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