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,17 +25,24 @@ class _LoanBookForm extends State<LoanBookForm> { ...@@ -25,17 +25,24 @@ 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;
return Center(
child: SizedBox(
height: screenSize.height * 0.4,
child: AlertDialog(
title: const Text( title: const Text(
'Loan book succed!', 'Loan book succed!',
style: TextStyle(fontSize: 20.0), style: TextStyle(fontSize: 20.0),
), ),
content: FilledButton( content: FilledButton(
onPressed: () { onPressed: () {
authProvider.setLoanBookSuccess(false);
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
child: const Text('Continue'), child: const Text('Continue'),
), ),
),
),
); );
} }
return Container( return Container(
......
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