63 lines
2.2 KiB
Dart
63 lines
2.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:seshat/ui/bal_page/view_model/bal_view_model.dart';
|
|
import 'package:seshat/ui/core/ui/navigation_bar.dart';
|
|
|
|
class BalOngoingScreen extends StatelessWidget {
|
|
const BalOngoingScreen({super.key, required this.viewModel});
|
|
|
|
final BalViewModel viewModel;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
bottomNavigationBar: AppNavigationBar(startIndex: 0),
|
|
appBar: AppBar(title: Text(viewModel.selectedBal!.name)),
|
|
body: Padding(
|
|
padding: const EdgeInsets.all(10.0),
|
|
child: Column(
|
|
children: [
|
|
Center(
|
|
child: ElevatedButton(
|
|
onPressed: () {
|
|
showDialog(
|
|
context: context,
|
|
builder: (context) {
|
|
return AlertDialog(
|
|
title: Text(
|
|
"Êtes-vous sûr·e de vouloir arrêter cette BAL ?",
|
|
),
|
|
content: Text(
|
|
"Cette action est irréversible. Vous pourrez ensuite consulter des statistiques sur la BAL, mais ne pourrez plus ajouter ou vendre de livre qui en fasse partie.",
|
|
),
|
|
actions: [
|
|
TextButton(
|
|
onPressed: () {
|
|
Navigator.of(context).pop();
|
|
},
|
|
child: Text("Annuler"),
|
|
),
|
|
TextButton(
|
|
onPressed: () async {
|
|
await viewModel.stopBal(
|
|
viewModel.selectedBal!.id,
|
|
);
|
|
if (context.mounted) {
|
|
Navigator.of(context).pop();
|
|
}
|
|
},
|
|
child: Text("Valider"),
|
|
),
|
|
],
|
|
);
|
|
},
|
|
);
|
|
},
|
|
child: Text("Arrêter la BAL"),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|