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
1ec625ff
Commit
1ec625ff
authored
Feb 08, 2017
by
Adam Barth
Committed by
GitHub
Feb 08, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove PageableList (#7997)
All clients have moved to PageView.
parent
b4ec00c2
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
732 deletions
+23
-732
item.dart
examples/flutter_gallery/lib/gallery/item.dart
+1
-1
tabs.dart
packages/flutter/lib/src/material/tabs.dart
+3
-3
pageable_list.dart
packages/flutter/lib/src/widgets/pageable_list.dart
+0
-591
scrollable.dart
packages/flutter/lib/src/widgets/scrollable.dart
+0
-1
virtual_viewport.dart
packages/flutter/lib/src/widgets/virtual_viewport.dart
+1
-1
widgets.dart
packages/flutter/lib/widgets.dart
+0
-1
pageable_list_test.dart
packages/flutter/test/widgets/pageable_list_test.dart
+18
-134
No files found.
examples/flutter_gallery/lib/gallery/item.dart
View file @
1ec625ff
...
@@ -170,7 +170,7 @@ final List<GalleryItem> kAllGalleryItems = <GalleryItem>[
...
@@ -170,7 +170,7 @@ final List<GalleryItem> kAllGalleryItems = <GalleryItem>[
),
),
new
GalleryItem
(
new
GalleryItem
(
title:
'Page selector'
,
title:
'Page selector'
,
subtitle:
'Page
able list
with indicator'
,
subtitle:
'Page
View
with indicator'
,
routeName:
PageSelectorDemo
.
routeName
,
routeName:
PageSelectorDemo
.
routeName
,
buildRoute:
(
BuildContext
context
)
=>
new
PageSelectorDemo
()
buildRoute:
(
BuildContext
context
)
=>
new
PageSelectorDemo
()
),
),
...
...
packages/flutter/lib/src/material/tabs.dart
View file @
1ec625ff
...
@@ -590,13 +590,13 @@ class _TabBarState extends State<TabBar> {
...
@@ -590,13 +590,13 @@ class _TabBarState extends State<TabBar> {
}
}
}
}
/// A page
able list
that displays the widget which corresponds to the currently
/// A page
view
that displays the widget which corresponds to the currently
/// selected tab. Typically used in conjuction with a [TabBar].
/// selected tab. Typically used in conjuction with a [TabBar].
///
///
/// If a [TabController] is not provided, then there must be a [DefaultTabController]
/// If a [TabController] is not provided, then there must be a [DefaultTabController]
/// ancestor.
/// ancestor.
class
TabBarView
extends
StatefulWidget
{
class
TabBarView
extends
StatefulWidget
{
/// Creates a page
able list
with one child per tab.
/// Creates a page
view
with one child per tab.
///
///
/// The length of [children] must be the same as the [controller]'s length.
/// The length of [children] must be the same as the [controller]'s length.
TabBarView
({
TabBarView
({
...
@@ -744,7 +744,7 @@ class _TabBarViewState extends State<TabBarView> {
...
@@ -744,7 +744,7 @@ class _TabBarViewState extends State<TabBarView> {
if
(
integralScrollOffset
==
_pageController
.
page
)
{
if
(
integralScrollOffset
==
_pageController
.
page
)
{
_offsetBias
=
0.0
;
_offsetBias
=
0.0
;
// The animation duration is short since the tab indicator and this
// The animation duration is short since the tab indicator and this
// page
able list
have already moved.
// page
view
have already moved.
_controller
.
animateTo
(
_controller
.
animateTo
(
integralScrollOffset
.
floor
(),
integralScrollOffset
.
floor
(),
duration:
const
Duration
(
milliseconds:
30
)
duration:
const
Duration
(
milliseconds:
30
)
...
...
packages/flutter/lib/src/widgets/pageable_list.dart
deleted
100644 → 0
View file @
b4ec00c2
This diff is collapsed.
Click to expand it.
packages/flutter/lib/src/widgets/scrollable.dart
View file @
1ec625ff
...
@@ -1239,7 +1239,6 @@ class ScrollNotification extends Notification {
...
@@ -1239,7 +1239,6 @@ class ScrollNotification extends Notification {
///
///
/// * [Block], if your single child is a [Column].
/// * [Block], if your single child is a [Column].
/// * [ScrollableList], if you have many identically-sized children.
/// * [ScrollableList], if you have many identically-sized children.
/// * [PageableList], if you have children that each take the entire screen.
/// * [ScrollableGrid], if your children are in a grid pattern.
/// * [ScrollableGrid], if your children are in a grid pattern.
/// * [LazyBlock], if you have many children of varying sizes.
/// * [LazyBlock], if you have many children of varying sizes.
class
ScrollableViewport
extends
StatelessWidget
{
class
ScrollableViewport
extends
StatelessWidget
{
...
...
packages/flutter/lib/src/widgets/virtual_viewport.dart
View file @
1ec625ff
...
@@ -287,7 +287,7 @@ class _IterableWidgetProvider extends _WidgetProvider {
...
@@ -287,7 +287,7 @@ class _IterableWidgetProvider extends _WidgetProvider {
/// Signature of a callback that returns the sublist of widgets in the given range.
/// Signature of a callback that returns the sublist of widgets in the given range.
///
///
/// Used by [
PageableList.itemBuilder], [
ScrollableLazyList.itemBuilder], etc.
/// Used by [ScrollableLazyList.itemBuilder], etc.
typedef
List
<
Widget
>
ItemListBuilder
(
BuildContext
context
,
int
start
,
int
count
);
typedef
List
<
Widget
>
ItemListBuilder
(
BuildContext
context
,
int
start
,
int
count
);
/// A VirtualViewport that represents its children using [ItemListBuilder].
/// A VirtualViewport that represents its children using [ItemListBuilder].
...
...
packages/flutter/lib/widgets.dart
View file @
1ec625ff
...
@@ -40,7 +40,6 @@ export 'src/widgets/overlay.dart';
...
@@ -40,7 +40,6 @@ export 'src/widgets/overlay.dart';
export
'src/widgets/overscroll_indicator.dart'
;
export
'src/widgets/overscroll_indicator.dart'
;
export
'src/widgets/page_storage.dart'
;
export
'src/widgets/page_storage.dart'
;
export
'src/widgets/page_view.dart'
;
export
'src/widgets/page_view.dart'
;
export
'src/widgets/pageable_list.dart'
;
export
'src/widgets/pages.dart'
;
export
'src/widgets/pages.dart'
;
export
'src/widgets/performance_overlay.dart'
;
export
'src/widgets/performance_overlay.dart'
;
export
'src/widgets/placeholder.dart'
;
export
'src/widgets/placeholder.dart'
;
...
...
packages/flutter/test/widgets/pageable_list_test.dart
View file @
1ec625ff
...
@@ -21,23 +21,22 @@ Widget buildPage(int page) {
...
@@ -21,23 +21,22 @@ Widget buildPage(int page) {
}
}
Widget
buildFrame
(
{
Widget
buildFrame
(
{
bool
itemsWrap:
false
,
bool
reverse:
false
,
ViewportAnchor
scrollAnchor:
ViewportAnchor
.
start
,
List
<
int
>
pages:
defaultPages
List
<
int
>
pages:
defaultPages
})
{
})
{
final
PageableList
list
=
new
PageableList
(
final
PageView
child
=
new
PageView
(
children:
pages
.
map
(
buildPage
),
itemsWrap:
itemsWrap
,
scrollDirection:
Axis
.
horizontal
,
scrollDirection:
Axis
.
horizontal
,
scrollAnchor:
scrollAnchor
,
reverse:
reverse
,
onPageChanged:
(
int
page
)
{
currentPage
=
page
;
}
onPageChanged:
(
int
page
)
{
currentPage
=
page
;
},
children:
pages
.
map
(
buildPage
).
toList
(),
);
);
// The test framework forces the frame to be 800x600, so we need to create
// The test framework forces the frame to be 800x600, so we need to create
// an outer container where we can change the size.
// an outer container where we can change the size.
return
new
Center
(
return
new
Center
(
child:
new
Container
(
child:
new
Container
(
width:
pageSize
.
width
,
height:
pageSize
.
height
,
child:
list
)
width:
pageSize
.
width
,
height:
pageSize
.
height
,
child:
child
,
),
);
);
}
}
...
@@ -45,9 +44,8 @@ Future<Null> page(WidgetTester tester, Offset offset) {
...
@@ -45,9 +44,8 @@ Future<Null> page(WidgetTester tester, Offset offset) {
return
TestAsyncUtils
.
guard
(()
async
{
return
TestAsyncUtils
.
guard
(()
async
{
String
itemText
=
currentPage
!=
null
?
currentPage
.
toString
()
:
'0'
;
String
itemText
=
currentPage
!=
null
?
currentPage
.
toString
()
:
'0'
;
await
tester
.
scroll
(
find
.
text
(
itemText
),
offset
);
await
tester
.
scroll
(
find
.
text
(
itemText
),
offset
);
// One frame to start the animation, a second to complete it.
await
tester
.
pump
();
await
tester
.
pump
();
await
tester
.
pump
(
const
Duration
(
seconds:
1
)
);
await
tester
.
pump
UntilNoTransientCallbacks
(
);
});
});
}
}
...
@@ -60,11 +58,11 @@ Future<Null> pageRight(WidgetTester tester) {
...
@@ -60,11 +58,11 @@ Future<Null> pageRight(WidgetTester tester) {
}
}
void
main
(
)
{
void
main
(
)
{
testWidgets
(
'Page
ableList
default control'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Page
View
default control'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
new
Center
(
child:
new
Page
ableList
()));
await
tester
.
pumpWidget
(
new
Center
(
child:
new
Page
View
()));
});
});
testWidgets
(
'Page
ableList with itemsWrap: false
'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Page
View control test
'
,
(
WidgetTester
tester
)
async
{
currentPage
=
null
;
currentPage
=
null
;
await
tester
.
pumpWidget
(
buildFrame
());
await
tester
.
pumpWidget
(
buildFrame
());
expect
(
currentPage
,
isNull
);
expect
(
currentPage
,
isNull
);
...
@@ -92,74 +90,18 @@ void main() {
...
@@ -92,74 +90,18 @@ void main() {
expect
(
currentPage
,
equals
(
0
));
expect
(
currentPage
,
equals
(
0
));
});
});
testWidgets
(
'PageableList with end scroll anchor'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'PageView with reverse'
,
(
WidgetTester
tester
)
async
{
currentPage
=
5
;
await
tester
.
pumpWidget
(
buildFrame
(
scrollAnchor:
ViewportAnchor
.
end
));
await
pageRight
(
tester
);
expect
(
currentPage
,
equals
(
4
));
expect
(
find
.
text
(
'0'
),
findsNothing
);
expect
(
find
.
text
(
'1'
),
findsNothing
);
expect
(
find
.
text
(
'2'
),
findsNothing
);
expect
(
find
.
text
(
'3'
),
findsNothing
);
expect
(
find
.
text
(
'4'
),
findsOneWidget
);
expect
(
find
.
text
(
'5'
),
findsNothing
);
await
pageLeft
(
tester
);
expect
(
currentPage
,
equals
(
5
));
expect
(
find
.
text
(
'0'
),
findsNothing
);
expect
(
find
.
text
(
'1'
),
findsNothing
);
expect
(
find
.
text
(
'2'
),
findsNothing
);
expect
(
find
.
text
(
'3'
),
findsNothing
);
expect
(
find
.
text
(
'4'
),
findsNothing
);
expect
(
find
.
text
(
'5'
),
findsOneWidget
);
await
pageLeft
(
tester
);
expect
(
currentPage
,
equals
(
5
));
expect
(
find
.
text
(
'0'
),
findsNothing
);
expect
(
find
.
text
(
'1'
),
findsNothing
);
expect
(
find
.
text
(
'2'
),
findsNothing
);
expect
(
find
.
text
(
'3'
),
findsNothing
);
expect
(
find
.
text
(
'4'
),
findsNothing
);
expect
(
find
.
text
(
'5'
),
findsOneWidget
);
});
testWidgets
(
'PageableList with itemsWrap: true'
,
(
WidgetTester
tester
)
async
{
currentPage
=
null
;
currentPage
=
null
;
await
tester
.
pumpWidget
(
buildFrame
(
itemsWrap:
true
));
await
tester
.
pumpWidget
(
buildFrame
(
reverse:
true
));
expect
(
currentPage
,
isNull
);
await
pageLeft
(
tester
);
expect
(
currentPage
,
equals
(
1
));
await
pageRight
(
tester
);
expect
(
currentPage
,
equals
(
0
));
await
pageRight
(
tester
);
expect
(
currentPage
,
equals
(
5
));
});
testWidgets
(
'PageableList with end and itemsWrap: true'
,
(
WidgetTester
tester
)
async
{
currentPage
=
5
;
await
tester
.
pumpWidget
(
buildFrame
(
itemsWrap:
true
,
scrollAnchor:
ViewportAnchor
.
end
));
await
pageRight
(
tester
);
await
pageRight
(
tester
);
expect
(
currentPage
,
equals
(
4
));
expect
(
currentPage
,
equals
(
1
));
expect
(
find
.
text
(
'0'
),
findsNothing
);
expect
(
find
.
text
(
'1'
),
findsNothing
);
expect
(
find
.
text
(
'2'
),
findsNothing
);
expect
(
find
.
text
(
'3'
),
findsNothing
);
expect
(
find
.
text
(
'4'
),
findsOneWidget
);
expect
(
find
.
text
(
'5'
),
findsNothing
);
await
pageLeft
(
tester
);
expect
(
currentPage
,
equals
(
5
));
expect
(
find
.
text
(
'0'
),
findsNothing
);
expect
(
find
.
text
(
'0'
),
findsNothing
);
expect
(
find
.
text
(
'1'
),
finds
Nothing
);
expect
(
find
.
text
(
'1'
),
finds
OneWidget
);
expect
(
find
.
text
(
'2'
),
findsNothing
);
expect
(
find
.
text
(
'2'
),
findsNothing
);
expect
(
find
.
text
(
'3'
),
findsNothing
);
expect
(
find
.
text
(
'3'
),
findsNothing
);
expect
(
find
.
text
(
'4'
),
findsNothing
);
expect
(
find
.
text
(
'4'
),
findsNothing
);
expect
(
find
.
text
(
'5'
),
finds
OneWidget
);
expect
(
find
.
text
(
'5'
),
finds
Nothing
);
await
pageLeft
(
tester
);
await
pageLeft
(
tester
);
expect
(
currentPage
,
equals
(
0
));
expect
(
currentPage
,
equals
(
0
));
...
@@ -172,71 +114,13 @@ void main() {
...
@@ -172,71 +114,13 @@ void main() {
expect
(
find
.
text
(
'5'
),
findsNothing
);
expect
(
find
.
text
(
'5'
),
findsNothing
);
await
pageLeft
(
tester
);
await
pageLeft
(
tester
);
expect
(
currentPage
,
equals
(
1
));
expect
(
find
.
text
(
'0'
),
findsNothing
);
expect
(
find
.
text
(
'1'
),
findsOneWidget
);
expect
(
find
.
text
(
'2'
),
findsNothing
);
expect
(
find
.
text
(
'3'
),
findsNothing
);
expect
(
find
.
text
(
'4'
),
findsNothing
);
expect
(
find
.
text
(
'5'
),
findsNothing
);
});
testWidgets
(
'PageableList with two items'
,
(
WidgetTester
tester
)
async
{
currentPage
=
null
;
await
tester
.
pumpWidget
(
buildFrame
(
itemsWrap:
true
,
pages:
<
int
>[
0
,
1
]));
expect
(
currentPage
,
isNull
);
await
pageLeft
(
tester
);
expect
(
currentPage
,
equals
(
1
));
await
pageRight
(
tester
);
expect
(
currentPage
,
equals
(
0
));
await
pageRight
(
tester
);
expect
(
currentPage
,
equals
(
1
));
});
testWidgets
(
'PageableList with one item'
,
(
WidgetTester
tester
)
async
{
currentPage
=
null
;
await
tester
.
pumpWidget
(
buildFrame
(
itemsWrap:
true
,
pages:
<
int
>[
0
]));
expect
(
currentPage
,
isNull
);
await
pageLeft
(
tester
);
expect
(
currentPage
,
equals
(
0
));
await
pageRight
(
tester
);
expect
(
currentPage
,
equals
(
0
));
await
pageRight
(
tester
);
expect
(
currentPage
,
equals
(
0
));
expect
(
currentPage
,
equals
(
0
));
});
testWidgets
(
'PageableList with no items'
,
(
WidgetTester
tester
)
async
{
currentPage
=
null
;
await
tester
.
pumpWidget
(
buildFrame
(
itemsWrap:
true
,
pages:
<
int
>[]));
expect
(
currentPage
,
isNull
);
});
testWidgets
(
'PageableList resize parent'
,
(
WidgetTester
tester
)
async
{
expect
(
find
.
text
(
'0'
),
findsOneWidget
);
await
tester
.
pumpWidget
(
new
Container
());
currentPage
=
null
;
await
tester
.
pumpWidget
(
buildFrame
(
itemsWrap:
true
));
expect
(
currentPage
,
isNull
);
await
pageRight
(
tester
);
expect
(
currentPage
,
equals
(
5
));
Size
boxSize
=
globalKeys
[
5
].
currentContext
.
size
;
expect
(
boxSize
.
width
,
equals
(
pageSize
.
width
));
expect
(
boxSize
.
height
,
equals
(
pageSize
.
height
));
pageSize
=
new
Size
(
pageSize
.
height
,
pageSize
.
width
);
await
tester
.
pumpWidget
(
buildFrame
(
itemsWrap:
true
));
expect
(
find
.
text
(
'0'
),
findsNothing
);
expect
(
find
.
text
(
'1'
),
findsNothing
);
expect
(
find
.
text
(
'1'
),
findsNothing
);
expect
(
find
.
text
(
'2'
),
findsNothing
);
expect
(
find
.
text
(
'2'
),
findsNothing
);
expect
(
find
.
text
(
'3'
),
findsNothing
);
expect
(
find
.
text
(
'3'
),
findsNothing
);
expect
(
find
.
text
(
'4'
),
findsNothing
);
expect
(
find
.
text
(
'4'
),
findsNothing
);
expect
(
find
.
text
(
'5'
),
findsOneWidget
);
expect
(
find
.
text
(
'5'
),
findsNothing
);
boxSize
=
globalKeys
[
5
].
currentContext
.
size
;
expect
(
boxSize
.
width
,
equals
(
pageSize
.
width
));
expect
(
boxSize
.
height
,
equals
(
pageSize
.
height
));
});
});
}
}
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