This repository has been archived on 2024-11-18. You can view files and clone it, but cannot push or open issues or pull requests.
dialer/lib/pages/settings.dart
2024-10-25 12:26:44 +01:00

61 lines
1.6 KiB
Dart

// settings.dart
import 'package:flutter/material.dart';
import 'package:dialer/pages/settingsCall.dart';
import 'package:dialer/pages/settingsAccounts.dart'; // Import the new settings page
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;
// 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',
];
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]);
},
);
},
),
);
}
}