]> git.proxmox.com Git - flutter/proxmox_login_manager.git/commitdiff
TFA: fix awaiting TOTP verification page
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 10 Jun 2021 09:54:15 +0000 (11:54 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 10 Jun 2021 09:54:18 +0000 (11:54 +0200)
The cast to the FutureOr<> type confuses dart/flutter nowadays:

flutter: type 'Future<dynamic>' is not a subtype of type 'FutureOr<ProxmoxApiClient>' in type cast
flutter: #0      _ProxmoxLoginPageState._onLoginButtonPressed (package:proxmox_login_manager/proxmox_login_form.dart:406:12)
<asynchronous suspension>

just drop it.

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

index 512d7412b7aca471f0169f6bd950bb6dd0db2335..59a9f613d23ae087866a2d18f51a787cc62dbc12 100644 (file)
@@ -399,11 +399,11 @@ class _ProxmoxLoginPageState extends State<ProxmoxLoginPage> {
           '$username@$realm', password, origin, settings.sslValidation!);
 
       if (client.credentials.tfa) {
-        client = await (Navigator.of(context).push(MaterialPageRoute(
+        client = await Navigator.of(context).push(MaterialPageRoute(
           builder: (context) => ProxmoxTfaForm(
             apiClient: client,
           ),
-        )) as FutureOr<ProxmoxApiClient>);
+        ));
       }
 
       final status = await client.getClusterStatus();