]> git.proxmox.com Git - flutter/proxmox_login_manager.git/commitdiff
tree-wide: use super-initializer parameters where possible
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 10 Apr 2024 06:14:45 +0000 (08:14 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 10 Apr 2024 06:15:08 +0000 (08:15 +0200)
> "Forwarding constructor"s, that do nothing except forward
> parameters to their superclass constructors should take advantage
> of super-initializer parameters rather than repeating the names of
> parameters when passing them to the superclass constructors. This
> makes the code more concise and easier to read and maintain.
-- https://dart.dev/tools/linter-rules/use_super_parameters

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

index 2275cd8db7bbb7bd1b037b46d2ff2390f60fad24..cb0afeff491e29520707215fe4ada66b4508a89a 100644 (file)
@@ -2,7 +2,7 @@ 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);
+  const ProxmoxGeneralSettingsForm({super.key});
 
   @override
   State<ProxmoxGeneralSettingsForm> createState() =>
index 25a985f37848776395e4a469373c89a13ecf8fd5..e31d0c0dddd98838544c29c0137af97281a811d5 100644 (file)
@@ -44,7 +44,7 @@ class ProxmoxLoginForm extends StatefulWidget {
   final bool? passwordSaved;
 
   const ProxmoxLoginForm({
-    Key? key,
+    super.key,
     required this.originController,
     required this.usernameController,
     required this.passwordController,
@@ -57,7 +57,7 @@ class ProxmoxLoginForm extends StatefulWidget {
     this.onSavePasswordChanged,
     this.canSavePassword,
     this.passwordSaved,
-  }) : super(key: key);
+  });
 
   @override
   State<ProxmoxLoginForm> createState() => _ProxmoxLoginFormState();
@@ -193,12 +193,12 @@ class ProxmoxLoginPage extends StatefulWidget {
   final String? password;
 
   const ProxmoxLoginPage({
-    Key? key,
+    super.key,
     this.userModel,
     this.isCreate,
     this.ticket = '',
     this.password,
-  }) : super(key: key);
+  });
   @override
   State<ProxmoxLoginPage> createState() => _ProxmoxLoginPageState();
 }
@@ -693,9 +693,9 @@ class _ProxmoxLoginPageState extends State<ProxmoxLoginPage> {
 
 class ProxmoxProgressOverlay extends StatelessWidget {
   const ProxmoxProgressOverlay({
-    Key? key,
+    super.key,
     required this.message,
-  }) : super(key: key);
+  });
 
   final String message;
 
@@ -728,9 +728,9 @@ class ConnectionErrorDialog extends StatelessWidget {
   final Object exception;
 
   const ConnectionErrorDialog({
-    Key? key,
+    super.key,
     required this.exception,
-  }) : super(key: key);
+  });
 
   @override
   Widget build(BuildContext context) {
@@ -751,9 +751,9 @@ class ProxmoxApiErrorDialog extends StatelessWidget {
   final proxclient.ProxmoxApiException exception;
 
   const ProxmoxApiErrorDialog({
-    Key? key,
+    super.key,
     required this.exception,
-  }) : super(key: key);
+  });
 
   @override
   Widget build(BuildContext context) {
@@ -774,8 +774,8 @@ class ProxmoxApiErrorDialog extends StatelessWidget {
 
 class ProxmoxCertificateErrorDialog extends StatelessWidget {
   const ProxmoxCertificateErrorDialog({
-    Key? key,
-  }) : super(key: key);
+    super.key,
+  });
 
   @override
   Widget build(BuildContext context) {
index 6c781f785798f351de2d6c025c412cc37bc04feb..68839039b9c45c21aa2dafe1080c50b07fcf9c86 100644 (file)
@@ -136,7 +136,7 @@ class ProxmoxProductType extends EnumClass {
   static const ProxmoxProductType pmg = _$pmg;
   static const ProxmoxProductType pbs = _$pbs;
 
-  const ProxmoxProductType._(String name) : super(name);
+  const ProxmoxProductType._(super.name);
 
   static BuiltSet<ProxmoxProductType> get values => _$ProxmoxProductTypeValues;
   static ProxmoxProductType valueOf(String name) =>
index 9d8cdfd5d881bd9e304ab286bad6708f30cb77ca..f063699f7aabcb8765e8a61ccb350d8eab89d1a9 100644 (file)
@@ -13,7 +13,7 @@ typedef OnLoginCallback = Function(proxclient.ProxmoxApiClient client);
 class ProxmoxLoginSelector extends StatefulWidget {
   final OnLoginCallback? onLogin;
 
-  const ProxmoxLoginSelector({Key? key, this.onLogin}) : super(key: key);
+  const ProxmoxLoginSelector({super.key, this.onLogin});
 
   @override
   State<ProxmoxLoginSelector> createState() => _ProxmoxLoginSelectorState();
index 34ee7e2d9710eed9150974d50117edd5bc190ac0..ba18c547ded73e4c8c0398b00252125335dd4a51 100644 (file)
@@ -5,7 +5,7 @@ import 'package:proxmox_login_manager/proxmox_login_form.dart';
 class ProxmoxTfaForm extends StatefulWidget {
   final ProxmoxApiClient? apiClient;
 
-  const ProxmoxTfaForm({Key? key, this.apiClient}) : super(key: key);
+  const ProxmoxTfaForm({super.key, this.apiClient});
 
   @override
   State<ProxmoxTfaForm> createState() => _ProxmoxTfaFormState();