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
Max Onishi
2021-05-07 19:11:20 +1000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a801dffaa4ef2ad76f2e963104fc169cdd36fc14
a801dffa
1 parent
ab1dc56e
fix modal dismiss issue
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
lib/src/bottom_sheet.dart
lib/src/bottom_sheet.dart
View file @
a801dff
...
...
@@ -265,14 +265,18 @@ class _ModalBottomSheetState extends State<ModalBottomSheet>
assert
(
notification
.
context
!=
null
);
//Check if scrollController is used
if
(!
_scrollController
.
hasClients
)
return
;
//Check if there is more than 1 attached ScrollController e.g. swiping page in PageView
// ignore: invalid_use_of_protected_member
if
(
_scrollController
.
positions
.
length
>
1
)
return
;
if
(
_scrollController
!=
Scrollable
.
of
(
notification
.
context
!)!.
widget
.
controller
)
return
;
final
scrollPosition
=
_scrollController
.
position
;
ScrollPosition
scrollPosition
;
// ignore: invalid_use_of_protected_member
if
(
_scrollController
.
positions
.
length
>
1
)
{
// ignore: invalid_use_of_protected_member
scrollPosition
=
_scrollController
.
positions
.
firstWhere
((
p
)
=>
p
.
isScrollingNotifier
.
value
,
// ignore: invalid_use_of_protected_member
orElse:
()
=>
_scrollController
.
positions
.
first
);
}
else
{
scrollPosition
=
_scrollController
.
position
;
}
if
(
scrollPosition
.
axis
==
Axis
.
horizontal
)
return
;
...
...
Please
register
or
login
to post a comment