69 lines
1.9 KiB
Dart
69 lines
1.9 KiB
Dart
|
// 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';
|
||
|
|
||
|
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 of telephone accounts':
|
||
|
Navigator.push(
|
||
|
context,
|
||
|
MaterialPageRoute(builder: (context) => const SettingsAccountsPage()),
|
||
|
);
|
||
|
break;
|
||
|
case 'Gestion de clés':
|
||
|
Navigator.push(
|
||
|
context,
|
||
|
MaterialPageRoute(builder: (context) => const KeyManagementPage()),
|
||
|
);
|
||
|
break;
|
||
|
// Add more cases for other settings pages
|
||
|
default:
|
||
|
// Handle default or unknown settings
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
final settingsOptions = [
|
||
|
'Calling settings',
|
||
|
'Page of telephone accounts',
|
||
|
'Key management',
|
||
|
];
|
||
|
|
||
|
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]);
|
||
|
},
|
||
|
);
|
||
|
},
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|