Commit 084dca0a authored by Ilham Maulana's avatar Ilham Maulana 💻

fix: loan book success confirm form

parent 505c9e63
......@@ -42,6 +42,10 @@ class AuthProvider with ChangeNotifier {
notifyListeners();
}
void setLoanBookSuccess(bool value) {
loanBookSuccess = value;
}
Future<void> signIn(
BuildContext context, String username, String password) async {
try {
......
......@@ -25,16 +25,23 @@ class _LoanBookForm extends State<LoanBookForm> {
Widget build(BuildContext context) {
return Consumer<AuthProvider>(builder: (context, authProvider, child) {
if (authProvider.loanBookSuccess) {
return AlertDialog(
title: const Text(
'Loan book succed!',
style: TextStyle(fontSize: 20.0),
),
content: FilledButton(
onPressed: () {
Navigator.of(context).pop();
},
child: const Text('Continue'),
final screenSize = MediaQuery.of(context).size;
return Center(
child: SizedBox(
height: screenSize.height * 0.4,
child: AlertDialog(
title: const Text(
'Loan book succed!',
style: TextStyle(fontSize: 20.0),
),
content: FilledButton(
onPressed: () {
authProvider.setLoanBookSuccess(false);
Navigator.of(context).pop();
},
child: const Text('Continue'),
),
),
),
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment