84 lines
2.8 KiB
Dart
84 lines
2.8 KiB
Dart
|
// manage_keysPage.dart
|
||
|
|
||
|
import 'package:flutter/material.dart';
|
||
|
import 'package:dialer/features/Settings/key/show_publicKeyText.dart';
|
||
|
import 'package:dialer/features/Settings/key/show_publicKeyQR.dart';
|
||
|
import 'package:dialer/features/Settings/key/generate_newKeyPair.dart';
|
||
|
import 'package:dialer/features/Settings/key/export_privateKey.dart';
|
||
|
import 'package:dialer/features/Settings/key/delete_keyPair.dart';
|
||
|
|
||
|
class GestionDeClesPage extends StatelessWidget {
|
||
|
const GestionDeClesPage({super.key});
|
||
|
|
||
|
void _navigateToOption(BuildContext context, String option) {
|
||
|
switch (option) {
|
||
|
case 'Affichage de la clé publique en texte':
|
||
|
Navigator.push(
|
||
|
context,
|
||
|
MaterialPageRoute(builder: (context) => const AffichageClePubliqueTextePage()),
|
||
|
);
|
||
|
break;
|
||
|
case 'Affichage de la clé publique en QR code':
|
||
|
Navigator.push(
|
||
|
context,
|
||
|
MaterialPageRoute(builder: (context) => const AffichageClePubliqueQRCodePage()),
|
||
|
);
|
||
|
break;
|
||
|
case 'Génération d\'une nouvelle paire de clés':
|
||
|
Navigator.push(
|
||
|
context,
|
||
|
MaterialPageRoute(builder: (context) => const GenerationNouvellePaireClesPage()),
|
||
|
);
|
||
|
break;
|
||
|
case 'Exportation de la clé privée en fichier chiffré par mot de passe (AES 256)':
|
||
|
Navigator.push(
|
||
|
context,
|
||
|
MaterialPageRoute(builder: (context) => const ExportationClePriveePage()),
|
||
|
);
|
||
|
break;
|
||
|
case 'Suppression d\'une paire de clés, POPUP d\'avertissement':
|
||
|
Navigator.push(
|
||
|
context,
|
||
|
MaterialPageRoute(builder: (context) => const SuppressionPaireClesPage()),
|
||
|
);
|
||
|
break;
|
||
|
default:
|
||
|
// Handle default or unknown options
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
final keyManagementOptions = [
|
||
|
'Affichage de la clé publique en texte',
|
||
|
'Affichage de la clé publique en QR code',
|
||
|
'Génération d\'une nouvelle paire de clés',
|
||
|
'Exportation de la clé privée en fichier chiffré par mot de passe (AES 256)',
|
||
|
'Suppression d\'une paire de clés, POPUP d\'avertissement',
|
||
|
];
|
||
|
|
||
|
return Scaffold(
|
||
|
backgroundColor: Colors.black,
|
||
|
appBar: AppBar(
|
||
|
title: const Text('Gestion de clés'),
|
||
|
),
|
||
|
body: ListView.builder(
|
||
|
itemCount: keyManagementOptions.length,
|
||
|
itemBuilder: (context, index) {
|
||
|
return ListTile(
|
||
|
title: Text(
|
||
|
keyManagementOptions[index],
|
||
|
style: const TextStyle(color: Colors.white),
|
||
|
),
|
||
|
trailing: const Icon(Icons.arrow_forward_ios, color: Colors.white),
|
||
|
onTap: () {
|
||
|
_navigateToOption(context, keyManagementOptions[index]);
|
||
|
},
|
||
|
);
|
||
|
},
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|