Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
library-app-flutter
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ilham Maulana
library-app-flutter
Commits
084dca0a
Commit
084dca0a
authored
Aug 02, 2024
by
Ilham Maulana
💻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: loan book success confirm form
parent
505c9e63
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
10 deletions
+21
-10
auth_provider.dart
lib/src/providers/auth_provider.dart
+4
-0
book_loan_form.dart
lib/src/widgets/forms/book_loan_form.dart
+17
-10
No files found.
lib/src/providers/auth_provider.dart
View file @
084dca0a
...
...
@@ -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
{
...
...
lib/src/widgets/forms/book_loan_form.dart
View file @
084dca0a
...
...
@@ -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'
),
),
),
),
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment