Skip to content

Commit

Permalink
Add basic dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
elibon99 committed Jan 22, 2025
1 parent 9bc2bf5 commit f95ad06
Show file tree
Hide file tree
Showing 27 changed files with 403 additions and 330 deletions.
4 changes: 2 additions & 2 deletions lib/fido/views/actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class FidoActions extends ConsumerWidget {
onInvoke: (intent) async {
final credential = intent.target;
final deleted = await withContext(
(context) => showBlurDialog<bool?>(
(context) => showDialog<bool?>(
context: context,
builder: (context) => DeleteCredentialDialog(
devicePath,
Expand Down Expand Up @@ -83,7 +83,7 @@ class FidoActions extends ConsumerWidget {
onInvoke: (intent) async {
final fingerprint = intent.target;
final deleted = await ref.read(withContextProvider)(
(context) => showBlurDialog<bool?>(
(context) => showDialog<bool?>(
context: context,
builder: (context) => DeleteFingerprintDialog(
devicePath,
Expand Down
33 changes: 15 additions & 18 deletions lib/fido/views/delete_credential_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:material_symbols_icons/symbols.dart';

import '../../app/message.dart';
import '../../app/models.dart';
import '../../app/state.dart';
import '../../exception/cancellation_exception.dart';
import '../../widgets/responsive_dialog.dart';
import '../../widgets/basic_dialog.dart';
import '../models.dart';
import '../state.dart';

Expand All @@ -36,25 +37,21 @@ class DeleteCredentialDialog extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final l10n = AppLocalizations.of(context)!;
final label = credential.userName;

return ResponsiveDialog(
title: Text(l10n.s_delete_passkey),
builder: (context, _) => Padding(
padding: const EdgeInsets.symmetric(horizontal: 18.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(l10n.p_warning_delete_passkey),
Text(l10n.l_passkey(label)),
]
.map((e) => Padding(
child: e,
padding: const EdgeInsets.symmetric(vertical: 8.0),
))
.toList(),
return BasicDialog(
icon: Icon(Symbols.delete),
title: Text(l10n.q_delete_passkey),
content: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Text(
l10n.p_warning_delete_passkey,
style: Theme.of(context)
.textTheme
.bodyMedium
?.copyWith(fontWeight: FontWeight.w700),
),
),
const SizedBox(height: 8.0),
Text(l10n.p_warning_delete_passkey_desc),
]),
actions: [
TextButton(
onPressed: () async {
Expand Down
25 changes: 6 additions & 19 deletions lib/fido/views/delete_fingerprint_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:material_symbols_icons/symbols.dart';

import '../../app/message.dart';
import '../../app/models.dart';
import '../../app/state.dart';
import '../../widgets/responsive_dialog.dart';
import '../../widgets/basic_dialog.dart';
import '../models.dart';
import '../state.dart';

Expand All @@ -33,10 +34,10 @@ class DeleteFingerprintDialog extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final l10n = AppLocalizations.of(context)!;
final label = fingerprint.label;

return ResponsiveDialog(
title: Text(l10n.s_delete_fingerprint),
return BasicDialog(
icon: Icon(Symbols.delete),
title: Text(l10n.q_delete_fingerprint),
actions: [
TextButton(
onPressed: () async {
Expand All @@ -51,21 +52,7 @@ class DeleteFingerprintDialog extends ConsumerWidget {
child: Text(l10n.s_delete),
),
],
builder: (context, _) => Padding(
padding: const EdgeInsets.symmetric(horizontal: 18.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(l10n.p_warning_delete_fingerprint),
Text(l10n.l_fingerprint(label)),
]
.map((e) => Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: e,
))
.toList(),
),
),
content: Text(l10n.p_warning_delete_fingerprint),
);
}
}
38 changes: 15 additions & 23 deletions lib/fido/views/enterprise_attestation_dialog.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:material_symbols_icons/symbols.dart';

import '../../app/message.dart';
import '../../app/models.dart';
import '../../app/state.dart';
import '../../widgets/responsive_dialog.dart';
import '../../widgets/basic_dialog.dart';
import '../state.dart';

class EnableEnterpriseAttestationDialog extends ConsumerWidget {
Expand All @@ -15,8 +16,9 @@ class EnableEnterpriseAttestationDialog extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final l10n = AppLocalizations.of(context)!;
return ResponsiveDialog(
title: Text(l10n.s_enable_ep_attestation),
return BasicDialog(
icon: Icon(Symbols.local_police),
title: Text(l10n.q_enable_ep_attestation),
actions: [
TextButton(
onPressed: () async {
Expand All @@ -31,27 +33,17 @@ class EnableEnterpriseAttestationDialog extends ConsumerWidget {
child: Text(l10n.s_enable),
),
],
builder: (context, _) => Padding(
padding: const EdgeInsets.symmetric(horizontal: 18.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
l10n.p_enable_ep_attestation_desc,
style: Theme.of(context)
.textTheme
.bodyMedium
?.copyWith(fontWeight: FontWeight.w700),
),
Text(l10n.p_enable_ep_attestation_disable_with_factory_reset),
]
.map((e) => Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: e,
))
.toList(),
content: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Text(
l10n.p_enable_ep_attestation_desc,
style: Theme.of(context)
.textTheme
.bodyMedium
?.copyWith(fontWeight: FontWeight.w700),
),
),
const SizedBox(height: 8.0),
Text(l10n.p_enable_ep_attestation_disable_with_factory_reset),
]),
);
}
}
2 changes: 1 addition & 1 deletion lib/fido/views/key_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Widget _fidoBuildActions(BuildContext context, DeviceNode node, FidoState state,
onTap: canEnableEnterpriseAttestation
? (context) {
Navigator.of(context).popUntil((route) => route.isFirst);
showBlurDialog(
showDialog(
context: context,
builder: (context) =>
EnableEnterpriseAttestationDialog(node.path),
Expand Down
26 changes: 17 additions & 9 deletions lib/l10n/app_de.arb
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@
},
"s_ep_attestation": "Enterprise Attestation",
"s_ep_attestation_enabled": "Enterprise Attestation aktiviert",
"s_enable_ep_attestation": "Enterprise Attestation aktivieren",
"q_enable_ep_attestation": null,
"p_enable_ep_attestation_desc": "Dies aktiviert Enterprise Attestation, eine Funktion die es berechtigten Domains ermöglicht deinen YubiKey eindeutig zu identifizieren.",
"p_enable_ep_attestation_disable_with_factory_reset": "Einmal aktiviert, kann Enterprise Attestation nur durch einen FIDO-Reset deaktiviert werden.",
"s_pin_required": "PIN erforderlich",
Expand Down Expand Up @@ -464,6 +464,7 @@
},
"p_rename_will_change_account_displayed": "Dies ändert die Anzeige des Kontos in der Liste.",
"s_delete_account": "Konto löschen",
"q_delete_account": null,
"l_delete_account_desc": "Lösche das Konto von deinem YubiKey",
"s_account_deleted": "Konto gelöscht",
"p_warning_delete_account": "Achtung! Du bist dabei das Konto von deinem YubiKey zu löschen.",
Expand Down Expand Up @@ -514,9 +515,11 @@
"l_no_discoverable_accounts": "Keine Passkeys gespeichert",
"p_non_passkeys_note": "Die Liste beinhaltet ausschließlich Passkeys. Weitere Anmeldedaten können existieren.",
"s_delete_passkey": "Passkey löschen",
"q_delete_passkey": null,
"l_delete_passkey_desc": "Entfernen Sie den Passkey vom YubiKey",
"s_passkey_deleted": "Passkey gelöscht",
"p_warning_delete_passkey": "Diese Aktion entfernt den Passkey von deinem YubiKey.",
"p_warning_delete_passkey_desc": null,
"s_search_passkeys": "Passkeys durchsuchen",
"p_passkeys_used": "{used} von {max} Passkeys verwendet.",
"@p_passkeys_used": {
Expand Down Expand Up @@ -550,6 +553,7 @@
"p_setup_fingerprints_desc": "Fingerabdrücken müssen eingerichtet werden, bevor der Schlüssel verwendet werden kann.",
"s_add_fingerprint": "Fingerabdruck hinzufügen",
"s_delete_fingerprint": "Fingerabdruck löschen",
"q_delete_fingerprint": null,
"l_delete_fingerprint_desc": "Fingerabdruck vom YubiKey entfernen",
"s_fingerprint_deleted": "Fingerabdruck gelöscht",
"p_warning_delete_fingerprint": "Dies löscht den Fingerabdruck von deinem YubiKey.",
Expand All @@ -573,7 +577,6 @@
}
},
"p_press_fingerprint_begin": "Lege den Finger auf den Sensor deines YubiKeys um zu beginnen.",
"p_will_change_label_fp": "Dies ändert die Beschriftung des Fingerabdrucks.",
"l_name_fingerprint": "Für diesen Fingerabdruck einen Namen vergeben",

"@_fido_errors": {},
Expand Down Expand Up @@ -602,10 +605,13 @@
"s_file_imported": "Datei importiert",
"l_unsupported_key_type": "Schlüssel-Typ wird nicht unterstützt",
"l_delete_certificate": "Zertifikat löschen",
"q_delete_certificate": null,
"l_delete_certificate_desc": "Entferne das Zertifikat von deinem YubiKey",
"l_delete_key": "Schlüssel löschen",
"q_delete_key": null,
"l_delete_key_desc": "Entferne den Schlüssel von deinem YubiKey",
"l_delete_certificate_or_key": "Zertifikat/Schlüssel löschen",
"q_delete_certificate_or_key": null,
"l_delete_certificate_or_key_desc": "Entferne das Zertifikat oder den Schlüssel von deinem YubiKey",
"l_move_key": "Schlüssel verschieben",
"l_move_key_desc": "Verschiebe einen Schlüssel zwischen zwei PIV Slots",
Expand All @@ -630,20 +636,20 @@
"p_warning_delete_certificate": "Achtung! Diese Aktion löscht das Zertifikat von deinem YubiKey.",
"p_warning_delete_key": "Achtung! Diese Aktion löscht den privaten Schlüssel von deinem YubiKey.",
"p_warning_delete_certificate_and_key": "Achtung! Diese Aktion löscht das Zertifikat und den privaten Schlüssel von deinem YubiKey.",
"q_delete_certificate_confirm": "Soll das Zertifikat in PIV Slot {slot} gelöscht werden?",
"@q_delete_certificate_confirm": {
"p_delete_certificate_desc": null,
"@p_delete_certificate_desc": {
"placeholders": {
"slot": {}
}
},
"q_delete_key_confirm": "Soll der private Schlüssel in PIV Slot {slot} gelöscht werden?",
"@q_delete_key_confirm": {
"p_delete_key_desc": null,
"@p_delete_key_desc": {
"placeholders": {
"slot": {}
}
},
"q_delete_certificate_and_key_confirm": "Soll das Zertifikat und der private Schlüssel in PIV Slot {slot} gelöscht werden?",
"@q_delete_certificate_and_key_confirm": {
"p_delete_certificate_and_key_desc": null,
"@p_delete_certificate_and_key_desc": {
"placeholders": {
"slot": {}
}
Expand Down Expand Up @@ -695,7 +701,7 @@
"p_cert_options_desc": "Verwendeter Schlüssel-Algorithmus, Ausgabeformat und Ablaufdatum (nur bei Zertifikat).",
"p_cert_options_bio_desc": "Zu verwendender Schlüssel-Algorithmus, Ausgabeformat, Ablaufdatum (nur bei Zertifikaten) und ob Fingerabdrücke anstelle der PIN verwendet werden können.",
"p_key_options_bio_desc": "Erlaube die Verwendung von Fingerabdrücken anstelle der PIN.",
"s_overwrite_slot": "Slot überschreiben",
"q_overwrite_slot": null,
"p_overwrite_slot_desc": "Dies überschreibt dauerhaft evtl. vorhandenen Inhalt in Slot {slot}.",
"@p_overwrite_slot_desc": {
"placeholders": {
Expand Down Expand Up @@ -751,6 +757,7 @@

"@_otp_slot_actions": {},
"s_delete_slot": "Anmeldedaten löschen",
"q_delete_slot": null,
"l_delete_slot_desc": "Anmeldedaten in Slot löschen",
"p_warning_delete_slot_configuration": "Achtung! Diese Aktion löscht die Anmeldedaten dauerhaft aus Slot {slot_id}.",
"@p_warning_delete_slot_configuration": {
Expand All @@ -761,6 +768,7 @@
"l_slot_deleted": "Anmeldedaten gelöscht",
"s_swap": "Tauschen",
"s_swap_slots": "Slots tauschen",
"q_swap_slots": null,
"l_swap_slots_desc": "Kurze/lange Berührung tauschen",
"p_swap_slots_desc": "Dies tauscht die Konfiguration der beiden Slots.",
"l_slots_swapped": "Slot Konfigurationen getauscht",
Expand Down
Loading

0 comments on commit f95ad06

Please sign in to comment.