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 { ...@@ -42,6 +42,10 @@ class AuthProvider with ChangeNotifier {
notifyListeners(); notifyListeners();
} }
void setLoanBookSuccess(bool value) {
loanBookSuccess = value;
}
Future<void> signIn( Future<void> signIn(
BuildContext context, String username, String password) async { BuildContext context, String username, String password) async {
try { try {
......
...@@ -25,16 +25,23 @@ class _LoanBookForm extends State<LoanBookForm> { ...@@ -25,16 +25,23 @@ class _LoanBookForm extends State<LoanBookForm> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Consumer<AuthProvider>(builder: (context, authProvider, child) { return Consumer<AuthProvider>(builder: (context, authProvider, child) {
if (authProvider.loanBookSuccess) { if (authProvider.loanBookSuccess) {
return AlertDialog( final screenSize = MediaQuery.of(context).size;
title: const Text( return Center(
'Loan book succed!', child: SizedBox(
style: TextStyle(fontSize: 20.0), height: screenSize.height * 0.4,
), child: AlertDialog(
content: FilledButton( title: const Text(
onPressed: () { 'Loan book succed!',
Navigator.of(context).pop(); style: TextStyle(fontSize: 20.0),
}, ),
child: const Text('Continue'), 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