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
bcbfdf8f
Commit
bcbfdf8f
authored
Dec 15, 2015
by
Hans Muller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tabs should only scroll on a horizontal TabBarView fling
parent
ff2c8b48
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
tabs.dart
packages/flutter/lib/src/material/tabs.dart
+5
-1
No files found.
packages/flutter/lib/src/material/tabs.dart
View file @
bcbfdf8f
...
...
@@ -31,6 +31,10 @@ const EdgeDims _kTabLabelPadding = const EdgeDims.symmetric(horizontal: 12.0);
const
double
_kTabBarScrollDrag
=
0.025
;
const
Duration
_kTabBarScroll
=
const
Duration
(
milliseconds:
300
);
// The scrollOffset (velocity) provided to fling() is pixels/ms, and the
// tolerance velocity is pixels/sec.
final
double
_kMinFlingVelocity
=
kPixelScrollTolerance
.
velocity
/
2000.0
;
class
_TabBarParentData
extends
ContainerBoxParentDataMixin
<
RenderBox
>
{
}
class
_RenderTabBar
extends
RenderBox
with
...
...
@@ -756,7 +760,7 @@ class _TabBarViewState<T> extends PageableListState<T, TabBarView<T>> {
if
(
config
.
selection
.
indexIsChanging
)
return
new
Future
.
value
();
if
(
scrollVelocity
!=
Offset
.
zero
)
{
if
(
scrollVelocity
.
dx
.
abs
()
>
_kMinFlingVelocity
)
{
final
int
selectionDelta
=
scrollVelocity
.
dx
>
0
?
-
1
:
1
;
config
.
selection
.
index
=
(
config
.
selection
.
index
+
selectionDelta
).
clamp
(
0
,
_tabCount
-
1
);
return
new
Future
.
value
();
...
...
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