Commit 5966f676 authored by Hans Muller's avatar Hans Muller

fix #1126

parent 51d06647
...@@ -814,7 +814,7 @@ class _TabBarViewState<T> extends PageableListState<TabBarView<T>> implements Ta ...@@ -814,7 +814,7 @@ class _TabBarViewState<T> extends PageableListState<TabBarView<T>> implements Ta
_selection = selection; _selection = selection;
if (_selection != null) { if (_selection != null) {
_selection.registerPerformanceListener(this); _selection.registerPerformanceListener(this);
_initItemIndicesAndScrollPosition(); _initItemsAndScrollOffset();
} }
} }
...@@ -839,18 +839,18 @@ class _TabBarViewState<T> extends PageableListState<TabBarView<T>> implements Ta ...@@ -839,18 +839,18 @@ class _TabBarViewState<T> extends PageableListState<TabBarView<T>> implements Ta
_items.add(widgets[third]); _items.add(widgets[third]);
} }
void _initItemIndicesAndScrollPosition() { void _initItemsAndScrollOffset() {
assert(_selection != null); assert(_selection != null);
final int selectedIndex = _selection.index; final int selectedIndex = _selection.index;
if (selectedIndex == 0) { if (selectedIndex == 0) {
_updateItems(0, 1); _updateItems(0, 1);
scrollTo(0.0); scrollTo(scrollBehavior.updateExtents(contentExtent: 2.0, containerExtent: 1.0, scrollOffset: 0.0));
} else if (selectedIndex == _tabCount - 1) { } else if (selectedIndex == _tabCount - 1) {
_updateItems(selectedIndex - 1, selectedIndex); _updateItems(selectedIndex - 1, selectedIndex);
scrollTo(1.0); scrollTo(scrollBehavior.updateExtents(contentExtent: 1.0, containerExtent: 1.0, scrollOffset: 1.0));
} else { } else {
_updateItems(selectedIndex - 1, selectedIndex, selectedIndex + 1); _updateItems(selectedIndex - 1, selectedIndex, selectedIndex + 1);
scrollTo(1.0); scrollTo(scrollBehavior.updateExtents(contentExtent: 3.0, containerExtent: 1.0, scrollOffset: 1.0));
} }
} }
...@@ -865,7 +865,7 @@ class _TabBarViewState<T> extends PageableListState<TabBarView<T>> implements Ta ...@@ -865,7 +865,7 @@ class _TabBarViewState<T> extends PageableListState<TabBarView<T>> implements Ta
final Performance performance = _selection.performance; final Performance performance = _selection.performance;
if (performance.status == PerformanceStatus.completed) { if (performance.status == PerformanceStatus.completed) {
_initItemIndicesAndScrollPosition(); _initItemsAndScrollOffset();
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment