60 lines
1.5 KiB
Dart
60 lines
1.5 KiB
Dart
// settingsAccounts.dart
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:dialer/pages/chooseSim.dart';
|
|
import 'package:dialer/pages/simParameters.dart';
|
|
|
|
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]);
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
}
|