Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
modal_bottom_sheet
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jaime Blasco
2020-04-07 13:27:45 +0200
Browse Files
Options
Browse Files
Download
Plain Diff
Committed by
GitHub
2020-04-07 13:27:45 +0200
Commit
f46c5429cab8a8aff36cac162c480c3ff4fc85c1
f46c5429
2 parents
9a3c66da
83c2eac8
Merge pull request #1 from jamesblasco/willPop
fix WillPop issue
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletions
lib/src/bottom_sheet.dart
lib/src/bottom_sheet.dart
View file @
f46c542
...
...
@@ -149,11 +149,17 @@ class _ModalBottomSheetState extends State<ModalBottomSheet>
}
void
_cancelClose
()
{
widget
.
animationController
.
forward
();
widget
.
animationController
.
forward
().
then
((
value
)
{
// When using WillPop, animation doesn't end at 1.
// Check more in detail the problem
if
(!
widget
.
animationController
.
isCompleted
)
widget
.
animationController
.
value
=
1
;
});
_bounceDragController
.
reverse
();
}
bool
_isCheckingShouldClose
=
false
;
FutureOr
<
bool
>
shouldClose
()
async
{
if
(
_isCheckingShouldClose
)
return
false
;
if
(
widget
.
shouldClose
==
null
)
return
null
;
...
...
@@ -178,6 +184,8 @@ class _ModalBottomSheetState extends State<ModalBottomSheet>
_close
();
print
(
'close'
);
return
;
}
else
{
_cancelClose
();
}
}
...
...
@@ -218,6 +226,8 @@ class _ModalBottomSheetState extends State<ModalBottomSheet>
}
else
{
_cancelClose
();
}
}
else
{
_cancelClose
();
}
}
...
...
Please
register
or
login
to post a comment