]> git.proxmox.com Git - flutter/proxmox_login_manager.git/commitdiff
tree wide: various small lint auto-fixes
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 3 Apr 2024 14:08:31 +0000 (16:08 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 3 Apr 2024 14:10:23 +0000 (16:10 +0200)
fix the following lints:
- prefer_is_empty
- sort_child_properties_last
- prefer_const_literals_to_create_immutables
- prefer_const_constructors

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

index eb3105d544e3f1fb36386e3d2c35b419a69de9db..7c92ab147e6118a0478a9bd97e6f50770aa5871f 100644 (file)
@@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
 import 'package:proxmox_login_manager/proxmox_general_settings_model.dart';
 
 class ProxmoxGeneralSettingsForm extends StatefulWidget {
+  const ProxmoxGeneralSettingsForm({Key? key}) : super(key: key);
+
   @override
   _ProxmoxGeneralSettingsFormState createState() =>
       _ProxmoxGeneralSettingsFormState();
index f2a771d2054653627ef7af1be574013f9d468d67..e4d1275a01b52096ce31ca22f53c807cdf68b3b3 100644 (file)
@@ -109,17 +109,17 @@ class _ProxmoxLoginFormState extends State<ProxmoxLoginForm> {
               }
               return null;
             },
-            autofillHints: [AutofillHints.username],
+            autofillHints: const [AutofillHints.username],
           ),
           DropdownButtonFormField(
             decoration: const InputDecoration(icon: Icon(Icons.domain)),
             items: widget.accessDomains!
                 .map((e) => DropdownMenuItem(
+                      value: e,
                       child: ListTile(
                         title: Text(e!.realm),
                         subtitle: Text(e.comment ?? ''),
                       ),
-                      value: e,
                     ))
                 .toList(),
             onChanged: widget.onDomainChanged,
@@ -145,7 +145,7 @@ class _ProxmoxLoginFormState extends State<ProxmoxLoginForm> {
                   return null;
                 },
                 onFieldSubmitted: (value) => widget.onPasswordSubmitted!(),
-                autofillHints: [AutofillHints.password],
+                autofillHints: const [AutofillHints.password],
               ),
               Align(
                 alignment: Alignment.bottomRight,
@@ -475,7 +475,7 @@ class _ProxmoxLoginPageState extends State<ProxmoxLoginPage> {
           '$username@$realm', password, origin, settings.sslValidation!);
 
       if (client.credentials.tfa != null &&
-          client.credentials.tfa!.kinds().length > 0) {
+          client.credentials.tfa!.kinds().isNotEmpty) {
         ProxmoxApiClient? tfaclient =
             await Navigator.of(context).push(MaterialPageRoute(
           builder: (context) => ProxmoxTfaForm(
index 89dec246747379ef5c9483fe1c58915073604e2e..f761462aadfc6adfeefc08011439808f87c78c02 100644 (file)
@@ -88,8 +88,8 @@ class _ProxmoxTfaFormState extends State<ProxmoxTfaForm> {
                                       icon: Icon(Icons.input)),
                                   items: _tfa_kinds
                                       .map((e) => DropdownMenuItem(
-                                            child: ListTile(title: Text(e)),
                                             value: e,
+                                            child: ListTile(title: Text(e)),
                                           ))
                                       .toList(),
                                   onChanged: (String? value) {