Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
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
abdullh.alsoleman
Front-End
Commits
114135aa
Commit
114135aa
authored
Nov 30, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #633 from abarth/fling_sheet_up
Bottom sheets shouldn't dismiss when flung up
parents
2f0e8eb1
7192dbb1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
bottom_sheet.dart
packages/flutter/lib/src/material/bottom_sheet.dart
+6
-4
No files found.
packages/flutter/lib/src/material/bottom_sheet.dart
View file @
114135aa
...
...
@@ -52,12 +52,14 @@ class BottomSheet extends StatelessComponent {
performance
.
progress
-=
delta
/
(
childHeight
??
delta
);
}
void
_handleDragEnd
(
Offset
velocity
,
BuildContext
context
)
{
void
_handleDragEnd
(
Offset
velocity
)
{
if
(
_dismissUnderway
)
return
;
if
(
velocity
.
dy
>
_kMinFlingVelocity
)
{
performance
.
fling
(
velocity:
-
velocity
.
dy
/
childHeight
);
onClosing
();
double
flingVelocity
=
-
velocity
.
dy
/
childHeight
;
performance
.
fling
(
velocity:
flingVelocity
);
if
(
flingVelocity
<
0.0
)
onClosing
();
}
else
if
(
performance
.
progress
<
_kCloseProgressThreshold
)
{
performance
.
fling
(
velocity:
-
1.0
);
onClosing
();
...
...
@@ -69,7 +71,7 @@ class BottomSheet extends StatelessComponent {
Widget
build
(
BuildContext
context
)
{
return
new
GestureDetector
(
onVerticalDragUpdate:
_handleDragUpdate
,
onVerticalDragEnd:
(
Offset
velocity
)
{
_handleDragEnd
(
velocity
,
context
);
}
,
onVerticalDragEnd:
_handleDragEnd
,
child:
new
Material
(
child:
builder
(
context
)
)
...
...
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