G-EIP-700-TLS-7-1-eip-steph.../dialer/lib/features/settings/settings.dart

85 lines
2.4 KiB
Dart
Raw Permalink Normal View History

2024-11-06 20:00:35 +00:00
// settings.dart
import 'package:flutter/material.dart';
import 'package:dialer/features/settings/call/settingsCall.dart';
import 'package:dialer/features/settings/sim/settings_accounts.dart';
import 'package:dialer/features/settings/key/manage_keys_page.dart';
2024-11-15 16:58:22 +00:00
import 'package:dialer/features/settings/sorting/sorting.dart';
import 'package:dialer/features/settings/voicemail/voicemail.dart';
2024-11-06 20:00:35 +00:00
class SettingsPage extends StatelessWidget {
const SettingsPage({super.key});
void _navigateToSettings(BuildContext context, String setting) {
switch (setting) {
case 'Calling settings':
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const SettingsCallPage()),
);
break;
case 'Page des comptes téléphoniques':
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const SettingsAccountsPage()),
);
break;
case 'Gestion de clés':
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const GestionDeClesPage()),
);
break;
2024-11-15 16:58:22 +00:00
case 'Sorting settings':
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const SortingSettingsPage()),
);
break;
case 'Messagerie vocale':
Navigator.push(
context,
MaterialPageRoute(builder: (context) => Voicemail()),
);
break;
2024-11-06 20:00:35 +00:00
// Add more cases for other settings pages
default:
// Handle default or unknown settings
break;
}
}
@override
Widget build(BuildContext context) {
final settingsOptions = [
'Calling settings',
'Page des comptes téléphoniques',
'Gestion de clés', // Add the new option here
2024-11-15 16:58:22 +00:00
'Sorting settings',
'Messagerie vocale',
2024-11-06 20:00:35 +00:00
];
return Scaffold(
backgroundColor: Colors.black,
appBar: AppBar(
title: const Text('settings'),
),
body: ListView.builder(
itemCount: settingsOptions.length,
itemBuilder: (context, index) {
return ListTile(
title: Text(
settingsOptions[index],
style: const TextStyle(color: Colors.white),
),
trailing: const Icon(Icons.arrow_forward_ios, color: Colors.white),
onTap: () {
_navigateToSettings(context, settingsOptions[index]);
},
);
},
),
);
}
}