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

77 lines
2.2 KiB
Dart
Raw 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-12-15 18:08:34 +00:00
import 'package:dialer/features/settings/blocked/settings_blocked.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;
2024-11-28 20:57:58 +00:00
case 'Page of telephone accounts':
2024-11-06 20:00:35 +00:00
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const SettingsAccountsPage()),
);
break;
case 'Gestion de clés':
Navigator.push(
context,
2024-11-28 20:57:58 +00:00
MaterialPageRoute(builder: (context) => const KeyManagementPage()),
2024-11-06 20:00:35 +00:00
);
break;
2024-12-15 18:08:34 +00:00
case 'Blocked numbers':
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const BlockedNumbersPage()),
);
break;
// Add more cases for other settings pages
2024-11-06 20:00:35 +00:00
default:
2024-12-15 18:08:34 +00:00
// Handle default or unknown settings
2024-11-06 20:00:35 +00:00
break;
}
}
@override
Widget build(BuildContext context) {
final settingsOptions = [
'Calling settings',
2024-11-28 20:57:58 +00:00
'Page of telephone accounts',
'Key management',
2024-12-15 18:08:34 +00:00
'Blocked numbers'
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]);
},
);
},
),
);
}
}