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
2e998661
Commit
2e998661
authored
Feb 07, 2017
by
Adam Barth
Committed by
GitHub
Feb 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use sliver-based scrolling in more places (#7893)
In particular, we now use ListView in the about dialog.
parent
3addac54
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
38 deletions
+24
-38
main.dart
dev/benchmarks/complex_layout/lib/main.dart
+8
-21
about.dart
packages/flutter/lib/src/material/about.dart
+7
-8
scroll_interaction_test.dart
packages/flutter/test/widgets/scroll_interaction_test.dart
+7
-7
scrollable_list_with_inherited_test.dart
...ter/test/widgets/scrollable_list_with_inherited_test.dart
+2
-2
No files found.
dev/benchmarks/complex_layout/lib/main.dart
View file @
2e998661
...
...
@@ -52,24 +52,6 @@ class ComplexLayout extends StatefulWidget {
static
ComplexLayoutState
of
(
BuildContext
context
)
=>
context
.
ancestorStateOfType
(
const
TypeMatcher
<
ComplexLayoutState
>());
}
class
FancyItemDelegate
extends
LazyBlockDelegate
{
@override
Widget
buildItem
(
BuildContext
context
,
int
index
)
{
if
(
index
%
2
==
0
)
return
new
FancyImageItem
(
index
,
key:
new
ValueKey
<
int
>(
index
));
else
return
new
FancyGalleryItem
(
index
,
key:
new
ValueKey
<
int
>(
index
));
}
@override
bool
shouldRebuild
(
FancyItemDelegate
oldDelegate
)
=>
false
;
@override
double
estimateTotalExtent
(
int
firstIndex
,
int
lastIndex
,
double
minOffset
,
double
firstStartOffset
,
double
lastEndOffset
)
{
return
double
.
INFINITY
;
}
}
class
ComplexLayoutState
extends
State
<
ComplexLayout
>
{
@override
Widget
build
(
BuildContext
context
)
{
...
...
@@ -91,10 +73,15 @@ class ComplexLayoutState extends State<ComplexLayout> {
body:
new
Column
(
children:
<
Widget
>[
new
Expanded
(
child:
new
L
azyBlock
(
child:
new
L
istView
.
builder
(
key:
new
Key
(
'main-scroll'
),
// this key is used by the driver test
delegate:
new
FancyItemDelegate
(),
)
itemBuilder:
(
BuildContext
context
,
int
index
)
{
if
(
index
%
2
==
0
)
return
new
FancyImageItem
(
index
,
key:
new
ValueKey
<
int
>(
index
));
else
return
new
FancyGalleryItem
(
index
,
key:
new
ValueKey
<
int
>(
index
));
},
),
),
new
BottomBar
(),
],
...
...
packages/flutter/lib/src/material/about.dart
View file @
2e998661
...
...
@@ -447,15 +447,14 @@ class _LicensePageState extends State<LicensePage> {
),
body:
new
DefaultTextStyle
(
style:
Theme
.
of
(
context
).
textTheme
.
caption
,
child:
new
Scrollbar
(
child:
new
L
azyBlock
(
child:
new
Scrollbar
2
(
child:
new
L
istView
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
8.0
,
vertical:
12.0
),
delegate:
new
LazyBlockChildren
(
children:
contents
)
)
)
)
shrinkWrap:
true
,
children:
contents
,
),
),
),
);
}
}
...
...
packages/flutter/test/widgets/scroll_interaction_test.dart
View file @
2e998661
...
...
@@ -7,29 +7,29 @@ import 'package:flutter/widgets.dart';
void
main
(
)
{
testWidgets
(
'Scroll flings twice in a row does not crash'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
new
Block
(
await
tester
.
pumpWidget
(
new
ListView
(
children:
<
Widget
>[
new
Container
(
height:
100000.0
)
]
));
ScrollableState
scrollable
=
tester
.
state
<
Scrollable
State
>(
find
.
byType
(
Scrollable
));
Scrollable
2
State
scrollable
=
tester
.
state
<
Scrollable
2State
>(
find
.
byType
(
Scrollable2
));
expect
(
scrollable
.
scrollOffset
,
equals
(
0.0
));
expect
(
scrollable
.
position
.
pixels
,
equals
(
0.0
));
await
tester
.
flingFrom
(
const
Point
(
200.0
,
300.0
),
const
Offset
(
0.0
,
-
200.0
),
500.0
);
await
tester
.
pump
();
await
tester
.
pump
(
const
Duration
(
seconds:
5
));
expect
(
scrollable
.
scrollOffset
,
greaterThan
(
0.0
));
expect
(
scrollable
.
position
.
pixels
,
greaterThan
(
0.0
));
double
oldOffset
=
scrollable
.
scrollOffset
;
double
oldOffset
=
scrollable
.
position
.
pixels
;
await
tester
.
flingFrom
(
const
Point
(
200.0
,
300.0
),
const
Offset
(
0.0
,
-
200.0
),
500.0
);
await
tester
.
pump
();
await
tester
.
pump
(
const
Duration
(
seconds:
5
));
expect
(
scrollable
.
scrollOffset
,
greaterThan
(
oldOffset
));
expect
(
scrollable
.
position
.
pixels
,
greaterThan
(
oldOffset
));
});
}
packages/flutter/test/widgets/scrollable_list_with_inherited_test.dart
View file @
2e998661
...
...
@@ -21,8 +21,8 @@ Widget buildCard(BuildContext context, int index) {
}
Widget
buildFrame
(
)
{
return
new
L
azyBlock
(
delegate:
new
LazyBlockBuilder
(
builder:
buildCard
)
return
new
L
istView
.
builder
(
itemBuilder:
buildCard
,
);
}
...
...
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