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
d1d1c50c
Commit
d1d1c50c
authored
Feb 09, 2017
by
Alexandre Ardhuin
Committed by
Adam Barth
Feb 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prefer const constructors (#8024)
parent
3ca92161
Changes
35
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
221 additions
and
221 deletions
+221
-221
curves_test.dart
packages/flutter/test/animation/curves_test.dart
+1
-1
about_test.dart
packages/flutter/test/material/about_test.dart
+2
-2
image_icon_test.dart
packages/flutter/test/material/image_icon_test.dart
+1
-1
scrollbar_paint_test.dart
packages/flutter/test/material/scrollbar_paint_test.dart
+1
-1
slider_test.dart
packages/flutter/test/material/slider_test.dart
+1
-1
colors_test.dart
packages/flutter/test/painting/colors_test.dart
+1
-1
decoration_test.dart
packages/flutter/test/painting/decoration_test.dart
+1
-1
edge_insets_test.dart
packages/flutter/test/painting/edge_insets_test.dart
+1
-1
fractional_offset_test.dart
packages/flutter/test/painting/fractional_offset_test.dart
+2
-2
text_painter_test.dart
packages/flutter/test/painting/text_painter_test.dart
+1
-1
text_span_test.dart
packages/flutter/test/painting/text_span_test.dart
+4
-4
constraints_test.dart
packages/flutter/test/rendering/constraints_test.dart
+3
-3
debug_test.dart
packages/flutter/test/rendering/debug_test.dart
+4
-4
paragraph_test.dart
packages/flutter/test/rendering/paragraph_test.dart
+17
-17
proxy_getters_and_setters_test.dart
...lutter/test/rendering/proxy_getters_and_setters_test.dart
+4
-4
semantics_and_children_test.dart
...s/flutter/test/rendering/semantics_and_children_test.dart
+1
-1
slivers_helpers_test.dart
packages/flutter/test/rendering/slivers_helpers_test.dart
+5
-5
system_chrome_test.dart
packages/flutter/test/services/system_chrome_test.dart
+1
-1
animated_size_test.dart
packages/flutter/test/widgets/animated_size_test.dart
+2
-2
flex_test.dart
packages/flutter/test/widgets/flex_test.dart
+1
-1
grid_view_test.dart
packages/flutter/test/widgets/grid_view_test.dart
+4
-4
key_test.dart
packages/flutter/test/widgets/key_test.dart
+12
-12
notification_test.dart
packages/flutter/test/widgets/notification_test.dart
+1
-1
overscroll_indicator_test.dart
packages/flutter/test/widgets/overscroll_indicator_test.dart
+9
-9
render_object_widget_test.dart
packages/flutter/test/widgets/render_object_widget_test.dart
+3
-3
scrollable_custom_scroll_behavior_test.dart
.../test/widgets/scrollable_custom_scroll_behavior_test.dart
+2
-2
scrollable_test.dart
packages/flutter/test/widgets/scrollable_test.dart
+1
-1
size_changed_layout_notification_test.dart
...r/test/widgets/size_changed_layout_notification_test.dart
+1
-1
slivers_appbar_floating_test.dart
...es/flutter/test/widgets/slivers_appbar_floating_test.dart
+36
-36
slivers_appbar_pinned_test.dart
...ages/flutter/test/widgets/slivers_appbar_pinned_test.dart
+61
-61
slivers_appbar_scrolling_test.dart
...s/flutter/test/widgets/slivers_appbar_scrolling_test.dart
+6
-6
slivers_evil_test.dart
packages/flutter/test/widgets/slivers_evil_test.dart
+4
-4
slivers_padding_test.dart
packages/flutter/test/widgets/slivers_padding_test.dart
+16
-16
slivers_protocol_test.dart
packages/flutter/test/widgets/slivers_protocol_test.dart
+6
-6
slivers_test.dart
packages/flutter/test/widgets/slivers_test.dart
+5
-5
No files found.
packages/flutter/test/animation/curves_test.dart
View file @
d1d1c50c
...
...
@@ -13,7 +13,7 @@ void main() {
expect
(
Curves
.
linear
,
hasOneLineDescription
);
expect
(
const
SawTooth
(
3
),
hasOneLineDescription
);
expect
(
const
Interval
(
0.25
,
0.75
),
hasOneLineDescription
);
expect
(
new
Interval
(
0.25
,
0.75
,
curve:
Curves
.
ease
),
hasOneLineDescription
);
expect
(
const
Interval
(
0.25
,
0.75
,
curve:
Curves
.
ease
),
hasOneLineDescription
);
});
test
(
'Curve flipped control test'
,
()
{
...
...
packages/flutter/test/material/about_test.dart
View file @
d1d1c50c
...
...
@@ -22,7 +22,7 @@ void main() {
children:
<
Widget
>[
new
AboutDrawerItem
(
applicationVersion:
'0.1.2'
,
applicationIcon:
new
FlutterLogo
(),
applicationIcon:
const
FlutterLogo
(),
applicationLegalese:
'I am the very model of a modern major general.'
,
aboutBoxChildren:
<
Widget
>[
new
Text
(
'About box'
),
...
...
@@ -90,7 +90,7 @@ void main() {
});
await
tester
.
pumpWidget
(
new
Center
(
child:
new
LicensePage
()
child:
const
LicensePage
()
));
expect
(
licenseFuture
,
isNotNull
);
...
...
packages/flutter/test/material/image_icon_test.dart
View file @
d1d1c50c
...
...
@@ -29,7 +29,7 @@ void main() {
await
tester
.
pumpWidget
(
new
Center
(
child:
new
IconTheme
(
data:
new
IconThemeData
(
opacity:
0.5
),
data:
const
IconThemeData
(
opacity:
0.5
),
child:
const
ImageIcon
(
_kImage
),
),
),
...
...
packages/flutter/test/material/scrollbar_paint_test.dart
View file @
d1d1c50c
...
...
@@ -11,7 +11,7 @@ void main() {
testWidgets
(
'Viewport2 basic test'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
new
Scrollbar2
(
child:
new
SingleChildScrollView
(
child:
new
SizedBox
(
width:
4000.0
,
height:
4000.0
),
child:
const
SizedBox
(
width:
4000.0
,
height:
4000.0
),
),
));
expect
(
find
.
byType
(
Scrollbar2
),
isNot
(
paints
..
rect
()));
...
...
packages/flutter/test/material/slider_test.dart
View file @
d1d1c50c
...
...
@@ -152,7 +152,7 @@ void main() {
expect
(
value
,
equals
(
0.5
));
await
gesture
.
moveBy
(
new
Offset
(
1.0
,
0.0
));
await
gesture
.
moveBy
(
const
Offset
(
1.0
,
0.0
));
expect
(
value
,
greaterThan
(
0.5
));
...
...
packages/flutter/test/painting/colors_test.dart
View file @
d1d1c50c
...
...
@@ -10,7 +10,7 @@ void main() {
const
HSVColor
color
=
const
HSVColor
.
fromAHSV
(
0.7
,
28.0
,
0.3
,
0.6
);
expect
(
color
,
hasOneLineDescription
);
expect
(
color
.
hashCode
,
equals
(
new
HSVColor
.
fromAHSV
(
0.7
,
28.0
,
0.3
,
0.6
).
hashCode
));
expect
(
color
.
hashCode
,
equals
(
const
HSVColor
.
fromAHSV
(
0.7
,
28.0
,
0.3
,
0.6
).
hashCode
));
expect
(
color
.
withAlpha
(
0.8
),
const
HSVColor
.
fromAHSV
(
0.8
,
28.0
,
0.3
,
0.6
));
expect
(
color
.
withHue
(
123.0
),
const
HSVColor
.
fromAHSV
(
0.7
,
123.0
,
0.3
,
0.6
));
...
...
packages/flutter/test/painting/decoration_test.dart
View file @
d1d1c50c
...
...
@@ -195,7 +195,7 @@ void main() {
}
testDecoration
(
shape:
BoxShape
.
circle
,
expectClip:
true
);
testDecoration
(
borderRadius:
new
BorderRadius
.
all
(
const
Radius
.
circular
(
16.0
)),
expectClip:
true
);
testDecoration
(
borderRadius:
const
BorderRadius
.
all
(
const
Radius
.
circular
(
16.0
)),
expectClip:
true
);
testDecoration
(
expectClip:
false
);
});
}
packages/flutter/test/painting/edge_insets_test.dart
View file @
d1d1c50c
...
...
@@ -10,7 +10,7 @@ void main() {
const
EdgeInsets
insets
=
const
EdgeInsets
.
fromLTRB
(
5.0
,
7.0
,
11.0
,
13.0
);
expect
(
insets
,
hasOneLineDescription
);
expect
(
insets
.
hashCode
,
equals
(
new
EdgeInsets
.
fromLTRB
(
5.0
,
7.0
,
11.0
,
13.0
).
hashCode
));
expect
(
insets
.
hashCode
,
equals
(
const
EdgeInsets
.
fromLTRB
(
5.0
,
7.0
,
11.0
,
13.0
).
hashCode
));
expect
(
insets
.
topLeft
,
const
Offset
(
5.0
,
7.0
));
expect
(
insets
.
topRight
,
const
Offset
(-
11.0
,
7.0
));
...
...
packages/flutter/test/painting/fractional_offset_test.dart
View file @
d1d1c50c
...
...
@@ -10,7 +10,7 @@ void main() {
const
FractionalOffset
offset
=
const
FractionalOffset
(
0.5
,
0.25
);
expect
(
offset
,
hasOneLineDescription
);
expect
(
offset
.
hashCode
,
equals
(
new
FractionalOffset
(
0.5
,
0.25
).
hashCode
));
expect
(
offset
.
hashCode
,
equals
(
const
FractionalOffset
(
0.5
,
0.25
).
hashCode
));
expect
(
offset
/
2.0
,
const
FractionalOffset
(
0.25
,
0.125
));
expect
(
offset
~/
2.0
,
const
FractionalOffset
(
0.0
,
0.0
));
...
...
@@ -20,7 +20,7 @@ void main() {
test
(
'FractionalOffset.lerp()'
,
()
{
FractionalOffset
a
=
FractionalOffset
.
topLeft
;
FractionalOffset
b
=
FractionalOffset
.
topCenter
;
expect
(
FractionalOffset
.
lerp
(
a
,
b
,
0.25
),
equals
(
new
FractionalOffset
(
0.125
,
0.0
)));
expect
(
FractionalOffset
.
lerp
(
a
,
b
,
0.25
),
equals
(
const
FractionalOffset
(
0.125
,
0.0
)));
expect
(
FractionalOffset
.
lerp
(
null
,
null
,
0.25
),
isNull
);
expect
(
FractionalOffset
.
lerp
(
null
,
b
,
0.25
),
equals
(
b
*
0.25
));
...
...
packages/flutter/test/painting/text_painter_test.dart
View file @
d1d1c50c
...
...
@@ -16,7 +16,7 @@ void main() {
painter
.
text
=
new
TextSpan
(
text:
text
);
painter
.
layout
();
Offset
caretOffset
=
painter
.
getOffsetForCaret
(
new
ui
.
TextPosition
(
offset:
0
),
ui
.
Rect
.
zero
);
Offset
caretOffset
=
painter
.
getOffsetForCaret
(
const
ui
.
TextPosition
(
offset:
0
),
ui
.
Rect
.
zero
);
expect
(
caretOffset
.
dx
,
0
);
caretOffset
=
painter
.
getOffsetForCaret
(
new
ui
.
TextPosition
(
offset:
text
.
length
),
ui
.
Rect
.
zero
);
expect
(
caretOffset
.
dx
,
painter
.
width
);
...
...
packages/flutter/test/painting/text_span_test.dart
View file @
d1d1c50c
...
...
@@ -8,12 +8,12 @@ import 'package:test/test.dart';
void
main
(
)
{
test
(
'TextSpan equals'
,
()
{
TextSpan
a1
=
new
TextSpan
(
text:
'a'
);
// ignore: prefer_const_constructor
TextSpan
a2
=
new
TextSpan
(
text:
'a'
);
// ignore: prefer_const_constructor
TextSpan
a1
=
new
TextSpan
(
text:
'a'
);
// ignore: prefer_const_constructor
s
TextSpan
a2
=
new
TextSpan
(
text:
'a'
);
// ignore: prefer_const_constructor
s
TextSpan
b1
=
new
TextSpan
(
children:
<
TextSpan
>[
a1
]);
TextSpan
b2
=
new
TextSpan
(
children:
<
TextSpan
>[
a2
]);
TextSpan
c1
=
new
TextSpan
();
// ignore: prefer_const_constructor
TextSpan
c2
=
new
TextSpan
();
// ignore: prefer_const_constructor
TextSpan
c1
=
new
TextSpan
();
// ignore: prefer_const_constructor
s
TextSpan
c2
=
new
TextSpan
();
// ignore: prefer_const_constructor
s
expect
(
a1
==
a2
,
isTrue
);
expect
(
b1
==
b2
,
isTrue
);
...
...
packages/flutter/test/rendering/constraints_test.dart
View file @
d1d1c50c
...
...
@@ -36,7 +36,7 @@ void main() {
result
=
'no exception'
;
try
{
BoxConstraints
constraints
=
new
BoxConstraints
(
minWidth:
double
.
NAN
,
maxWidth:
double
.
NAN
,
minHeight:
2.0
,
maxHeight:
double
.
NAN
);
BoxConstraints
constraints
=
const
BoxConstraints
(
minWidth:
double
.
NAN
,
maxWidth:
double
.
NAN
,
minHeight:
2.0
,
maxHeight:
double
.
NAN
);
assert
(
constraints
.
debugAssertIsValid
());
}
on
FlutterError
catch
(
e
)
{
result
=
'
$e
'
;
...
...
@@ -49,7 +49,7 @@ void main() {
result
=
'no exception'
;
try
{
BoxConstraints
constraints
=
new
BoxConstraints
(
minHeight:
double
.
NAN
);
BoxConstraints
constraints
=
const
BoxConstraints
(
minHeight:
double
.
NAN
);
assert
(
constraints
.
debugAssertIsValid
());
}
on
FlutterError
catch
(
e
)
{
result
=
'
$e
'
;
...
...
@@ -62,7 +62,7 @@ void main() {
result
=
'no exception'
;
try
{
BoxConstraints
constraints
=
new
BoxConstraints
(
minHeight:
double
.
NAN
,
maxWidth:
0.0
/
0.0
);
BoxConstraints
constraints
=
const
BoxConstraints
(
minHeight:
double
.
NAN
,
maxWidth:
0.0
/
0.0
);
assert
(
constraints
.
debugAssertIsValid
());
}
on
FlutterError
catch
(
e
)
{
result
=
'
$e
'
;
...
...
packages/flutter/test/rendering/debug_test.dart
View file @
d1d1c50c
...
...
@@ -41,10 +41,10 @@ void main() {
offset:
new
ViewportOffset
.
zero
(),
children:
<
RenderSliver
>[
s
=
new
RenderSliverPadding
(
padding:
new
EdgeInsets
.
all
(
10.0
),
padding:
const
EdgeInsets
.
all
(
10.0
),
child:
new
RenderSliverToBoxAdapter
(
child:
b
=
new
RenderPadding
(
padding:
new
EdgeInsets
.
all
(
10.0
),
padding:
const
EdgeInsets
.
all
(
10.0
),
),
),
),
...
...
@@ -63,12 +63,12 @@ void main() {
debugPaintSizeEnabled
=
true
;
RenderSliver
s
;
RenderBox
b
=
new
RenderPadding
(
padding:
new
EdgeInsets
.
all
(
10.0
),
padding:
const
EdgeInsets
.
all
(
10.0
),
child:
new
RenderViewport2
(
offset:
new
ViewportOffset
.
zero
(),
children:
<
RenderSliver
>[
s
=
new
RenderSliverPadding
(
padding:
new
EdgeInsets
.
all
(
10.0
),
padding:
const
EdgeInsets
.
all
(
10.0
),
),
],
),
...
...
packages/flutter/test/rendering/paragraph_test.dart
View file @
d1d1c50c
...
...
@@ -13,69 +13,69 @@ const String _kText = 'I polished up that handle so carefullee\nThat now I am th
void
main
(
)
{
test
(
'getOffsetForCaret control test'
,
()
{
RenderParagraph
paragraph
=
new
RenderParagraph
(
new
TextSpan
(
text:
_kText
));
RenderParagraph
paragraph
=
new
RenderParagraph
(
const
TextSpan
(
text:
_kText
));
layout
(
paragraph
);
Rect
caret
=
new
Rect
.
fromLTWH
(
0.0
,
0.0
,
2.0
,
20.0
);
Offset
offset5
=
paragraph
.
getOffsetForCaret
(
new
TextPosition
(
offset:
5
),
caret
);
Offset
offset5
=
paragraph
.
getOffsetForCaret
(
const
TextPosition
(
offset:
5
),
caret
);
expect
(
offset5
.
dx
,
greaterThan
(
0.0
));
Offset
offset25
=
paragraph
.
getOffsetForCaret
(
new
TextPosition
(
offset:
25
),
caret
);
Offset
offset25
=
paragraph
.
getOffsetForCaret
(
const
TextPosition
(
offset:
25
),
caret
);
expect
(
offset25
.
dx
,
greaterThan
(
offset5
.
dx
));
Offset
offset50
=
paragraph
.
getOffsetForCaret
(
new
TextPosition
(
offset:
50
),
caret
);
Offset
offset50
=
paragraph
.
getOffsetForCaret
(
const
TextPosition
(
offset:
50
),
caret
);
expect
(
offset50
.
dy
,
greaterThan
(
offset5
.
dy
));
});
test
(
'getPositionForOffset control test'
,
()
{
RenderParagraph
paragraph
=
new
RenderParagraph
(
new
TextSpan
(
text:
_kText
));
RenderParagraph
paragraph
=
new
RenderParagraph
(
const
TextSpan
(
text:
_kText
));
layout
(
paragraph
);
TextPosition
position20
=
paragraph
.
getPositionForOffset
(
new
Offset
(
20.0
,
5.0
));
TextPosition
position20
=
paragraph
.
getPositionForOffset
(
const
Offset
(
20.0
,
5.0
));
expect
(
position20
.
offset
,
greaterThan
(
0.0
));
TextPosition
position40
=
paragraph
.
getPositionForOffset
(
new
Offset
(
40.0
,
5.0
));
TextPosition
position40
=
paragraph
.
getPositionForOffset
(
const
Offset
(
40.0
,
5.0
));
expect
(
position40
.
offset
,
greaterThan
(
position20
.
offset
));
TextPosition
positionBelow
=
paragraph
.
getPositionForOffset
(
new
Offset
(
5.0
,
20.0
));
TextPosition
positionBelow
=
paragraph
.
getPositionForOffset
(
const
Offset
(
5.0
,
20.0
));
expect
(
positionBelow
.
offset
,
greaterThan
(
position40
.
offset
));
});
test
(
'getBoxesForSelection control test'
,
()
{
RenderParagraph
paragraph
=
new
RenderParagraph
(
new
TextSpan
(
text:
_kText
));
RenderParagraph
paragraph
=
new
RenderParagraph
(
const
TextSpan
(
text:
_kText
));
layout
(
paragraph
);
List
<
ui
.
TextBox
>
boxes
=
paragraph
.
getBoxesForSelection
(
new
TextSelection
(
baseOffset:
5
,
extentOffset:
25
)
const
TextSelection
(
baseOffset:
5
,
extentOffset:
25
)
);
expect
(
boxes
.
length
,
equals
(
1
));
boxes
=
paragraph
.
getBoxesForSelection
(
new
TextSelection
(
baseOffset:
25
,
extentOffset:
50
)
const
TextSelection
(
baseOffset:
25
,
extentOffset:
50
)
);
expect
(
boxes
.
length
,
equals
(
3
));
});
test
(
'getWordBoundary control test'
,
()
{
RenderParagraph
paragraph
=
new
RenderParagraph
(
new
TextSpan
(
text:
_kText
));
RenderParagraph
paragraph
=
new
RenderParagraph
(
const
TextSpan
(
text:
_kText
));
layout
(
paragraph
);
TextRange
range5
=
paragraph
.
getWordBoundary
(
new
TextPosition
(
offset:
5
));
TextRange
range5
=
paragraph
.
getWordBoundary
(
const
TextPosition
(
offset:
5
));
expect
(
range5
.
textInside
(
_kText
),
equals
(
'polished'
));
TextRange
range50
=
paragraph
.
getWordBoundary
(
new
TextPosition
(
offset:
50
));
TextRange
range50
=
paragraph
.
getWordBoundary
(
const
TextPosition
(
offset:
50
));
expect
(
range50
.
textInside
(
_kText
),
equals
(
' '
));
TextRange
range85
=
paragraph
.
getWordBoundary
(
new
TextPosition
(
offset:
75
));
TextRange
range85
=
paragraph
.
getWordBoundary
(
const
TextPosition
(
offset:
75
));
expect
(
range85
.
textInside
(
_kText
),
equals
(
'Queen
\'
s'
));
});
test
(
'overflow test'
,
()
{
RenderParagraph
paragraph
=
new
RenderParagraph
(
new
TextSpan
(
text:
'This is
\n
a wrapping test. It should wrap at manual newlines, and if softWrap is true, also at spaces.'
),
const
TextSpan
(
text:
'This is
\n
a wrapping test. It should wrap at manual newlines, and if softWrap is true, also at spaces.'
),
maxLines:
1
,
softWrap:
true
,
);
...
...
@@ -89,7 +89,7 @@ void main() {
}
// Lay out in a narrow box to force wrapping.
layout
(
paragraph
,
constraints:
new
BoxConstraints
(
maxWidth:
50.0
));
layout
(
paragraph
,
constraints:
const
BoxConstraints
(
maxWidth:
50.0
));
double
lineHeight
=
paragraph
.
size
.
height
;
relayoutWith
(
maxLines:
3
,
softWrap:
true
,
overflow:
TextOverflow
.
clip
);
...
...
packages/flutter/test/rendering/proxy_getters_and_setters_test.dart
View file @
d1d1c50c
...
...
@@ -8,10 +8,10 @@ import 'package:test/test.dart';
void
main
(
)
{
test
(
'RenderConstrainedBox getters and setters'
,
()
{
RenderConstrainedBox
box
=
new
RenderConstrainedBox
(
additionalConstraints:
new
BoxConstraints
.
tightFor
(
height:
10.0
));
expect
(
box
.
additionalConstraints
,
new
BoxConstraints
(
minHeight:
10.0
,
maxHeight:
10.0
));
box
.
additionalConstraints
=
new
BoxConstraints
.
tightFor
(
width:
10.0
);
expect
(
box
.
additionalConstraints
,
new
BoxConstraints
(
minWidth:
10.0
,
maxWidth:
10.0
));
RenderConstrainedBox
box
=
new
RenderConstrainedBox
(
additionalConstraints:
const
BoxConstraints
.
tightFor
(
height:
10.0
));
expect
(
box
.
additionalConstraints
,
const
BoxConstraints
(
minHeight:
10.0
,
maxHeight:
10.0
));
box
.
additionalConstraints
=
const
BoxConstraints
.
tightFor
(
width:
10.0
);
expect
(
box
.
additionalConstraints
,
const
BoxConstraints
(
minWidth:
10.0
,
maxWidth:
10.0
));
});
test
(
'RenderLimitedBox getters and setters'
,
()
{
...
...
packages/flutter/test/rendering/semantics_and_children_test.dart
View file @
d1d1c50c
...
...
@@ -16,7 +16,7 @@ int countSemanticsChildren(RenderObject object) {
void
main
(
)
{
test
(
'RenderOpacity and children and semantics'
,
()
{
RenderOpacity
box
=
new
RenderOpacity
(
child:
new
RenderParagraph
(
new
TextSpan
()));
RenderOpacity
box
=
new
RenderOpacity
(
child:
new
RenderParagraph
(
const
TextSpan
()));
expect
(
countSemanticsChildren
(
box
),
1
);
box
.
opacity
=
0.5
;
expect
(
countSemanticsChildren
(
box
),
1
);
...
...
packages/flutter/test/rendering/slivers_helpers_test.dart
View file @
d1d1c50c
...
...
@@ -17,7 +17,7 @@ void main() {
});
test
(
'SliverConstraints'
,
()
{
SliverConstraints
a
=
new
SliverConstraints
(
SliverConstraints
a
=
const
SliverConstraints
(
axisDirection:
AxisDirection
.
down
,
growthDirection:
GrowthDirection
.
forward
,
userScrollDirection:
ScrollDirection
.
idle
,
...
...
@@ -44,7 +44,7 @@ void main() {
crossAxisExtent:
40.0
,
viewportMainAxisExtent:
30.0
,
);
SliverConstraints
d
=
new
SliverConstraints
(
SliverConstraints
d
=
const
SliverConstraints
(
axisDirection:
AxisDirection
.
up
,
growthDirection:
GrowthDirection
.
reverse
,
userScrollDirection:
ScrollDirection
.
forward
,
...
...
@@ -69,12 +69,12 @@ void main() {
});
test
(
'SliverGeometry'
,
()
{
expect
(
new
SliverGeometry
().
debugAssertIsValid
,
isTrue
);
expect
(
const
SliverGeometry
().
debugAssertIsValid
,
isTrue
);
expect
(()
{
new
SliverGeometry
(
layoutExtent:
10.0
,
paintExtent:
9.0
).
debugAssertIsValid
;
const
SliverGeometry
(
layoutExtent:
10.0
,
paintExtent:
9.0
).
debugAssertIsValid
;
},
throwsFlutterError
);
expect
(()
{
new
SliverGeometry
(
paintExtent:
9.0
,
maxPaintExtent:
8.0
).
debugAssertIsValid
;
const
SliverGeometry
(
paintExtent:
9.0
,
maxPaintExtent:
8.0
).
debugAssertIsValid
;
},
throwsFlutterError
);
});
}
packages/flutter/test/services/system_chrome_test.dart
View file @
d1d1c50c
...
...
@@ -42,7 +42,7 @@ void main() {
});
await
SystemChrome
.
setApplicationSwitcherDescription
(
new
ApplicationSwitcherDescription
(
label:
'Example label'
,
primaryColor:
0xFF00FF00
)
const
ApplicationSwitcherDescription
(
label:
'Example label'
,
primaryColor:
0xFF00FF00
)
);
expect
(
log
,
equals
(<
String
>[
'{"method":"SystemChrome.setApplicationSwitcherDescription","args":[{"label":"Example label","primaryColor":4278255360}]}'
]));
...
...
packages/flutter/test/widgets/animated_size_test.dart
View file @
d1d1c50c
...
...
@@ -183,7 +183,7 @@ void main() {
child:
new
AnimatedSize
(
duration:
const
Duration
(
milliseconds:
200
),
vsync:
const
TestVSync
(),
child:
new
SizedBox
(
child:
const
SizedBox
(
width:
100.0
,
height:
100.0
,
),
...
...
@@ -196,7 +196,7 @@ void main() {
child:
new
AnimatedSize
(
duration:
const
Duration
(
milliseconds:
200
),
vsync:
tester
,
child:
new
SizedBox
(
child:
const
SizedBox
(
width:
200.0
,
height:
100.0
,
),
...
...
packages/flutter/test/widgets/flex_test.dart
View file @
d1d1c50c
...
...
@@ -52,7 +52,7 @@ void main() {
await
tester
.
pumpWidget
(
new
Row
(
children:
<
Widget
>[
new
Flexible
(
child:
new
SizedBox
(
width:
100.0
,
height:
200.0
)),
new
Flexible
(
child:
const
SizedBox
(
width:
100.0
,
height:
200.0
)),
],
),
);
...
...
packages/flutter/test/widgets/grid_view_test.dart
View file @
d1d1c50c
...
...
@@ -192,7 +192,7 @@ void main() {
await
tester
.
pumpWidget
(
new
GridView
(
gridDelegate:
new
SliverGridDelegateWithFixedCrossAxisCount
(
gridDelegate:
const
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
4
,
),
children:
new
List
<
Widget
>.
generate
(
40
,
(
int
i
)
{
...
...
@@ -219,7 +219,7 @@ void main() {
await
tester
.
pumpWidget
(
new
GridView
(
gridDelegate:
new
SliverGridDelegateWithFixedCrossAxisCount
(
gridDelegate:
const
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
,
),
children:
new
List
<
Widget
>.
generate
(
40
,
(
int
i
)
{
...
...
@@ -251,7 +251,7 @@ void main() {
await
tester
.
pumpWidget
(
new
GridView
(
gridDelegate:
new
SliverGridDelegateWithMaxCrossAxisExtent
(
gridDelegate:
const
SliverGridDelegateWithMaxCrossAxisExtent
(
maxCrossAxisExtent:
200.0
,
),
children:
new
List
<
Widget
>.
generate
(
40
,
(
int
i
)
{
...
...
@@ -278,7 +278,7 @@ void main() {
await
tester
.
pumpWidget
(
new
GridView
(
gridDelegate:
new
SliverGridDelegateWithMaxCrossAxisExtent
(
gridDelegate:
const
SliverGridDelegateWithMaxCrossAxisExtent
(
maxCrossAxisExtent:
400.0
,
),
children:
new
List
<
Widget
>.
generate
(
40
,
(
int
i
)
{
...
...
packages/flutter/test/widgets/key_test.dart
View file @
d1d1c50c
...
...
@@ -19,18 +19,18 @@ class NotEquals {
void
main
(
)
{
testWidgets
(
'Keys'
,
(
WidgetTester
tester
)
async
{
expect
(
new
ValueKey
<
int
>(
3
)
==
new
ValueKey
<
int
>(
3
),
isTrue
);
expect
(
new
ValueKey
<
num
>(
3
)
==
new
ValueKey
<
int
>(
3
),
isFalse
);
expect
(
new
ValueKey
<
int
>(
3
)
==
new
ValueKey
<
int
>(
2
),
isFalse
);
expect
(
new
ValueKey
<
int
>(
3
)
==
new
ValueKey
<
int
>(
3
),
isTrue
);
// ignore: prefer_const_constructors
expect
(
new
ValueKey
<
num
>(
3
)
==
new
ValueKey
<
int
>(
3
),
isFalse
);
// ignore: prefer_const_constructors
expect
(
new
ValueKey
<
int
>(
3
)
==
new
ValueKey
<
int
>(
2
),
isFalse
);
// ignore: prefer_const_constructors
expect
(
const
ValueKey
<
double
>(
double
.
NAN
)
==
const
ValueKey
<
double
>(
double
.
NAN
),
isFalse
);
expect
(
new
Key
(
''
)
==
new
ValueKey
<
String
>(
''
),
isTrue
);
expect
(
new
ValueKey
<
String
>(
''
)
==
new
ValueKey
<
String
>(
''
),
isTrue
);
expect
(
new
TestValueKey
<
String
>(
''
)
==
new
ValueKey
<
String
>(
''
),
isFalse
);
expect
(
new
TestValueKey
<
String
>(
''
)
==
new
TestValueKey
<
String
>(
''
),
isTrue
);
expect
(
new
Key
(
''
)
==
new
ValueKey
<
String
>(
''
),
isTrue
);
// ignore: prefer_const_constructors
expect
(
new
ValueKey
<
String
>(
''
)
==
new
ValueKey
<
String
>(
''
),
isTrue
);
// ignore: prefer_const_constructors
expect
(
new
TestValueKey
<
String
>(
''
)
==
new
ValueKey
<
String
>(
''
),
isFalse
);
// ignore: prefer_const_constructors
expect
(
new
TestValueKey
<
String
>(
''
)
==
new
TestValueKey
<
String
>(
''
),
isTrue
);
// ignore: prefer_const_constructors
expect
(
new
ValueKey
<
String
>(
''
)
==
new
ValueKey
<
dynamic
>(
''
),
isFalse
);
expect
(
new
TestValueKey
<
String
>(
''
)
==
new
TestValueKey
<
dynamic
>(
''
),
isFalse
);
expect
(
new
ValueKey
<
String
>(
''
)
==
new
ValueKey
<
dynamic
>(
''
),
isFalse
);
// ignore: prefer_const_constructors
expect
(
new
TestValueKey
<
String
>(
''
)
==
new
TestValueKey
<
dynamic
>(
''
),
isFalse
);
// ignore: prefer_const_constructors
expect
(
new
UniqueKey
()
==
new
UniqueKey
(),
isFalse
);
LocalKey
k
=
new
UniqueKey
();
...
...
@@ -41,10 +41,10 @@ void main() {
expect
(
new
ValueKey
<
LocalKey
>(
k
)
==
new
ValueKey
<
UniqueKey
>(
k
),
isFalse
);
expect
(
new
ObjectKey
(
k
)
==
new
ObjectKey
(
k
),
isTrue
);
expect
(
new
ValueKey
<
NotEquals
>(
const
NotEquals
())
==
new
ValueKey
<
NotEquals
>(
const
NotEquals
()),
isFalse
);
expect
(
new
ObjectKey
(
const
NotEquals
())
==
new
ObjectKey
(
const
NotEquals
()),
isTrue
);
expect
(
new
ValueKey
<
NotEquals
>(
const
NotEquals
())
==
new
ValueKey
<
NotEquals
>(
const
NotEquals
()),
isFalse
);
// ignore: prefer_const_constructors
expect
(
new
ObjectKey
(
const
NotEquals
())
==
new
ObjectKey
(
const
NotEquals
()),
isTrue
);
// ignore: prefer_const_constructors
expect
(
new
ObjectKey
(
const
Object
())
==
new
ObjectKey
(
const
Object
()),
isTrue
);
expect
(
new
ObjectKey
(
const
Object
())
==
new
ObjectKey
(
const
Object
()),
isTrue
);
// ignore: prefer_const_constructors
expect
(
new
ObjectKey
(
new
Object
())
==
new
ObjectKey
(
new
Object
()),
isFalse
);
expect
(
new
ValueKey
<
bool
>(
true
),
hasOneLineDescription
);
...
...
packages/flutter/test/widgets/notification_test.dart
View file @
d1d1c50c
...
...
@@ -66,6 +66,6 @@ void main() {
onNotification:
(
MyNotification
value
)
{
},
child:
new
Container
(
key:
key
),
));
expect
(()
{
new
MyNotification
().
dispatch
(
key
.
currentContext
);
},
throwsA
(
new
isInstanceOf
<
AssertionError
>()));
expect
(()
{
new
MyNotification
().
dispatch
(
key
.
currentContext
);
},
throwsA
(
const
isInstanceOf
<
AssertionError
>()));
});
}
packages/flutter/test/widgets/overscroll_indicator_test.dart
View file @
d1d1c50c
...
...
@@ -26,7 +26,7 @@ void main() {
await
tester
.
pumpWidget
(
new
CustomScrollView
(
slivers:
<
Widget
>[
new
SliverToBoxAdapter
(
child:
new
SizedBox
(
height:
2000.0
)),
new
SliverToBoxAdapter
(
child:
const
SizedBox
(
height:
2000.0
)),
],
),
);
...
...
@@ -59,7 +59,7 @@ void main() {
await
tester
.
pumpWidget
(
new
CustomScrollView
(
slivers:
<
Widget
>[
new
SliverToBoxAdapter
(
child:
new
SizedBox
(
height:
2000.0
)),
new
SliverToBoxAdapter
(
child:
const
SizedBox
(
height:
2000.0
)),
],
),
);
...
...
@@ -94,7 +94,7 @@ void main() {
await
tester
.
pumpWidget
(
new
CustomScrollView
(
slivers:
<
Widget
>[
new
SliverToBoxAdapter
(
child:
new
SizedBox
(
height:
2000.0
)),
new
SliverToBoxAdapter
(
child:
const
SizedBox
(
height:
2000.0
)),
],
),
);
...
...
@@ -127,7 +127,7 @@ void main() {
await
tester
.
pumpWidget
(
new
CustomScrollView
(
slivers:
<
Widget
>[
new
SliverToBoxAdapter
(
child:
new
SizedBox
(
height:
20.0
)),
new
SliverToBoxAdapter
(
child:
const
SizedBox
(
height:
20.0
)),
],
),
);
...
...
@@ -144,7 +144,7 @@ void main() {
new
CustomScrollView
(
reverse:
true
,
slivers:
<
Widget
>[
new
SliverToBoxAdapter
(
child:
new
SizedBox
(
height:
20.0
)),
new
SliverToBoxAdapter
(
child:
const
SizedBox
(
height:
20.0
)),
],
),
);
...
...
@@ -161,7 +161,7 @@ void main() {
await
tester
.
pumpWidget
(
new
CustomScrollView
(
slivers:
<
Widget
>[
new
SliverToBoxAdapter
(
child:
new
SizedBox
(
height:
20.0
)),
new
SliverToBoxAdapter
(
child:
const
SizedBox
(
height:
20.0
)),
],
),
);
...
...
@@ -181,7 +181,7 @@ void main() {
new
CustomScrollView
(
scrollDirection:
Axis
.
horizontal
,
slivers:
<
Widget
>[
new
SliverToBoxAdapter
(
child:
new
SizedBox
(
height:
20.0
)),
new
SliverToBoxAdapter
(
child:
const
SizedBox
(
height:
20.0
)),
],
),
);
...
...
@@ -230,7 +230,7 @@ void main() {
scrollDirection:
Axis
.
horizontal
,
reverse:
true
,
slivers:
<
Widget
>[
new
SliverToBoxAdapter
(
child:
new
SizedBox
(
height:
20.0
)),
new
SliverToBoxAdapter
(
child:
const
SizedBox
(
height:
20.0
)),
],
),
),
...
...
@@ -247,7 +247,7 @@ void main() {
child:
new
CustomScrollView
(
scrollDirection:
Axis
.
horizontal
,
slivers:
<
Widget
>[
new
SliverToBoxAdapter
(
child:
new
SizedBox
(
height:
20.0
)),
new
SliverToBoxAdapter
(
child:
const
SizedBox
(
height:
20.0
)),
],
),
),
...
...
packages/flutter/test/widgets/render_object_widget_test.dart
View file @
d1d1c50c
...
...
@@ -6,9 +6,9 @@ import 'package:flutter_test/flutter_test.dart';
import
'package:flutter/rendering.dart'
;
import
'package:flutter/widgets.dart'
;
final
BoxDecoration
kBoxDecorationA
=
new
BoxDecoration
();
// ignore: prefer_const_constructor
final
BoxDecoration
kBoxDecorationB
=
new
BoxDecoration
();
// ignore: prefer_const_constructor
final
BoxDecoration
kBoxDecorationC
=
new
BoxDecoration
();
// ignore: prefer_const_constructor
final
BoxDecoration
kBoxDecorationA
=
new
BoxDecoration
();
// ignore: prefer_const_constructor
s
final
BoxDecoration
kBoxDecorationB
=
new
BoxDecoration
();
// ignore: prefer_const_constructor
s
final
BoxDecoration
kBoxDecorationC
=
new
BoxDecoration
();
// ignore: prefer_const_constructor
s
class
TestWidget
extends
StatelessWidget
{
const
TestWidget
({
this
.
child
});
...
...
packages/flutter/test/widgets/scrollable_custom_scroll_behavior_test.dart
View file @
d1d1c50c
...
...
@@ -121,7 +121,7 @@ void main() {
child:
new
CustomScrollView
(
controller:
new
TestScrollController
(),
slivers:
<
Widget
>[
new
SliverToBoxAdapter
(
child:
new
SizedBox
(
height:
2000.0
)),
new
SliverToBoxAdapter
(
child:
const
SizedBox
(
height:
2000.0
)),
],
),
));
...
...
@@ -133,7 +133,7 @@ void main() {
child:
new
CustomScrollView
(
controller:
new
TestScrollController
(),
slivers:
<
Widget
>[
new
SliverToBoxAdapter
(
child:
new
SizedBox
(
height:
2000.0
)),
new
SliverToBoxAdapter
(
child:
const
SizedBox
(
height:
2000.0
)),
],
),
));
...
...
packages/flutter/test/widgets/scrollable_test.dart
View file @
d1d1c50c
...
...
@@ -13,7 +13,7 @@ Future<Null> pumpTest(WidgetTester tester, TargetPlatform platform) async {
),
home:
new
CustomScrollView
(
slivers:
<
Widget
>[
new
SliverToBoxAdapter
(
child:
new
SizedBox
(
height:
2000.0
)),
new
SliverToBoxAdapter
(
child:
const
SizedBox
(
height:
2000.0
)),
],
),
));
...
...
packages/flutter/test/widgets/size_changed_layout_notification_test.dart
View file @
d1d1c50c
...
...
@@ -37,7 +37,7 @@ void main() {
new
Center
(
child:
new
NotificationListener
<
LayoutChangedNotification
>(
onNotification:
(
LayoutChangedNotification
notification
)
{
expect
(
notification
,
new
isInstanceOf
<
SizeChangedLayoutNotification
>());
expect
(
notification
,
const
isInstanceOf
<
SizeChangedLayoutNotification
>());
notified
=
true
;
return
true
;
},
...
...
packages/flutter/test/widgets/slivers_appbar_floating_test.dart
View file @
d1d1c50c
...
...
@@ -8,7 +8,7 @@ import 'package:flutter/widgets.dart';
void
verifyPaintPosition
(
GlobalKey
key
,
Offset
ideal
,
bool
visible
)
{
RenderSliver
target
=
key
.
currentContext
.
findRenderObject
();
expect
(
target
.
parent
,
new
isInstanceOf
<
RenderViewport2
>());
expect
(
target
.
parent
,
const
isInstanceOf
<
RenderViewport2
>());
SliverPhysicalParentData
parentData
=
target
.
parentData
;
Offset
actual
=
parentData
.
paintOffset
;
expect
(
actual
,
ideal
);
...
...
@@ -63,58 +63,58 @@ void main() {
);
ScrollPosition
position
=
tester
.
state
<
Scrollable2State
>(
find
.
byType
(
Scrollable2
)).
position
;
verifyPaintPosition
(
key1
,
new
Offset
(
0.0
,
0.0
),
true
);
verifyPaintPosition
(
key2
,
new
Offset
(
0.0
,
600.0
),
false
);
verifyPaintPosition
(
key3
,
new
Offset
(
0.0
,
600.0
),
false
);
verifyPaintPosition
(
key1
,
const
Offset
(
0.0
,
0.0
),
true
);
verifyPaintPosition
(
key2
,
const
Offset
(
0.0
,
600.0
),
false
);
verifyPaintPosition
(
key3
,
const
Offset
(
0.0
,
600.0
),
false
);
position
.
animateTo
(
bigHeight
-
600.0
+
delegate
.
maxExtent
,
curve:
Curves
.
linear
,
duration:
const
Duration
(
minutes:
1
));
await
tester
.
pumpUntilNoTransientCallbacks
(
const
Duration
(
milliseconds:
1000
));
verifyPaintPosition
(
key1
,
new
Offset
(
0.0
,
0.0
),
true
);
verifyPaintPosition
(
key1
,
const
Offset
(
0.0
,
0.0
),
true
);
verifyPaintPosition
(
key2
,
new
Offset
(
0.0
,
600.0
-
delegate
.
maxExtent
),
true
);
verifyActualBoxPosition
(
tester
,
find
.
byType
(
Container
),
0
,
new
Rect
.
fromLTWH
(
0.0
,
600.0
-
delegate
.
maxExtent
,
800.0
,
delegate
.
maxExtent
));
verifyPaintPosition
(
key3
,
new
Offset
(
0.0
,
600.0
),
false
);
verifyPaintPosition
(
key3
,
const
Offset
(
0.0
,
600.0
),
false
);
assert
(
delegate
.
maxExtent
*
2.0
<
600.0
);
// make sure this fits on the test screen...
position
.
animateTo
(
bigHeight
-
600.0
+
delegate
.
maxExtent
*
2.0
,
curve:
Curves
.
linear
,
duration:
const
Duration
(
minutes:
1
));
await
tester
.
pumpUntilNoTransientCallbacks
(
const
Duration
(
milliseconds:
1000
));
verifyPaintPosition
(
key1
,
new
Offset
(
0.0
,
0.0
),
true
);
verifyPaintPosition
(
key1
,
const
Offset
(
0.0
,
0.0
),
true
);
verifyPaintPosition
(
key2
,
new
Offset
(
0.0
,
600.0
-
delegate
.
maxExtent
*
2.0
),
true
);
verifyActualBoxPosition
(
tester
,
find
.
byType
(
Container
),
0
,
new
Rect
.
fromLTWH
(
0.0
,
600.0
-
delegate
.
maxExtent
*
2.0
,
800.0
,
delegate
.
maxExtent
));
verifyPaintPosition
(
key3
,
new
Offset
(
0.0
,
600.0
-
delegate
.
maxExtent
),
true
);
position
.
animateTo
(
bigHeight
,
curve:
Curves
.
linear
,
duration:
const
Duration
(
minutes:
1
));
await
tester
.
pumpUntilNoTransientCallbacks
(
const
Duration
(
milliseconds:
1000
));
verifyPaintPosition
(
key1
,
new
Offset
(
0.0
,
0.0
),
false
);
verifyPaintPosition
(
key2
,
new
Offset
(
0.0
,
0.0
),
true
);
verifyPaintPosition
(
key1
,
const
Offset
(
0.0
,
0.0
),
false
);
verifyPaintPosition
(
key2
,
const
Offset
(
0.0
,
0.0
),
true
);
verifyActualBoxPosition
(
tester
,
find
.
byType
(
Container
),
0
,
new
Rect
.
fromLTWH
(
0.0
,
0.0
,
800.0
,
delegate
.
maxExtent
));
verifyPaintPosition
(
key3
,
new
Offset
(
0.0
,
delegate
.
maxExtent
),
true
);
position
.
animateTo
(
bigHeight
+
delegate
.
maxExtent
*
0.1
,
curve:
Curves
.
linear
,
duration:
const
Duration
(
minutes:
1
));
await
tester
.
pumpUntilNoTransientCallbacks
(
const
Duration
(
milliseconds:
1000
));
verifyPaintPosition
(
key1
,
new
Offset
(
0.0
,
0.0
),
false
);
verifyPaintPosition
(
key2
,
new
Offset
(
0.0
,
0.0
),
true
);
verifyPaintPosition
(
key1
,
const
Offset
(
0.0
,
0.0
),
false
);
verifyPaintPosition
(
key2
,
const
Offset
(
0.0
,
0.0
),
true
);
verifyActualBoxPosition
(
tester
,
find
.
byType
(
Container
),
0
,
new
Rect
.
fromLTWH
(
0.0
,
0.0
,
800.0
,
delegate
.
maxExtent
*
0.9
));
verifyPaintPosition
(
key3
,
new
Offset
(
0.0
,
delegate
.
maxExtent
*
0.9
),
true
);
position
.
animateTo
(
bigHeight
+
delegate
.
maxExtent
*
0.5
,
curve:
Curves
.
linear
,
duration:
const
Duration
(
minutes:
1
));
await
tester
.
pumpUntilNoTransientCallbacks
(
const
Duration
(
milliseconds:
1000
));
verifyPaintPosition
(
key1
,
new
Offset
(
0.0
,
0.0
),
false
);
verifyPaintPosition
(
key2
,
new
Offset
(
0.0
,
0.0
),
true
);
verifyPaintPosition
(
key1
,
const
Offset
(
0.0
,
0.0
),
false
);
verifyPaintPosition
(
key2
,
const
Offset
(
0.0
,
0.0
),
true
);
verifyActualBoxPosition
(
tester
,
find
.
byType
(
Container
),
0
,
new
Rect
.
fromLTWH
(
0.0
,
0.0
,
800.0
,
delegate
.
maxExtent
*
0.5
));
verifyPaintPosition
(
key3
,
new
Offset
(
0.0
,
delegate
.
maxExtent
*
0.5
),
true
);
position
.
animateTo
(
bigHeight
+
delegate
.
maxExtent
*
0.9
,
curve:
Curves
.
linear
,
duration:
const
Duration
(
minutes:
1
));
await
tester
.
pumpUntilNoTransientCallbacks
(
const
Duration
(
milliseconds:
1000
));
verifyPaintPosition
(
key1
,
new
Offset
(
0.0
,
0.0
),
false
);
verifyPaintPosition
(
key2
,
new
Offset
(
0.0
,
0.0
),
true
);
verifyPaintPosition
(
key1
,
const
Offset
(
0.0
,
0.0
),
false
);
verifyPaintPosition
(
key2
,
const
Offset
(
0.0
,
0.0
),
true
);
verifyActualBoxPosition
(
tester
,
find
.
byType
(
Container
),
0
,
new
Rect
.
fromLTWH
(
0.0
,
-
delegate
.
maxExtent
*
0.4
,
800.0
,
delegate
.
maxExtent
*
0.5
));
verifyPaintPosition
(
key3
,
new
Offset
(
0.0
,
delegate
.
maxExtent
*
0.1
),
true
);
position
.
animateTo
(
bigHeight
+
delegate
.
maxExtent
*
2.0
,
curve:
Curves
.
linear
,
duration:
const
Duration
(
minutes:
1
));
await
tester
.
pumpUntilNoTransientCallbacks
(
const
Duration
(
milliseconds:
1000
));
verifyPaintPosition
(
key1
,
new
Offset
(
0.0
,
0.0
),
false
);
verifyPaintPosition
(
key2
,
new
Offset
(
0.0
,
0.0
),
false
);
verifyPaintPosition
(
key3
,
new
Offset
(
0.0
,
0.0
),
true
);
verifyPaintPosition
(
key1
,
const
Offset
(
0.0
,
0.0
),
false
);
verifyPaintPosition
(
key2
,
const
Offset
(
0.0
,
0.0
),
false
);
verifyPaintPosition
(
key3
,
const
Offset
(
0.0
,
0.0
),
true
);
});
testWidgets
(
'Sliver appbars - floating - no floating behavior when animating'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -132,21 +132,21 @@ void main() {
);
ScrollPosition
position
=
tester
.
state
<
Scrollable2State
>(
find
.
byType
(
Scrollable2
)).
position
;
verifyPaintPosition
(
key1
,
new
Offset
(
0.0
,
0.0
),
true
);
verifyPaintPosition
(
key2
,
new
Offset
(
0.0
,
600.0
),
false
);
verifyPaintPosition
(
key3
,
new
Offset
(
0.0
,
600.0
),
false
);
verifyPaintPosition
(
key1
,
const
Offset
(
0.0
,
0.0
),
true
);
verifyPaintPosition
(
key2
,
const
Offset
(
0.0
,
600.0
),
false
);
verifyPaintPosition
(
key3
,
const
Offset
(
0.0
,
600.0
),
false
);
position
.
animateTo
(
bigHeight
+
delegate
.
maxExtent
*
2.0
,
curve:
Curves
.
linear
,
duration:
const
Duration
(
minutes:
1
));
await
tester
.
pumpUntilNoTransientCallbacks
(
const
Duration
(
milliseconds:
1000
));
verifyPaintPosition
(
key1
,
new
Offset
(
0.0
,
0.0
),
false
);
verifyPaintPosition
(
key2
,
new
Offset
(
0.0
,
0.0
),
false
);
verifyPaintPosition
(
key3
,
new
Offset
(
0.0
,
0.0
),
true
);
verifyPaintPosition
(
key1
,
const
Offset
(
0.0
,
0.0
),
false
);
verifyPaintPosition
(
key2
,
const
Offset
(
0.0
,
0.0
),
false
);
verifyPaintPosition
(
key3
,
const
Offset
(
0.0
,
0.0
),
true
);
position
.
animateTo
(
bigHeight
+
delegate
.
maxExtent
*
1.9
,
curve:
Curves
.
linear
,
duration:
const
Duration
(
minutes:
1
));
await
tester
.
pumpUntilNoTransientCallbacks
(
const
Duration
(
milliseconds:
1000
));
verifyPaintPosition
(
key1
,
new
Offset
(
0.0
,
0.0
),
false
);
verifyPaintPosition
(
key2
,
new
Offset
(
0.0
,
0.0
),
false
);
verifyPaintPosition
(
key3
,
new
Offset
(
0.0
,
0.0
),
true
);
verifyPaintPosition
(
key1
,
const
Offset
(
0.0
,
0.0
),
false
);
verifyPaintPosition
(
key2
,
const
Offset
(
0.0
,
0.0
),
false
);
verifyPaintPosition
(
key3
,
const
Offset
(
0.0
,
0.0
),
true
);
});
testWidgets
(
'Sliver appbars - floating - floating behavior when dragging down'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -164,23 +164,23 @@ void main() {
);
ScrollPosition
position
=
tester
.
state
<
Scrollable2State
>(
find
.
byType
(
Scrollable2
)).
position
;
verifyPaintPosition
(
key1
,
new
Offset
(
0.0
,
0.0
),
true
);
verifyPaintPosition
(
key2
,
new
Offset
(
0.0
,
600.0
),
false
);
verifyPaintPosition
(
key3
,
new
Offset
(
0.0
,
600.0
),
false
);
verifyPaintPosition
(
key1
,
const
Offset
(
0.0
,
0.0
),
true
);
verifyPaintPosition
(
key2
,
const
Offset
(
0.0
,
600.0
),
false
);
verifyPaintPosition
(
key3
,
const
Offset
(
0.0
,
600.0
),
false
);
position
.
animateTo
(
bigHeight
+
delegate
.
maxExtent
*
2.0
,
curve:
Curves
.
linear
,
duration:
const
Duration
(
minutes:
1
));
await
tester
.
pumpUntilNoTransientCallbacks
(
const
Duration
(
milliseconds:
1000
));
verifyPaintPosition
(
key1
,
new
Offset
(
0.0
,
0.0
),
false
);
verifyPaintPosition
(
key2
,
new
Offset
(
0.0
,
0.0
),
false
);
verifyPaintPosition
(
key3
,
new
Offset
(
0.0
,
0.0
),
true
);
verifyPaintPosition
(
key1
,
const
Offset
(
0.0
,
0.0
),
false
);
verifyPaintPosition
(
key2
,
const
Offset
(
0.0
,
0.0
),
false
);
verifyPaintPosition
(
key3
,
const
Offset
(
0.0
,
0.0
),
true
);
position
.
animateTo
(
bigHeight
+
delegate
.
maxExtent
*
1.9
,
curve:
Curves
.
linear
,
duration:
const
Duration
(
minutes:
1
));
position
.
updateUserScrollDirection
(
ScrollDirection
.
forward
);
// ignore: INVALID_USE_OF_PROTECTED_MEMBER, since this is using a protected method for testing purposes
await
tester
.
pumpUntilNoTransientCallbacks
(
const
Duration
(
milliseconds:
1000
));
verifyPaintPosition
(
key1
,
new
Offset
(
0.0
,
0.0
),
false
);
verifyPaintPosition
(
key2
,
new
Offset
(
0.0
,
0.0
),
true
);
verifyPaintPosition
(
key1
,
const
Offset
(
0.0
,
0.0
),
false
);
verifyPaintPosition
(
key2
,
const
Offset
(
0.0
,
0.0
),
true
);
verifyActualBoxPosition
(
tester
,
find
.
byType
(
Container
),
0
,
new
Rect
.
fromLTWH
(
0.0
,
-
delegate
.
maxExtent
*
0.4
,
800.0
,
delegate
.
maxExtent
*
0.5
));
verifyPaintPosition
(
key3
,
new
Offset
(
0.0
,
0.0
),
true
);
verifyPaintPosition
(
key3
,
const
Offset
(
0.0
,
0.0
),
true
);
});
}
...
...
packages/flutter/test/widgets/slivers_appbar_pinned_test.dart
View file @
d1d1c50c
This diff is collapsed.
Click to expand it.
packages/flutter/test/widgets/slivers_appbar_scrolling_test.dart
View file @
d1d1c50c
...
...
@@ -8,7 +8,7 @@ import 'package:flutter/widgets.dart';
void
verifyPaintPosition
(
GlobalKey
key
,
Offset
ideal
)
{
RenderObject
target
=
key
.
currentContext
.
findRenderObject
();
expect
(
target
.
parent
,
new
isInstanceOf
<
RenderViewport2
>());
expect
(
target
.
parent
,
const
isInstanceOf
<
RenderViewport2
>());
SliverPhysicalParentData
parentData
=
target
.
parentData
;
Offset
actual
=
parentData
.
paintOffset
;
expect
(
actual
,
ideal
);
...
...
@@ -40,11 +40,11 @@ void main() {
expect
(
position
.
pixels
,
max
);
expect
(
position
.
minScrollExtent
,
0.0
);
expect
(
position
.
maxScrollExtent
,
max
);
verifyPaintPosition
(
key1
,
new
Offset
(
0.0
,
0.0
));
verifyPaintPosition
(
key2
,
new
Offset
(
0.0
,
0.0
));
verifyPaintPosition
(
key3
,
new
Offset
(
0.0
,
0.0
));
verifyPaintPosition
(
key4
,
new
Offset
(
0.0
,
0.0
));
verifyPaintPosition
(
key5
,
new
Offset
(
0.0
,
50.0
));
verifyPaintPosition
(
key1
,
const
Offset
(
0.0
,
0.0
));
verifyPaintPosition
(
key2
,
const
Offset
(
0.0
,
0.0
));
verifyPaintPosition
(
key3
,
const
Offset
(
0.0
,
0.0
));
verifyPaintPosition
(
key4
,
const
Offset
(
0.0
,
0.0
));
verifyPaintPosition
(
key5
,
const
Offset
(
0.0
,
50.0
));
});
testWidgets
(
'Sliver appbars - scrolling off screen'
,
(
WidgetTester
tester
)
async
{
...
...
packages/flutter/test/widgets/slivers_evil_test.dart
View file @
d1d1c50c
...
...
@@ -50,7 +50,7 @@ class TestScrollPhysics extends ClampingScrollPhysics {
TestScrollPhysics
applyTo
(
ScrollPhysics
parent
)
=>
new
TestScrollPhysics
(
parent:
parent
);
@override
Tolerance
get
tolerance
=>
new
Tolerance
(
velocity:
20.0
,
distance:
1.0
);
Tolerance
get
tolerance
=>
const
Tolerance
(
velocity:
20.0
,
distance:
1.0
);
}
class
TestViewportScrollPosition
extends
ScrollPosition
{
...
...
@@ -92,7 +92,7 @@ void main() {
new
SliverPersistentHeader
(
delegate:
new
TestSliverPersistentHeaderDelegate
(
150.0
),
pinned:
true
),
new
SliverToBoxAdapter
(
child:
new
Container
(
height:
520.0
)),
new
SliverPadding
(
padding:
new
EdgeInsets
.
all
(
50.0
),
padding:
const
EdgeInsets
.
all
(
50.0
),
child:
new
SliverToBoxAdapter
(
child:
new
Container
(
height:
520.0
)),
),
new
SliverToBoxAdapter
(
child:
new
Container
(
height:
520.0
)),
...
...
@@ -104,7 +104,7 @@ void main() {
new
SliverToBoxAdapter
(
child:
new
Container
(
height:
520.0
)),
new
SliverToBoxAdapter
(
child:
new
Container
(
height:
520.0
)),
new
SliverPadding
(
padding:
new
EdgeInsets
.
all
(
50.0
),
padding:
const
EdgeInsets
.
all
(
50.0
),
child:
new
SliverPersistentHeader
(
delegate:
new
TestSliverPersistentHeaderDelegate
(
250.0
),
pinned:
true
),
),
new
SliverToBoxAdapter
(
child:
new
Container
(
height:
520.0
)),
...
...
@@ -145,7 +145,7 @@ void main() {
new
SliverPersistentHeader
(
delegate:
new
TestSliverPersistentHeaderDelegate
(
250.0
)),
new
SliverPersistentHeader
(
delegate:
new
TestSliverPersistentHeaderDelegate
(
250.0
)),
new
SliverPadding
(
padding:
new
EdgeInsets
.
symmetric
(
horizontal:
50.0
),
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
50.0
),
child:
new
SliverToBoxAdapter
(
child:
new
Container
(
height:
520.0
)),
),
new
SliverToBoxAdapter
(
child:
new
Container
(
height:
520.0
)),
...
...
packages/flutter/test/widgets/slivers_padding_test.dart
View file @
d1d1c50c
...
...
@@ -85,11 +85,11 @@ void main() {
result
=
tester
.
hitTestOnBinding
(
const
Point
(
10.0
,
10.0
));
expect
(
result
.
path
.
first
.
target
,
tester
.
firstRenderObject
<
RenderObject
>(
find
.
byType
(
Text
)));
result
=
tester
.
hitTestOnBinding
(
const
Point
(
10.0
,
60.0
));
expect
(
result
.
path
.
first
.
target
,
new
isInstanceOf
<
RenderView
>());
expect
(
result
.
path
.
first
.
target
,
const
isInstanceOf
<
RenderView
>());
result
=
tester
.
hitTestOnBinding
(
const
Point
(
100.0
,
100.0
));
expect
(
result
.
path
.
first
.
target
,
tester
.
renderObjectList
<
RenderObject
>(
find
.
byType
(
Text
)).
skip
(
1
).
first
);
result
=
tester
.
hitTestOnBinding
(
const
Point
(
100.0
,
490.0
));
expect
(
result
.
path
.
first
.
target
,
new
isInstanceOf
<
RenderView
>());
expect
(
result
.
path
.
first
.
target
,
const
isInstanceOf
<
RenderView
>());
result
=
tester
.
hitTestOnBinding
(
const
Point
(
10.0
,
520.0
));
expect
(
result
.
path
.
first
.
target
,
tester
.
renderObjectList
<
RenderObject
>(
find
.
byType
(
Text
)).
last
);
});
...
...
@@ -107,11 +107,11 @@ void main() {
result
=
tester
.
hitTestOnBinding
(
const
Point
(
10.0
,
600.0
-
10.0
));
expect
(
result
.
path
.
first
.
target
,
tester
.
firstRenderObject
<
RenderObject
>(
find
.
byType
(
Text
)));
result
=
tester
.
hitTestOnBinding
(
const
Point
(
10.0
,
600.0
-
60.0
));
expect
(
result
.
path
.
first
.
target
,
new
isInstanceOf
<
RenderView
>());
expect
(
result
.
path
.
first
.
target
,
const
isInstanceOf
<
RenderView
>());
result
=
tester
.
hitTestOnBinding
(
const
Point
(
100.0
,
600.0
-
100.0
));
expect
(
result
.
path
.
first
.
target
,
tester
.
renderObjectList
<
RenderObject
>(
find
.
byType
(
Text
)).
skip
(
1
).
first
);
result
=
tester
.
hitTestOnBinding
(
const
Point
(
100.0
,
600.0
-
490.0
));
expect
(
result
.
path
.
first
.
target
,
new
isInstanceOf
<
RenderView
>());
expect
(
result
.
path
.
first
.
target
,
const
isInstanceOf
<
RenderView
>());
result
=
tester
.
hitTestOnBinding
(
const
Point
(
10.0
,
600.0
-
520.0
));
expect
(
result
.
path
.
first
.
target
,
tester
.
renderObjectList
<
RenderObject
>(
find
.
byType
(
Text
)).
last
);
});
...
...
@@ -129,11 +129,11 @@ void main() {
result
=
tester
.
hitTestOnBinding
(
const
Point
(
800.0
-
10.0
,
10.0
));
expect
(
result
.
path
.
first
.
target
,
tester
.
firstRenderObject
<
RenderObject
>(
find
.
byType
(
Text
)));
result
=
tester
.
hitTestOnBinding
(
const
Point
(
800.0
-
60.0
,
10.0
));
expect
(
result
.
path
.
first
.
target
,
new
isInstanceOf
<
RenderView
>());
expect
(
result
.
path
.
first
.
target
,
const
isInstanceOf
<
RenderView
>());
result
=
tester
.
hitTestOnBinding
(
const
Point
(
800.0
-
100.0
,
100.0
));
expect
(
result
.
path
.
first
.
target
,
tester
.
renderObjectList
<
RenderObject
>(
find
.
byType
(
Text
)).
skip
(
1
).
first
);
result
=
tester
.
hitTestOnBinding
(
const
Point
(
800.0
-
490.0
,
100.0
));
expect
(
result
.
path
.
first
.
target
,
new
isInstanceOf
<
RenderView
>());
expect
(
result
.
path
.
first
.
target
,
const
isInstanceOf
<
RenderView
>());
result
=
tester
.
hitTestOnBinding
(
const
Point
(
800.0
-
520.0
,
10.0
));
expect
(
result
.
path
.
first
.
target
,
tester
.
renderObjectList
<
RenderObject
>(
find
.
byType
(
Text
)).
last
);
});
...
...
@@ -151,11 +151,11 @@ void main() {
result
=
tester
.
hitTestOnBinding
(
const
Point
(
10.0
,
10.0
));
expect
(
result
.
path
.
first
.
target
,
tester
.
firstRenderObject
<
RenderObject
>(
find
.
byType
(
Text
)));
result
=
tester
.
hitTestOnBinding
(
const
Point
(
60.0
,
10.0
));
expect
(
result
.
path
.
first
.
target
,
new
isInstanceOf
<
RenderView
>());
expect
(
result
.
path
.
first
.
target
,
const
isInstanceOf
<
RenderView
>());
result
=
tester
.
hitTestOnBinding
(
const
Point
(
100.0
,
100.0
));
expect
(
result
.
path
.
first
.
target
,
tester
.
renderObjectList
<
RenderObject
>(
find
.
byType
(
Text
)).
skip
(
1
).
first
);
result
=
tester
.
hitTestOnBinding
(
const
Point
(
490.0
,
100.0
));
expect
(
result
.
path
.
first
.
target
,
new
isInstanceOf
<
RenderView
>());
expect
(
result
.
path
.
first
.
target
,
const
isInstanceOf
<
RenderView
>());
result
=
tester
.
hitTestOnBinding
(
const
Point
(
520.0
,
10.0
));
expect
(
result
.
path
.
first
.
target
,
tester
.
renderObjectList
<
RenderObject
>(
find
.
byType
(
Text
)).
last
);
});
...
...
@@ -164,7 +164,7 @@ void main() {
await
tester
.
pumpWidget
(
new
Viewport2
(
offset:
new
ViewportOffset
.
fixed
(
0.0
),
slivers:
<
Widget
>[
new
SliverPadding
(
padding:
new
EdgeInsets
.
all
(
100.0
)),
new
SliverPadding
(
padding:
const
EdgeInsets
.
all
(
100.0
)),
new
SliverToBoxAdapter
(
child:
new
SizedBox
(
width:
400.0
,
height:
400.0
,
child:
new
Text
(
'x'
))),
],
));
...
...
@@ -177,7 +177,7 @@ void main() {
axisDirection:
AxisDirection
.
left
,
offset:
new
ViewportOffset
.
fixed
(
0.0
),
slivers:
<
Widget
>[
new
SliverPadding
(
padding:
new
EdgeInsets
.
fromLTRB
(
90.0
,
1.0
,
110.0
,
2.0
)),
new
SliverPadding
(
padding:
const
EdgeInsets
.
fromLTRB
(
90.0
,
1.0
,
110.0
,
2.0
)),
new
SliverToBoxAdapter
(
child:
new
SizedBox
(
width:
201.0
,
child:
new
Text
(
'x'
))),
],
));
...
...
@@ -187,7 +187,7 @@ void main() {
axisDirection:
AxisDirection
.
left
,
offset:
new
ViewportOffset
.
fixed
(
0.0
),
slivers:
<
Widget
>[
new
SliverPadding
(
padding:
new
EdgeInsets
.
fromLTRB
(
110.0
,
1.0
,
80.0
,
2.0
)),
new
SliverPadding
(
padding:
const
EdgeInsets
.
fromLTRB
(
110.0
,
1.0
,
80.0
,
2.0
)),
new
SliverToBoxAdapter
(
child:
new
SizedBox
(
width:
201.0
,
child:
new
Text
(
'x'
))),
],
));
...
...
@@ -200,7 +200,7 @@ void main() {
axisDirection:
AxisDirection
.
up
,
offset:
new
ViewportOffset
.
fixed
(
0.0
),
slivers:
<
Widget
>[
new
SliverPadding
(
padding:
new
EdgeInsets
.
fromLTRB
(
1.0
,
2.0
,
4.0
,
8.0
)),
new
SliverPadding
(
padding:
const
EdgeInsets
.
fromLTRB
(
1.0
,
2.0
,
4.0
,
8.0
)),
],
));
expect
(
tester
.
renderObject
<
RenderSliverPadding
>(
find
.
byType
(
SliverPadding
)).
endPadding
,
1.0
);
...
...
@@ -208,7 +208,7 @@ void main() {
axisDirection:
AxisDirection
.
down
,
offset:
new
ViewportOffset
.
fixed
(
0.0
),
slivers:
<
Widget
>[
new
SliverPadding
(
padding:
new
EdgeInsets
.
fromLTRB
(
1.0
,
2.0
,
4.0
,
8.0
)),
new
SliverPadding
(
padding:
const
EdgeInsets
.
fromLTRB
(
1.0
,
2.0
,
4.0
,
8.0
)),
],
));
expect
(
tester
.
renderObject
<
RenderSliverPadding
>(
find
.
byType
(
SliverPadding
)).
endPadding
,
4.0
);
...
...
@@ -216,7 +216,7 @@ void main() {
axisDirection:
AxisDirection
.
right
,
offset:
new
ViewportOffset
.
fixed
(
0.0
),
slivers:
<
Widget
>[
new
SliverPadding
(
padding:
new
EdgeInsets
.
fromLTRB
(
1.0
,
2.0
,
4.0
,
8.0
)),
new
SliverPadding
(
padding:
const
EdgeInsets
.
fromLTRB
(
1.0
,
2.0
,
4.0
,
8.0
)),
],
));
expect
(
tester
.
renderObject
<
RenderSliverPadding
>(
find
.
byType
(
SliverPadding
)).
endPadding
,
8.0
);
...
...
@@ -224,7 +224,7 @@ void main() {
axisDirection:
AxisDirection
.
left
,
offset:
new
ViewportOffset
.
fixed
(
0.0
),
slivers:
<
Widget
>[
new
SliverPadding
(
padding:
new
EdgeInsets
.
fromLTRB
(
1.0
,
2.0
,
4.0
,
8.0
)),
new
SliverPadding
(
padding:
const
EdgeInsets
.
fromLTRB
(
1.0
,
2.0
,
4.0
,
8.0
)),
],
));
expect
(
tester
.
renderObject
<
RenderSliverPadding
>(
find
.
byType
(
SliverPadding
)).
endPadding
,
2.0
);
...
...
@@ -232,7 +232,7 @@ void main() {
axisDirection:
AxisDirection
.
left
,
offset:
new
ViewportOffset
.
fixed
(
99999.9
),
slivers:
<
Widget
>[
new
SliverPadding
(
padding:
new
EdgeInsets
.
fromLTRB
(
1.0
,
2.0
,
4.0
,
8.0
)),
new
SliverPadding
(
padding:
const
EdgeInsets
.
fromLTRB
(
1.0
,
2.0
,
4.0
,
8.0
)),
],
));
expect
(
tester
.
renderObject
<
RenderSliverPadding
>(
find
.
byType
(
SliverPadding
)).
endPadding
,
2.0
);
...
...
packages/flutter/test/widgets/slivers_protocol_test.dart
View file @
d1d1c50c
...
...
@@ -10,7 +10,7 @@ import 'package:flutter/widgets.dart';
void
verifyPaintPosition
(
GlobalKey
key
,
Offset
ideal
)
{
RenderObject
target
=
key
.
currentContext
.
findRenderObject
();
expect
(
target
.
parent
,
new
isInstanceOf
<
RenderViewport2
>());
expect
(
target
.
parent
,
const
isInstanceOf
<
RenderViewport2
>());
SliverPhysicalParentData
parentData
=
target
.
parentData
;
Offset
actual
=
parentData
.
paintOffset
;
expect
(
actual
,
ideal
);
...
...
@@ -42,11 +42,11 @@ void main() {
expect
(
position
.
pixels
,
max
);
expect
(
position
.
minScrollExtent
,
0.0
);
expect
(
position
.
maxScrollExtent
,
max
);
verifyPaintPosition
(
key1
,
new
Offset
(
0.0
,
0.0
));
verifyPaintPosition
(
key2
,
new
Offset
(
0.0
,
0.0
));
verifyPaintPosition
(
key3
,
new
Offset
(
0.0
,
0.0
));
verifyPaintPosition
(
key4
,
new
Offset
(
0.0
,
0.0
));
verifyPaintPosition
(
key5
,
new
Offset
(
0.0
,
50.0
));
verifyPaintPosition
(
key1
,
const
Offset
(
0.0
,
0.0
));
verifyPaintPosition
(
key2
,
const
Offset
(
0.0
,
0.0
));
verifyPaintPosition
(
key3
,
const
Offset
(
0.0
,
0.0
));
verifyPaintPosition
(
key4
,
const
Offset
(
0.0
,
0.0
));
verifyPaintPosition
(
key5
,
const
Offset
(
0.0
,
50.0
));
});
}
...
...
packages/flutter/test/widgets/slivers_test.dart
View file @
d1d1c50c
...
...
@@ -11,11 +11,11 @@ Future<Null> test(WidgetTester tester, double offset, { double anchor: 0.0 }) {
anchor:
anchor
/
600.0
,
offset:
new
ViewportOffset
.
fixed
(
offset
),
slivers:
<
Widget
>[
new
SliverToBoxAdapter
(
child:
new
SizedBox
(
height:
400.0
)),
new
SliverToBoxAdapter
(
child:
new
SizedBox
(
height:
400.0
)),
new
SliverToBoxAdapter
(
child:
new
SizedBox
(
height:
400.0
)),
new
SliverToBoxAdapter
(
child:
new
SizedBox
(
height:
400.0
)),
new
SliverToBoxAdapter
(
child:
new
SizedBox
(
height:
400.0
)),
new
SliverToBoxAdapter
(
child:
const
SizedBox
(
height:
400.0
)),
new
SliverToBoxAdapter
(
child:
const
SizedBox
(
height:
400.0
)),
new
SliverToBoxAdapter
(
child:
const
SizedBox
(
height:
400.0
)),
new
SliverToBoxAdapter
(
child:
const
SizedBox
(
height:
400.0
)),
new
SliverToBoxAdapter
(
child:
const
SizedBox
(
height:
400.0
)),
],
));
}
...
...
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