mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-12-23 18:22:39 +03:00
improved Key variable structure
This commit is contained in:
parent
09f2199a28
commit
ae8af99a39
@ -3,7 +3,6 @@ import 'dart:io';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:yubico_authenticator/management/views/keys.dart';
|
||||
|
||||
import '../../about_page.dart';
|
||||
import '../../android/views/android_settings_page.dart';
|
||||
@ -100,10 +99,7 @@ class MainPageDrawer extends ConsumerWidget {
|
||||
if (shouldPop) Navigator.of(context).pop();
|
||||
showBlurDialog(
|
||||
context: context,
|
||||
builder: (context) => ManagementScreen(
|
||||
data,
|
||||
key: screenKey,
|
||||
),
|
||||
builder: (context) => ManagementScreen(data),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
@ -11,7 +11,7 @@ import '../../widgets/custom_icons.dart';
|
||||
import '../../widgets/responsive_dialog.dart';
|
||||
import '../models.dart';
|
||||
import '../state.dart';
|
||||
import 'keys.dart';
|
||||
import 'keys.dart' as management_keys;
|
||||
|
||||
final _mapEquals = const DeepCollectionEquality().equals;
|
||||
|
||||
@ -34,8 +34,8 @@ class _CapabilityForm extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final keyPrefix = (type == _CapabilityType.usb)
|
||||
? usbCapabilityKeyPrefix
|
||||
: nfcCapabilityKeyPrefix;
|
||||
? management_keys.usbCapabilityKeyPrefix
|
||||
: management_keys.nfcCapabilityKeyPrefix;
|
||||
return Wrap(
|
||||
spacing: 8,
|
||||
runSpacing: 16,
|
||||
@ -141,7 +141,9 @@ class _CapabilitiesForm extends StatelessWidget {
|
||||
|
||||
class ManagementScreen extends ConsumerStatefulWidget {
|
||||
final YubiKeyData deviceData;
|
||||
const ManagementScreen(this.deviceData, {super.key});
|
||||
|
||||
const ManagementScreen(this.deviceData)
|
||||
: super(key: management_keys.screenKey);
|
||||
|
||||
@override
|
||||
ConsumerState<ConsumerStatefulWidget> createState() =>
|
||||
@ -298,7 +300,7 @@ class _ManagementScreenState extends ConsumerState<ManagementScreen> {
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: canSave ? _submitForm : null,
|
||||
key: saveButtonKey,
|
||||
key: management_keys.saveButtonKey,
|
||||
child: Text(AppLocalizations.of(context)!.mgmt_save),
|
||||
),
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user