manager-app/lib/Components/confirmation_dialog.dart

59 lines
1.6 KiB
Dart

import 'package:flutter/material.dart';
import 'package:manager_app/Components/rounded_button.dart';
import 'package:manager_app/constants.dart';
showConfirmationDialog (String question, Function onNo, Function onYes, BuildContext context) {
showDialog(
builder: (BuildContext context) => AlertDialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(20.0))
),
content: SingleChildScrollView(
child: Text(
question,
style: TextStyle(fontSize: 25),
),
),
actions: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Container(
width: 150,
height: 70,
child: RoundedButton(
text: "Non",
icon: Icons.undo,
color: kSecond,
press: () {
onNo();
Navigator.of(context).pop();
},
fontSize: 20,
),
),
Container(
width: 150,
height: 70,
child: RoundedButton(
text: "Oui",
icon: Icons.check,
color: kPrimaryColor,
textColor: kWhite,
press: () {
onYes();
Navigator.of(context).pop();
},
fontSize: 20,
),
),
],
),
],
), context: context
);
}