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-07-05 13:55:25 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
da642212a691e6b3b489f7349392d97d5a15c710
da642212
1 parent
78759e8a
Improve redeability
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
lib/src/bottom_sheet.dart
lib/src/bottom_sheet.dart
View file @
da64221
...
...
@@ -69,6 +69,8 @@ class ModalBottomSheet extends StatefulWidget {
/// the top bound.
final
bool
bounce
;
// Force the widget to fill the maximum size of the viewport
// or if false it will fit to the content of the widget
final
bool
expanded
;
final
WidgetWithChildBuilder
containerBuilder
;
...
...
@@ -242,22 +244,26 @@ class _ModalBottomSheetState extends State<ModalBottomSheet>
DateTime
_startTime
;
void
_handleScrollUpdate
(
ScrollNotification
notification
)
{
double
diff
=
_scrollController
.
position
.
axisDirection
==
AxisDirection
.
down
?
_scrollController
.
position
.
pixels
:
_scrollController
.
position
.
maxScrollExtent
-
_scrollController
.
position
.
pixels
;
final
scrollPosition
=
_scrollController
.
position
;
final
isScrollReversed
=
scrollPosition
.
axisDirection
==
AxisDirection
.
down
;
final
diff
=
isScrollReversed
?
scrollPosition
.
pixels
:
scrollPosition
.
maxScrollExtent
-
scrollPosition
.
pixels
;
if
(
diff
<=
0
)
{
//Check if
listener is same from scrollController
//Check if
scrollController is used
if
(!
_scrollController
.
hasClients
)
return
;
if
(
_scrollController
.
position
.
pixels
!=
notification
.
metrics
.
pixels
)
{
//Check if listener is same from scrollController
if
(
scrollPosition
.
pixels
!=
notification
.
metrics
.
pixels
)
{
return
;
}
DragUpdateDetails
dragDetails
;
if
(
notification
is
ScrollStartNotification
)
{
_velocityTracker
=
VelocityTracker
();
_startTime
=
DateTime
.
now
();
}
DragUpdateDetails
dragDetails
;
if
(
notification
is
ScrollUpdateNotification
)
{
dragDetails
=
notification
.
dragDetails
;
}
...
...
Please
register
or
login
to post a comment