G-EIP-700-TLS-7-1-eip-steph.../lib/pages/settingsAccounts.dart
2024-10-25 12:26:44 +01:00

60 lines
1.6 KiB
Dart

// settingsAccounts.dart
import 'package:flutter/material.dart';
import 'package:dialer/pages/chooseSim.dart'; // We'll create this next
import 'package:dialer/pages/simParameters.dart'; // We'll create this next
class SettingsAccountsPage extends StatelessWidget {
const SettingsAccountsPage({super.key});
void _navigateToAccountOption(BuildContext context, String option) {
switch (option) {
case 'Choisir la SIM':
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const ChooseSimPage()),
);
break;
case 'Paramètre SIM':
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const SimParametersPage()),
);
break;
// Handle more options if needed
default:
break;
}
}
@override
Widget build(BuildContext context) {
final accountOptions = [
'Choisir la SIM',
'Paramètre SIM',
];
return Scaffold(
backgroundColor: Colors.black,
appBar: AppBar(
title: const Text('Page des comptes téléphoniques'),
),
body: ListView.builder(
itemCount: accountOptions.length,
itemBuilder: (context, index) {
return ListTile(
title: Text(
accountOptions[index],
style: const TextStyle(color: Colors.white),
),
trailing: const Icon(Icons.arrow_forward_ios, color: Colors.white),
onTap: () {
_navigateToAccountOption(context, accountOptions[index]);
},
);
},
),
);
}
}