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
d96c1c88
Unverified
Commit
d96c1c88
authored
May 09, 2019
by
Phil Quitslund
Committed by
GitHub
May 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make immutables const (#32340)
* make immutables const
parent
1621baaf
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
39 deletions
+39
-39
contacts_demo.dart
examples/flutter_gallery/lib/demo/contacts_demo.dart
+1
-1
bottom_tab_bar.dart
packages/flutter/lib/src/cupertino/bottom_tab_bar.dart
+1
-1
stepper.dart
packages/flutter/lib/src/material/stepper.dart
+1
-1
clip_test.dart
packages/flutter/test/widgets/clip_test.dart
+9
-9
physical_model_test.dart
packages/flutter/test/widgets/physical_model_test.dart
+6
-6
slivers_keepalive_test.dart
packages/flutter/test/widgets/slivers_keepalive_test.dart
+21
-21
No files found.
examples/flutter_gallery/lib/demo/contacts_demo.dart
View file @
d96c1c88
...
@@ -42,7 +42,7 @@ class _ContactCategory extends StatelessWidget {
...
@@ -42,7 +42,7 @@ class _ContactCategory extends StatelessWidget {
}
}
class
_ContactItem
extends
StatelessWidget
{
class
_ContactItem
extends
StatelessWidget
{
_ContactItem
({
Key
key
,
this
.
icon
,
this
.
lines
,
this
.
tooltip
,
this
.
onPressed
})
const
_ContactItem
({
Key
key
,
this
.
icon
,
this
.
lines
,
this
.
tooltip
,
this
.
onPressed
})
:
assert
(
lines
.
length
>
1
),
:
assert
(
lines
.
length
>
1
),
super
(
key:
key
);
super
(
key:
key
);
...
...
packages/flutter/lib/src/cupertino/bottom_tab_bar.dart
View file @
d96c1c88
...
@@ -37,7 +37,7 @@ const Color _kDefaultTabBarBorderColor = Color(0x4C000000);
...
@@ -37,7 +37,7 @@ const Color _kDefaultTabBarBorderColor = Color(0x4C000000);
/// * [BottomNavigationBarItem], an item in a [CupertinoTabBar].
/// * [BottomNavigationBarItem], an item in a [CupertinoTabBar].
class
CupertinoTabBar
extends
StatelessWidget
implements
PreferredSizeWidget
{
class
CupertinoTabBar
extends
StatelessWidget
implements
PreferredSizeWidget
{
/// Creates a tab bar in the iOS style.
/// Creates a tab bar in the iOS style.
CupertinoTabBar
({
const
CupertinoTabBar
({
Key
key
,
Key
key
,
@required
this
.
items
,
@required
this
.
items
,
this
.
onTap
,
this
.
onTap
,
...
...
packages/flutter/lib/src/material/stepper.dart
View file @
d96c1c88
...
@@ -132,7 +132,7 @@ class Stepper extends StatefulWidget {
...
@@ -132,7 +132,7 @@ class Stepper extends StatefulWidget {
/// new one.
/// new one.
///
///
/// The [steps], [type], and [currentStep] arguments must not be null.
/// The [steps], [type], and [currentStep] arguments must not be null.
Stepper
({
const
Stepper
({
Key
key
,
Key
key
,
@required
this
.
steps
,
@required
this
.
steps
,
this
.
physics
,
this
.
physics
,
...
...
packages/flutter/test/widgets/clip_test.dart
View file @
d96c1c88
...
@@ -41,7 +41,7 @@ class ValueClipper<T> extends CustomClipper<T> {
...
@@ -41,7 +41,7 @@ class ValueClipper<T> extends CustomClipper<T> {
}
}
class
_UpdateCountedClipRect
extends
ClipRect
{
class
_UpdateCountedClipRect
extends
ClipRect
{
_UpdateCountedClipRect
({
Clip
clipBehavior
=
Clip
.
antiAlias
})
const
_UpdateCountedClipRect
({
Clip
clipBehavior
=
Clip
.
antiAlias
})
:
super
(
clipBehavior:
clipBehavior
);
:
super
(
clipBehavior:
clipBehavior
);
}
}
...
@@ -51,24 +51,24 @@ class _UpdateCountedClipRRect extends ClipRRect {
...
@@ -51,24 +51,24 @@ class _UpdateCountedClipRRect extends ClipRRect {
}
}
class
_UpdateCountedClipOval
extends
ClipOval
{
class
_UpdateCountedClipOval
extends
ClipOval
{
_UpdateCountedClipOval
({
Clip
clipBehavior
=
Clip
.
antiAlias
})
const
_UpdateCountedClipOval
({
Clip
clipBehavior
=
Clip
.
antiAlias
})
:
super
(
clipBehavior:
clipBehavior
);
:
super
(
clipBehavior:
clipBehavior
);
}
}
class
_UpdateCountedClipPath
extends
ClipPath
{
class
_UpdateCountedClipPath
extends
ClipPath
{
_UpdateCountedClipPath
({
Clip
clipBehavior
=
Clip
.
antiAlias
})
const
_UpdateCountedClipPath
({
Clip
clipBehavior
=
Clip
.
antiAlias
})
:
super
(
clipBehavior:
clipBehavior
);
:
super
(
clipBehavior:
clipBehavior
);
}
}
void
main
(
)
{
void
main
(
)
{
testWidgets
(
'ClipRect updates clipBehavior in updateRenderObject'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'ClipRect updates clipBehavior in updateRenderObject'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
_UpdateCountedClipRect
());
await
tester
.
pumpWidget
(
const
_UpdateCountedClipRect
());
final
RenderClipRect
renderClip
=
tester
.
allRenderObjects
.
whereType
<
RenderClipRect
>().
first
;
final
RenderClipRect
renderClip
=
tester
.
allRenderObjects
.
whereType
<
RenderClipRect
>().
first
;
expect
(
renderClip
.
clipBehavior
,
equals
(
Clip
.
antiAlias
));
expect
(
renderClip
.
clipBehavior
,
equals
(
Clip
.
antiAlias
));
await
tester
.
pumpWidget
(
_UpdateCountedClipRect
(
clipBehavior:
Clip
.
hardEdge
));
await
tester
.
pumpWidget
(
const
_UpdateCountedClipRect
(
clipBehavior:
Clip
.
hardEdge
));
expect
(
renderClip
.
clipBehavior
,
equals
(
Clip
.
hardEdge
));
expect
(
renderClip
.
clipBehavior
,
equals
(
Clip
.
hardEdge
));
});
});
...
@@ -86,25 +86,25 @@ void main() {
...
@@ -86,25 +86,25 @@ void main() {
});
});
testWidgets
(
'ClipOval updates clipBehavior in updateRenderObject'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'ClipOval updates clipBehavior in updateRenderObject'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
_UpdateCountedClipOval
());
await
tester
.
pumpWidget
(
const
_UpdateCountedClipOval
());
final
RenderClipOval
renderClip
=
tester
.
allRenderObjects
.
whereType
<
RenderClipOval
>().
first
;
final
RenderClipOval
renderClip
=
tester
.
allRenderObjects
.
whereType
<
RenderClipOval
>().
first
;
expect
(
renderClip
.
clipBehavior
,
equals
(
Clip
.
antiAlias
));
expect
(
renderClip
.
clipBehavior
,
equals
(
Clip
.
antiAlias
));
await
tester
.
pumpWidget
(
_UpdateCountedClipOval
(
clipBehavior:
Clip
.
hardEdge
));
await
tester
.
pumpWidget
(
const
_UpdateCountedClipOval
(
clipBehavior:
Clip
.
hardEdge
));
expect
(
renderClip
.
clipBehavior
,
equals
(
Clip
.
hardEdge
));
expect
(
renderClip
.
clipBehavior
,
equals
(
Clip
.
hardEdge
));
});
});
testWidgets
(
'ClipPath updates clipBehavior in updateRenderObject'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'ClipPath updates clipBehavior in updateRenderObject'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
_UpdateCountedClipPath
());
await
tester
.
pumpWidget
(
const
_UpdateCountedClipPath
());
final
RenderClipPath
renderClip
=
tester
.
allRenderObjects
.
whereType
<
RenderClipPath
>().
first
;
final
RenderClipPath
renderClip
=
tester
.
allRenderObjects
.
whereType
<
RenderClipPath
>().
first
;
expect
(
renderClip
.
clipBehavior
,
equals
(
Clip
.
antiAlias
));
expect
(
renderClip
.
clipBehavior
,
equals
(
Clip
.
antiAlias
));
await
tester
.
pumpWidget
(
_UpdateCountedClipPath
(
clipBehavior:
Clip
.
hardEdge
));
await
tester
.
pumpWidget
(
const
_UpdateCountedClipPath
(
clipBehavior:
Clip
.
hardEdge
));
expect
(
renderClip
.
clipBehavior
,
equals
(
Clip
.
hardEdge
));
expect
(
renderClip
.
clipBehavior
,
equals
(
Clip
.
hardEdge
));
});
});
...
...
packages/flutter/test/widgets/physical_model_test.dart
View file @
d96c1c88
...
@@ -11,19 +11,19 @@ import 'package:flutter/widgets.dart';
...
@@ -11,19 +11,19 @@ import 'package:flutter/widgets.dart';
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
class
_UpdateCountedPhysicalModel
extends
PhysicalModel
{
class
_UpdateCountedPhysicalModel
extends
PhysicalModel
{
_UpdateCountedPhysicalModel
({
Clip
clipBehavior
=
Clip
.
none
})
const
_UpdateCountedPhysicalModel
({
Clip
clipBehavior
=
Clip
.
none
})
:
super
(
clipBehavior:
clipBehavior
,
color:
Colors
.
red
);
:
super
(
clipBehavior:
clipBehavior
,
color:
Colors
.
red
);
}
}
class
_UpdateCountedPhysicalShape
extends
PhysicalShape
{
class
_UpdateCountedPhysicalShape
extends
PhysicalShape
{
_UpdateCountedPhysicalShape
({
Clip
clipBehavior
=
Clip
.
none
})
const
_UpdateCountedPhysicalShape
({
Clip
clipBehavior
=
Clip
.
none
})
:
super
(
clipBehavior:
clipBehavior
,
color:
Colors
.
red
,
clipper:
const
ShapeBorderClipper
(
shape:
CircleBorder
()));
:
super
(
clipBehavior:
clipBehavior
,
color:
Colors
.
red
,
clipper:
const
ShapeBorderClipper
(
shape:
CircleBorder
()));
}
}
void
main
(
)
{
void
main
(
)
{
testWidgets
(
'PhysicalModel updates clipBehavior in updateRenderObject'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'PhysicalModel updates clipBehavior in updateRenderObject'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
MaterialApp
(
home:
_UpdateCountedPhysicalModel
()),
const
MaterialApp
(
home:
_UpdateCountedPhysicalModel
()),
);
);
final
RenderPhysicalModel
renderPhysicalModel
=
tester
.
allRenderObjects
.
whereType
<
RenderPhysicalModel
>().
first
;
final
RenderPhysicalModel
renderPhysicalModel
=
tester
.
allRenderObjects
.
whereType
<
RenderPhysicalModel
>().
first
;
...
@@ -31,7 +31,7 @@ void main() {
...
@@ -31,7 +31,7 @@ void main() {
expect
(
renderPhysicalModel
.
clipBehavior
,
equals
(
Clip
.
none
));
expect
(
renderPhysicalModel
.
clipBehavior
,
equals
(
Clip
.
none
));
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
MaterialApp
(
home:
_UpdateCountedPhysicalModel
(
clipBehavior:
Clip
.
antiAlias
)),
const
MaterialApp
(
home:
_UpdateCountedPhysicalModel
(
clipBehavior:
Clip
.
antiAlias
)),
);
);
expect
(
renderPhysicalModel
.
clipBehavior
,
equals
(
Clip
.
antiAlias
));
expect
(
renderPhysicalModel
.
clipBehavior
,
equals
(
Clip
.
antiAlias
));
...
@@ -39,7 +39,7 @@ void main() {
...
@@ -39,7 +39,7 @@ void main() {
testWidgets
(
'PhysicalShape updates clipBehavior in updateRenderObject'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'PhysicalShape updates clipBehavior in updateRenderObject'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
MaterialApp
(
home:
_UpdateCountedPhysicalShape
()),
const
MaterialApp
(
home:
_UpdateCountedPhysicalShape
()),
);
);
final
RenderPhysicalShape
renderPhysicalShape
=
tester
.
allRenderObjects
.
whereType
<
RenderPhysicalShape
>().
first
;
final
RenderPhysicalShape
renderPhysicalShape
=
tester
.
allRenderObjects
.
whereType
<
RenderPhysicalShape
>().
first
;
...
@@ -47,7 +47,7 @@ void main() {
...
@@ -47,7 +47,7 @@ void main() {
expect
(
renderPhysicalShape
.
clipBehavior
,
equals
(
Clip
.
none
));
expect
(
renderPhysicalShape
.
clipBehavior
,
equals
(
Clip
.
none
));
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
MaterialApp
(
home:
_UpdateCountedPhysicalShape
(
clipBehavior:
Clip
.
antiAlias
)),
const
MaterialApp
(
home:
_UpdateCountedPhysicalShape
(
clipBehavior:
Clip
.
antiAlias
)),
);
);
expect
(
renderPhysicalShape
.
clipBehavior
,
equals
(
Clip
.
antiAlias
));
expect
(
renderPhysicalShape
.
clipBehavior
,
equals
(
Clip
.
antiAlias
));
...
...
packages/flutter/test/widgets/slivers_keepalive_test.dart
View file @
d96c1c88
...
@@ -9,9 +9,9 @@ import 'package:flutter/rendering.dart';
...
@@ -9,9 +9,9 @@ import 'package:flutter/rendering.dart';
void
main
(
)
{
void
main
(
)
{
testWidgets
(
'Sliver with keep alive without key - should dispose after reodering'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Sliver with keep alive without key - should dispose after reodering'
,
(
WidgetTester
tester
)
async
{
List
<
Widget
>
childList
=
<
Widget
>[
List
<
Widget
>
childList
=
<
Widget
>[
WidgetTest0
(
text:
'child 0'
,
keepAlive:
true
),
const
WidgetTest0
(
text:
'child 0'
,
keepAlive:
true
),
WidgetTest1
(
text:
'child 1'
,
keepAlive:
true
),
const
WidgetTest1
(
text:
'child 1'
,
keepAlive:
true
),
WidgetTest2
(
text:
'child 2'
,
keepAlive:
true
),
const
WidgetTest2
(
text:
'child 2'
,
keepAlive:
true
),
];
];
await
tester
.
pumpWidget
(
SwitchingChildListTest
(
children:
childList
));
await
tester
.
pumpWidget
(
SwitchingChildListTest
(
children:
childList
));
final
_WidgetTest0State
state0
=
tester
.
state
(
find
.
byType
(
WidgetTest0
));
final
_WidgetTest0State
state0
=
tester
.
state
(
find
.
byType
(
WidgetTest0
));
...
@@ -32,9 +32,9 @@ void main() {
...
@@ -32,9 +32,9 @@ void main() {
testWidgets
(
'Sliver without keep alive without key - should dispose after reodering'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Sliver without keep alive without key - should dispose after reodering'
,
(
WidgetTester
tester
)
async
{
List
<
Widget
>
childList
=
<
Widget
>[
List
<
Widget
>
childList
=
<
Widget
>[
WidgetTest0
(
text:
'child 0'
),
const
WidgetTest0
(
text:
'child 0'
),
WidgetTest1
(
text:
'child 1'
),
const
WidgetTest1
(
text:
'child 1'
),
WidgetTest2
(
text:
'child 2'
),
const
WidgetTest2
(
text:
'child 2'
),
];
];
await
tester
.
pumpWidget
(
SwitchingChildListTest
(
children:
childList
));
await
tester
.
pumpWidget
(
SwitchingChildListTest
(
children:
childList
));
final
_WidgetTest0State
state0
=
tester
.
state
(
find
.
byType
(
WidgetTest0
));
final
_WidgetTest0State
state0
=
tester
.
state
(
find
.
byType
(
WidgetTest0
));
...
@@ -122,9 +122,9 @@ void main() {
...
@@ -122,9 +122,9 @@ void main() {
testWidgets
(
'Sliver with keep alive with Value key - should not dispose after reodering'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Sliver with keep alive with Value key - should not dispose after reodering'
,
(
WidgetTester
tester
)
async
{
List
<
Widget
>
childList
=
<
Widget
>[
List
<
Widget
>
childList
=
<
Widget
>[
WidgetTest0
(
text:
'child 0'
,
key:
const
ValueKey
<
int
>(
0
),
keepAlive:
true
),
const
WidgetTest0
(
text:
'child 0'
,
key:
ValueKey
<
int
>(
0
),
keepAlive:
true
),
WidgetTest1
(
text:
'child 1'
,
key:
const
ValueKey
<
int
>(
1
),
keepAlive:
true
),
const
WidgetTest1
(
text:
'child 1'
,
key:
ValueKey
<
int
>(
1
),
keepAlive:
true
),
WidgetTest2
(
text:
'child 2'
,
key:
const
ValueKey
<
int
>(
2
),
keepAlive:
true
),
const
WidgetTest2
(
text:
'child 2'
,
key:
ValueKey
<
int
>(
2
),
keepAlive:
true
),
];
];
await
tester
.
pumpWidget
(
SwitchingChildListTest
(
children:
childList
));
await
tester
.
pumpWidget
(
SwitchingChildListTest
(
children:
childList
));
final
_WidgetTest0State
state0
=
tester
.
state
(
find
.
byType
(
WidgetTest0
));
final
_WidgetTest0State
state0
=
tester
.
state
(
find
.
byType
(
WidgetTest0
));
...
@@ -146,7 +146,7 @@ void main() {
...
@@ -146,7 +146,7 @@ void main() {
List
<
Widget
>
childList
=
<
Widget
>[
List
<
Widget
>
childList
=
<
Widget
>[
WidgetTest0
(
text:
'child 0'
,
key:
GlobalKey
(),
keepAlive:
true
),
WidgetTest0
(
text:
'child 0'
,
key:
GlobalKey
(),
keepAlive:
true
),
WidgetTest1
(
text:
'child 1'
,
key:
GlobalKey
(),
keepAlive:
true
),
WidgetTest1
(
text:
'child 1'
,
key:
GlobalKey
(),
keepAlive:
true
),
WidgetTest2
(
text:
'child 2'
,
keepAlive:
true
),
const
WidgetTest2
(
text:
'child 2'
,
keepAlive:
true
),
];
];
await
tester
.
pumpWidget
(
SwitchingChildListTest
(
children:
childList
));
await
tester
.
pumpWidget
(
SwitchingChildListTest
(
children:
childList
));
final
_WidgetTest0State
state0
=
tester
.
state
(
find
.
byType
(
WidgetTest0
));
final
_WidgetTest0State
state0
=
tester
.
state
(
find
.
byType
(
WidgetTest0
));
...
@@ -190,7 +190,7 @@ void main() {
...
@@ -190,7 +190,7 @@ void main() {
List
<
Widget
>
childList
=
<
Widget
>[
List
<
Widget
>
childList
=
<
Widget
>[
WidgetTest0
(
text:
'child 0'
,
key:
GlobalKey
(),
keepAlive:
true
),
WidgetTest0
(
text:
'child 0'
,
key:
GlobalKey
(),
keepAlive:
true
),
WidgetTest1
(
text:
'child 1'
,
key:
UniqueKey
()),
WidgetTest1
(
text:
'child 1'
,
key:
UniqueKey
()),
WidgetTest2
(
text:
'child 2'
,
keepAlive:
true
),
const
WidgetTest2
(
text:
'child 2'
,
keepAlive:
true
),
];
];
await
tester
.
pumpWidget
(
SwitchingChildListTest
(
children:
childList
));
await
tester
.
pumpWidget
(
SwitchingChildListTest
(
children:
childList
));
final
_WidgetTest0State
state0
=
tester
.
state
(
find
.
byType
(
WidgetTest0
));
final
_WidgetTest0State
state0
=
tester
.
state
(
find
.
byType
(
WidgetTest0
));
...
@@ -233,7 +233,7 @@ void main() {
...
@@ -233,7 +233,7 @@ void main() {
List
<
Widget
>
childList
=
<
Widget
>[
List
<
Widget
>
childList
=
<
Widget
>[
WidgetTest0
(
text:
'child 0'
,
key:
UniqueKey
(),
keepAlive:
true
),
WidgetTest0
(
text:
'child 0'
,
key:
UniqueKey
(),
keepAlive:
true
),
WidgetTest1
(
text:
'child 1'
,
key:
GlobalKey
()),
WidgetTest1
(
text:
'child 1'
,
key:
GlobalKey
()),
WidgetTest2
(
text:
'child 2'
,
keepAlive:
true
),
const
WidgetTest2
(
text:
'child 2'
,
keepAlive:
true
),
];
];
await
tester
.
pumpWidget
(
SwitchingChildBuilderTest
(
children:
childList
));
await
tester
.
pumpWidget
(
SwitchingChildBuilderTest
(
children:
childList
));
final
_WidgetTest0State
state0
=
tester
.
state
(
find
.
byType
(
WidgetTest0
));
final
_WidgetTest0State
state0
=
tester
.
state
(
find
.
byType
(
WidgetTest0
));
...
@@ -276,7 +276,7 @@ void main() {
...
@@ -276,7 +276,7 @@ void main() {
List
<
Widget
>
childList
=
<
Widget
>[
List
<
Widget
>
childList
=
<
Widget
>[
WidgetTest0
(
text:
'child 0'
,
key:
UniqueKey
(),
keepAlive:
true
),
WidgetTest0
(
text:
'child 0'
,
key:
UniqueKey
(),
keepAlive:
true
),
WidgetTest1
(
text:
'child 1'
,
key:
UniqueKey
()),
WidgetTest1
(
text:
'child 1'
,
key:
UniqueKey
()),
WidgetTest2
(
text:
'child 2'
,
keepAlive:
true
),
const
WidgetTest2
(
text:
'child 2'
,
keepAlive:
true
),
];
];
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
SwitchingChildListTest
(
children:
childList
,
viewportFraction:
0.1
)
SwitchingChildListTest
(
children:
childList
,
viewportFraction:
0.1
)
...
@@ -316,7 +316,7 @@ void main() {
...
@@ -316,7 +316,7 @@ void main() {
testWidgets
(
'SliverList should not dispose widget with key during in screen reordering'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'SliverList should not dispose widget with key during in screen reordering'
,
(
WidgetTester
tester
)
async
{
List
<
Widget
>
childList
=
<
Widget
>[
List
<
Widget
>
childList
=
<
Widget
>[
WidgetTest0
(
text:
'child 0'
,
key:
UniqueKey
(),
keepAlive:
true
),
WidgetTest0
(
text:
'child 0'
,
key:
UniqueKey
(),
keepAlive:
true
),
WidgetTest1
(
text:
'child 1'
,
keepAlive:
true
),
const
WidgetTest1
(
text:
'child 1'
,
keepAlive:
true
),
WidgetTest2
(
text:
'child 2'
,
key:
UniqueKey
()),
WidgetTest2
(
text:
'child 2'
,
key:
UniqueKey
()),
];
];
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
@@ -366,7 +366,7 @@ void main() {
...
@@ -366,7 +366,7 @@ void main() {
testWidgets
(
'SliverList remove child from child list'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'SliverList remove child from child list'
,
(
WidgetTester
tester
)
async
{
List
<
Widget
>
childList
=
<
Widget
>[
List
<
Widget
>
childList
=
<
Widget
>[
WidgetTest0
(
text:
'child 0'
,
key:
UniqueKey
(),
keepAlive:
true
),
WidgetTest0
(
text:
'child 0'
,
key:
UniqueKey
(),
keepAlive:
true
),
WidgetTest1
(
text:
'child 1'
,
keepAlive:
true
),
const
WidgetTest1
(
text:
'child 1'
,
keepAlive:
true
),
WidgetTest2
(
text:
'child 2'
,
key:
UniqueKey
()),
WidgetTest2
(
text:
'child 2'
,
key:
UniqueKey
()),
];
];
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
@@ -401,7 +401,7 @@ List<Widget> createSwitchedChildList(List<Widget> childList, int i, int j) {
...
@@ -401,7 +401,7 @@ List<Widget> createSwitchedChildList(List<Widget> childList, int i, int j) {
}
}
class
SwitchingChildBuilderTest
extends
StatefulWidget
{
class
SwitchingChildBuilderTest
extends
StatefulWidget
{
SwitchingChildBuilderTest
({
const
SwitchingChildBuilderTest
({
this
.
children
,
this
.
children
,
Key
key
Key
key
})
:
super
(
key:
key
);
})
:
super
(
key:
key
);
...
@@ -474,7 +474,7 @@ class _SwitchingChildBuilderTest extends State<SwitchingChildBuilderTest> {
...
@@ -474,7 +474,7 @@ class _SwitchingChildBuilderTest extends State<SwitchingChildBuilderTest> {
}
}
class
SwitchingChildListTest
extends
StatefulWidget
{
class
SwitchingChildListTest
extends
StatefulWidget
{
SwitchingChildListTest
({
const
SwitchingChildListTest
({
this
.
children
,
this
.
children
,
this
.
viewportFraction
=
1.0
,
this
.
viewportFraction
=
1.0
,
Key
key
Key
key
...
@@ -511,7 +511,7 @@ class _SwitchingChildListTest extends State<SwitchingChildListTest> {
...
@@ -511,7 +511,7 @@ class _SwitchingChildListTest extends State<SwitchingChildListTest> {
}
}
class
SwitchingSliverListTest
extends
StatefulWidget
{
class
SwitchingSliverListTest
extends
StatefulWidget
{
SwitchingSliverListTest
({
const
SwitchingSliverListTest
({
this
.
children
,
this
.
children
,
this
.
viewportFraction
=
1.0
,
this
.
viewportFraction
=
1.0
,
Key
key
Key
key
...
@@ -547,7 +547,7 @@ class _SwitchingSliverListTest extends State<SwitchingSliverListTest> {
...
@@ -547,7 +547,7 @@ class _SwitchingSliverListTest extends State<SwitchingSliverListTest> {
}
}
class
WidgetTest0
extends
StatefulWidget
{
class
WidgetTest0
extends
StatefulWidget
{
WidgetTest0
({
const
WidgetTest0
({
this
.
text
,
this
.
text
,
this
.
keepAlive
=
false
,
this
.
keepAlive
=
false
,
Key
key
Key
key
...
@@ -580,7 +580,7 @@ class _WidgetTest0State extends State<WidgetTest0> with AutomaticKeepAliveClient
...
@@ -580,7 +580,7 @@ class _WidgetTest0State extends State<WidgetTest0> with AutomaticKeepAliveClient
}
}
class
WidgetTest1
extends
StatefulWidget
{
class
WidgetTest1
extends
StatefulWidget
{
WidgetTest1
({
const
WidgetTest1
({
this
.
text
,
this
.
text
,
this
.
keepAlive
=
false
,
this
.
keepAlive
=
false
,
Key
key
Key
key
...
@@ -613,7 +613,7 @@ class _WidgetTest1State extends State<WidgetTest1> with AutomaticKeepAliveClient
...
@@ -613,7 +613,7 @@ class _WidgetTest1State extends State<WidgetTest1> with AutomaticKeepAliveClient
}
}
class
WidgetTest2
extends
StatefulWidget
{
class
WidgetTest2
extends
StatefulWidget
{
WidgetTest2
({
const
WidgetTest2
({
this
.
text
,
this
.
text
,
this
.
keepAlive
=
false
,
this
.
keepAlive
=
false
,
Key
key
Key
key
...
...
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