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
606887a1
Commit
606887a1
authored
Jan 08, 2016
by
Hans Muller
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1127 from HansMuller/fix_tabs
Fix tab fling scrolling when the last tab is selected
parents
39ad22c8
5966f676
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
tabs.dart
packages/flutter/lib/src/material/tabs.dart
+6
-6
No files found.
packages/flutter/lib/src/material/tabs.dart
View file @
606887a1
...
...
@@ -806,7 +806,7 @@ class _TabBarViewState<T> extends PageableListState<TabBarView<T>> implements Ta
_selection
=
selection
;
if
(
_selection
!=
null
)
{
_selection
.
registerPerformanceListener
(
this
);
_initItem
IndicesAndScrollPosition
();
_initItem
sAndScrollOffset
();
}
}
...
...
@@ -831,18 +831,18 @@ class _TabBarViewState<T> extends PageableListState<TabBarView<T>> implements Ta
_items
.
add
(
widgets
[
third
]);
}
void
_initItem
IndicesAndScrollPosition
()
{
void
_initItem
sAndScrollOffset
()
{
assert
(
_selection
!=
null
);
final
int
selectedIndex
=
_selection
.
index
;
if
(
selectedIndex
==
0
)
{
_updateItems
(
0
,
1
);
scrollTo
(
0.0
);
scrollTo
(
scrollBehavior
.
updateExtents
(
contentExtent:
2.0
,
containerExtent:
1.0
,
scrollOffset:
0.0
)
);
}
else
if
(
selectedIndex
==
_tabCount
-
1
)
{
_updateItems
(
selectedIndex
-
1
,
selectedIndex
);
scrollTo
(
1.0
);
scrollTo
(
scrollBehavior
.
updateExtents
(
contentExtent:
1.0
,
containerExtent:
1.0
,
scrollOffset:
1.0
)
);
}
else
{
_updateItems
(
selectedIndex
-
1
,
selectedIndex
,
selectedIndex
+
1
);
scrollTo
(
1.0
);
scrollTo
(
scrollBehavior
.
updateExtents
(
contentExtent:
3.0
,
containerExtent:
1.0
,
scrollOffset:
1.0
)
);
}
}
...
...
@@ -857,7 +857,7 @@ class _TabBarViewState<T> extends PageableListState<TabBarView<T>> implements Ta
final
Performance
performance
=
_selection
.
performance
;
if
(
performance
.
status
==
PerformanceStatus
.
completed
)
{
_initItem
IndicesAndScrollPosition
();
_initItem
sAndScrollOffset
();
return
;
}
...
...
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