mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-22 16:32:01 +03:00
open dialog from OATH menu
This commit is contained in:
parent
bfd0f91c14
commit
54f816403b
@ -71,7 +71,7 @@ class IconPackDialog extends ConsumerWidget {
|
||||
} else {
|
||||
showMessage(context, 'Error removing icon pack');
|
||||
}
|
||||
Navigator.pop(context);
|
||||
// don't close the dialog Navigator.pop(context);
|
||||
},
|
||||
);
|
||||
},
|
||||
|
@ -22,6 +22,8 @@ const setOrManagePasswordAction = Key('$_prefix.set_or_manage_oath_password');
|
||||
const addAccountAction = Key('$_prefix.add_account');
|
||||
const resetAction = Key('$_prefix.reset');
|
||||
|
||||
const customIconsAction = Key('$_prefix.custom_icons');
|
||||
|
||||
const noAccountsView = Key('$_prefix.no_accounts');
|
||||
|
||||
// This is global so we can access it from the global Ctrl+F shortcut.
|
||||
|
@ -17,9 +17,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:vector_graphics/vector_graphics.dart';
|
||||
import 'package:yubico_authenticator/app/message.dart';
|
||||
import 'package:yubico_authenticator/oath/icon_provider/icon_file_loader.dart';
|
||||
import 'package:yubico_authenticator/oath/icon_provider/icon_pack_dialog.dart';
|
||||
import 'package:yubico_authenticator/oath/icon_provider/icon_pack_manager.dart';
|
||||
import 'package:yubico_authenticator/widgets/delayed_visibility.dart';
|
||||
|
||||
@ -36,7 +34,7 @@ class AccountIcon extends ConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final issuerImageFile = ref.watch(iconPackManager).getFileForIssuer(issuer);
|
||||
final issuerWidget = issuerImageFile != null
|
||||
return issuerImageFile != null
|
||||
? VectorGraphic(
|
||||
width: 40,
|
||||
height: 40,
|
||||
@ -55,16 +53,5 @@ class AccountIcon extends ConsumerWidget {
|
||||
);
|
||||
})
|
||||
: defaultWidget;
|
||||
return IconButton(
|
||||
onPressed: () async {
|
||||
await showBlurDialog(
|
||||
context: context,
|
||||
builder: (context) => const IconPackDialog(),
|
||||
);
|
||||
},
|
||||
icon: issuerWidget,
|
||||
tooltip: 'Manage icons',
|
||||
padding: const EdgeInsets.all(1.0),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ import 'dart:io';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:yubico_authenticator/oath/icon_provider/icon_pack_dialog.dart';
|
||||
|
||||
import '../../app/message.dart';
|
||||
import '../../app/models.dart';
|
||||
@ -91,6 +92,20 @@ Widget oathBuildActions(
|
||||
),
|
||||
ListTitle(AppLocalizations.of(context)!.general_manage,
|
||||
textStyle: Theme.of(context).textTheme.bodyLarge),
|
||||
ListTile(
|
||||
key: keys.customIconsAction,
|
||||
title: const Text('Custom icons'),
|
||||
subtitle: const Text('Set icons for accounts'),
|
||||
leading: const CircleAvatar(
|
||||
child: Icon(Icons.image_outlined),
|
||||
),
|
||||
onTap: () async {
|
||||
Navigator.of(context).pop();
|
||||
await showBlurDialog(
|
||||
context: context,
|
||||
builder: (context) => const IconPackDialog(),
|
||||
);
|
||||
}),
|
||||
ListTile(
|
||||
key: keys.setOrManagePasswordAction,
|
||||
title: Text(oathState.hasKey
|
||||
|
Loading…
Reference in New Issue
Block a user