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
03c54abd
Commit
03c54abd
authored
Apr 20, 2017
by
Alexandre Ardhuin
Committed by
GitHub
Apr 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make some widgets const (#9477)
parent
cbb49179
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
72 additions
and
72 deletions
+72
-72
contacts_demo.dart
examples/flutter_gallery/lib/demo/contacts_demo.dart
+3
-3
bottom_navigation_demo.dart
...ter_gallery/lib/demo/material/bottom_navigation_demo.dart
+2
-2
grid_list_demo.dart
...les/flutter_gallery/lib/demo/material/grid_list_demo.dart
+3
-3
leave_behind_demo.dart
.../flutter_gallery/lib/demo/material/leave_behind_demo.dart
+2
-2
menu_demo.dart
examples/flutter_gallery/lib/demo/material/menu_demo.dart
+5
-5
progress_indicator_demo.dart
...er_gallery/lib/demo/material/progress_indicator_demo.dart
+5
-5
scrollable_tabs_demo.dart
...utter_gallery/lib/demo/material/scrollable_tabs_demo.dart
+3
-3
selection_controls_demo.dart
...er_gallery/lib/demo/material/selection_controls_demo.dart
+2
-2
shrine_page.dart
examples/flutter_gallery/lib/demo/shrine/shrine_page.dart
+3
-3
demo.dart
examples/flutter_gallery/lib/gallery/demo.dart
+2
-2
example_code.dart
examples/flutter_gallery/lib/gallery/example_code.dart
+1
-1
stock_home.dart
examples/stocks/lib/stock_home.dart
+3
-3
about.dart
packages/flutter/lib/src/material/about.dart
+3
-3
app_bar.dart
packages/flutter/lib/src/material/app_bar.dart
+1
-1
paginated_data_table.dart
packages/flutter/lib/src/material/paginated_data_table.dart
+2
-2
popup_menu.dart
packages/flutter/lib/src/material/popup_menu.dart
+4
-4
progress_indicator.dart
packages/flutter/lib/src/material/progress_indicator.dart
+4
-4
switch.dart
packages/flutter/lib/src/material/switch.dart
+2
-2
user_accounts_drawer_header.dart
...flutter/lib/src/material/user_accounts_drawer_header.dart
+3
-3
popup_menu_test.dart
packages/flutter/test/material/popup_menu_test.dart
+1
-1
progress_indicator_test.dart
packages/flutter/test/material/progress_indicator_test.dart
+12
-12
theme_test.dart
packages/flutter/test/material/theme_test.dart
+2
-2
ticker_provider_test.dart
packages/flutter/test/widgets/ticker_provider_test.dart
+4
-4
No files found.
examples/flutter_gallery/lib/demo/contacts_demo.dart
View file @
03c54abd
...
...
@@ -128,15 +128,15 @@ class ContactsDemoState extends State<ContactsDemo> {
});
},
itemBuilder:
(
BuildContext
context
)
=>
<
PopupMenuItem
<
AppBarBehavior
>>[
new
PopupMenuItem
<
AppBarBehavior
>(
const
PopupMenuItem
<
AppBarBehavior
>(
value:
AppBarBehavior
.
normal
,
child:
const
Text
(
'App bar scrolls away'
)
),
new
PopupMenuItem
<
AppBarBehavior
>(
const
PopupMenuItem
<
AppBarBehavior
>(
value:
AppBarBehavior
.
pinned
,
child:
const
Text
(
'App bar stays put'
)
),
new
PopupMenuItem
<
AppBarBehavior
>(
const
PopupMenuItem
<
AppBarBehavior
>(
value:
AppBarBehavior
.
floating
,
child:
const
Text
(
'App bar floats'
)
),
...
...
examples/flutter_gallery/lib/demo/material/bottom_navigation_demo.dart
View file @
03c54abd
...
...
@@ -192,11 +192,11 @@ class _BottomNavigationDemoState extends State<BottomNavigationDemo>
});
},
itemBuilder:
(
BuildContext
context
)
=>
<
PopupMenuItem
<
BottomNavigationBarType
>>[
new
PopupMenuItem
<
BottomNavigationBarType
>(
const
PopupMenuItem
<
BottomNavigationBarType
>(
value:
BottomNavigationBarType
.
fixed
,
child:
const
Text
(
'Fixed'
),
),
new
PopupMenuItem
<
BottomNavigationBarType
>(
const
PopupMenuItem
<
BottomNavigationBarType
>(
value:
BottomNavigationBarType
.
shifting
,
child:
const
Text
(
'Shifting'
),
)
...
...
examples/flutter_gallery/lib/demo/material/grid_list_demo.dart
View file @
03c54abd
...
...
@@ -317,15 +317,15 @@ class GridListDemoState extends State<GridListDemo> {
new
PopupMenuButton
<
GridDemoTileStyle
>(
onSelected:
changeTileStyle
,
itemBuilder:
(
BuildContext
context
)
=>
<
PopupMenuItem
<
GridDemoTileStyle
>>[
new
PopupMenuItem
<
GridDemoTileStyle
>(
const
PopupMenuItem
<
GridDemoTileStyle
>(
value:
GridDemoTileStyle
.
imageOnly
,
child:
const
Text
(
'Image only'
),
),
new
PopupMenuItem
<
GridDemoTileStyle
>(
const
PopupMenuItem
<
GridDemoTileStyle
>(
value:
GridDemoTileStyle
.
oneLine
,
child:
const
Text
(
'One line'
),
),
new
PopupMenuItem
<
GridDemoTileStyle
>(
const
PopupMenuItem
<
GridDemoTileStyle
>(
value:
GridDemoTileStyle
.
twoLine
,
child:
const
Text
(
'Two line'
),
),
...
...
examples/flutter_gallery/lib/demo/material/leave_behind_demo.dart
View file @
03c54abd
...
...
@@ -137,11 +137,11 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
new
PopupMenuButton
<
LeaveBehindDemoAction
>(
onSelected:
handleDemoAction
,
itemBuilder:
(
BuildContext
context
)
=>
<
PopupMenuEntry
<
LeaveBehindDemoAction
>>[
new
PopupMenuItem
<
LeaveBehindDemoAction
>(
const
PopupMenuItem
<
LeaveBehindDemoAction
>(
value:
LeaveBehindDemoAction
.
reset
,
child:
const
Text
(
'Reset the list'
)
),
new
PopupMenuDivider
(),
// ignore: list_element_type_not_assignable, https://github.com/flutter/flutter/issues/5771
const
PopupMenuDivider
(),
// ignore: list_element_type_not_assignable, https://github.com/flutter/flutter/issues/5771
new
CheckedPopupMenuItem
<
LeaveBehindDemoAction
>(
value:
LeaveBehindDemoAction
.
horizontalSwipe
,
checked:
_dismissDirection
==
DismissDirection
.
horizontal
,
...
...
examples/flutter_gallery/lib/demo/material/menu_demo.dart
View file @
03c54abd
...
...
@@ -67,15 +67,15 @@ class MenuDemoState extends State<MenuDemo> {
new
PopupMenuButton
<
String
>(
onSelected:
showMenuSelection
,
itemBuilder:
(
BuildContext
context
)
=>
<
PopupMenuItem
<
String
>>[
new
PopupMenuItem
<
String
>(
const
PopupMenuItem
<
String
>(
value:
'Toolbar menu'
,
child:
const
Text
(
'Toolbar menu'
)
),
new
PopupMenuItem
<
String
>(
const
PopupMenuItem
<
String
>(
value:
'Right here'
,
child:
const
Text
(
'Right here'
)
),
new
PopupMenuItem
<
String
>(
const
PopupMenuItem
<
String
>(
value:
'Hooray!'
,
child:
const
Text
(
'Hooray!'
)
),
...
...
@@ -99,7 +99,7 @@ class MenuDemoState extends State<MenuDemo> {
value:
_simpleValue1
,
child:
const
Text
(
'Context menu item one'
)
),
new
PopupMenuItem
<
String
>(
const
PopupMenuItem
<
String
>(
enabled:
false
,
child:
const
Text
(
'A disabled menu item'
)
),
...
...
@@ -140,7 +140,7 @@ class MenuDemoState extends State<MenuDemo> {
title:
const
Text
(
'Get link'
)
)
),
new
PopupMenuDivider
(),
// ignore: list_element_type_not_assignable, https://github.com/flutter/flutter/issues/5771
const
PopupMenuDivider
(),
// ignore: list_element_type_not_assignable, https://github.com/flutter/flutter/issues/5771
new
PopupMenuItem
<
String
>(
value:
'Remove'
,
child:
new
ListTile
(
...
...
examples/flutter_gallery/lib/demo/material/progress_indicator_demo.dart
View file @
03c54abd
...
...
@@ -63,17 +63,17 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> with Sing
Widget
_buildIndicators
(
BuildContext
context
,
Widget
child
)
{
final
List
<
Widget
>
indicators
=
<
Widget
>[
new
SizedBox
(
const
SizedBox
(
width:
200.0
,
child:
new
LinearProgressIndicator
()
child:
const
LinearProgressIndicator
()
),
new
LinearProgressIndicator
(),
new
LinearProgressIndicator
(),
const
LinearProgressIndicator
(),
const
LinearProgressIndicator
(),
new
LinearProgressIndicator
(
value:
_animation
.
value
),
new
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
<
Widget
>[
new
CircularProgressIndicator
(),
const
CircularProgressIndicator
(),
new
SizedBox
(
width:
20.0
,
height:
20.0
,
...
...
examples/flutter_gallery/lib/demo/material/scrollable_tabs_demo.dart
View file @
03c54abd
...
...
@@ -64,15 +64,15 @@ class ScrollableTabsDemoState extends State<ScrollableTabsDemo> with SingleTicke
new
PopupMenuButton
<
TabsDemoStyle
>(
onSelected:
changeDemoStyle
,
itemBuilder:
(
BuildContext
context
)
=>
<
PopupMenuItem
<
TabsDemoStyle
>>[
new
PopupMenuItem
<
TabsDemoStyle
>(
const
PopupMenuItem
<
TabsDemoStyle
>(
value:
TabsDemoStyle
.
iconsAndText
,
child:
const
Text
(
'Icons and text'
)
),
new
PopupMenuItem
<
TabsDemoStyle
>(
const
PopupMenuItem
<
TabsDemoStyle
>(
value:
TabsDemoStyle
.
iconsOnly
,
child:
const
Text
(
'Icons only'
)
),
new
PopupMenuItem
<
TabsDemoStyle
>(
const
PopupMenuItem
<
TabsDemoStyle
>(
value:
TabsDemoStyle
.
textOnly
,
child:
const
Text
(
'Text only'
)
),
...
...
examples/flutter_gallery/lib/demo/material/selection_controls_demo.dart
View file @
03c54abd
...
...
@@ -174,8 +174,8 @@ class _SelectionControlsDemoState extends State<SelectionControlsDemo> {
}
),
// Disabled switches
new
Switch
(
value:
true
,
onChanged:
null
),
new
Switch
(
value:
false
,
onChanged:
null
)
const
Switch
(
value:
true
,
onChanged:
null
),
const
Switch
(
value:
false
,
onChanged:
null
)
],
),
);
...
...
examples/flutter_gallery/lib/demo/shrine/shrine_page.dart
View file @
03c54abd
...
...
@@ -113,15 +113,15 @@ class ShrinePageState extends State<ShrinePage> {
),
new
PopupMenuButton
<
ShrineAction
>(
itemBuilder:
(
BuildContext
context
)
=>
<
PopupMenuItem
<
ShrineAction
>>[
new
PopupMenuItem
<
ShrineAction
>(
const
PopupMenuItem
<
ShrineAction
>(
value:
ShrineAction
.
sortByPrice
,
child:
const
Text
(
'Sort by price'
)
),
new
PopupMenuItem
<
ShrineAction
>(
const
PopupMenuItem
<
ShrineAction
>(
value:
ShrineAction
.
sortByProduct
,
child:
const
Text
(
'Sort by product'
)
),
new
PopupMenuItem
<
ShrineAction
>(
const
PopupMenuItem
<
ShrineAction
>(
value:
ShrineAction
.
emptyCart
,
child:
const
Text
(
'Empty shopping cart'
)
)
...
...
examples/flutter_gallery/lib/gallery/demo.dart
View file @
03c54abd
...
...
@@ -128,8 +128,8 @@ class FullScreenCodeDialogState extends State<FullScreenCodeDialog> {
Widget
body
;
if
(
_exampleCode
==
null
)
{
body
=
new
Center
(
child:
new
CircularProgressIndicator
()
body
=
const
Center
(
child:
const
CircularProgressIndicator
()
);
}
else
{
body
=
new
SingleChildScrollView
(
...
...
examples/flutter_gallery/lib/gallery/example_code.dart
View file @
03c54abd
...
...
@@ -192,7 +192,7 @@ new Switch(
// Create a disabled switch.
// Switches are disabled when onChanged isn't
// specified or null.
new
Switch
(
value:
false
,
onChanged:
null
);
const
Switch
(
value:
false
,
onChanged:
null
);
// END
}
}
...
...
examples/stocks/lib/stock_home.dart
View file @
03c54abd
...
...
@@ -209,15 +209,15 @@ class StockHomeState extends State<StockHome> {
checked:
_autorefresh
,
child:
const
Text
(
'Autorefresh'
),
),
new
PopupMenuItem
<
_StockMenuItem
>(
const
PopupMenuItem
<
_StockMenuItem
>(
value:
_StockMenuItem
.
refresh
,
child:
const
Text
(
'Refresh'
),
),
new
PopupMenuItem
<
_StockMenuItem
>(
const
PopupMenuItem
<
_StockMenuItem
>(
value:
_StockMenuItem
.
speedUp
,
child:
const
Text
(
'Increase animation speed'
),
),
new
PopupMenuItem
<
_StockMenuItem
>(
const
PopupMenuItem
<
_StockMenuItem
>(
value:
_StockMenuItem
.
speedDown
,
child:
const
Text
(
'Decrease animation speed'
),
),
...
...
packages/flutter/lib/src/material/about.dart
View file @
03c54abd
...
...
@@ -434,10 +434,10 @@ class _LicensePageState extends State<LicensePage> {
];
contents
.
addAll
(
_licenses
);
if
(!
_loaded
)
{
contents
.
add
(
new
Padding
(
contents
.
add
(
const
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
24.0
),
child:
new
Center
(
child:
new
CircularProgressIndicator
()
child:
const
Center
(
child:
const
CircularProgressIndicator
()
)
));
}
...
...
packages/flutter/lib/src/material/app_bar.dart
View file @
03c54abd
...
...
@@ -484,7 +484,7 @@ class _AppBarState extends State<AppBar> {
}
class
_FloatingAppBar
extends
StatefulWidget
{
_FloatingAppBar
({
Key
key
,
this
.
child
})
:
super
(
key:
key
);
const
_FloatingAppBar
({
Key
key
,
this
.
child
})
:
super
(
key:
key
);
final
Widget
child
;
...
...
packages/flutter/lib/src/material/paginated_data_table.dart
View file @
03c54abd
...
...
@@ -243,13 +243,13 @@ class PaginatedDataTableState extends State<PaginatedDataTable> {
final
List
<
DataCell
>
cells
=
widget
.
columns
.
map
<
DataCell
>((
DataColumn
column
)
{
if
(!
column
.
numeric
)
{
haveProgressIndicator
=
true
;
return
new
DataCell
(
new
CircularProgressIndicator
());
return
const
DataCell
(
const
CircularProgressIndicator
());
}
return
DataCell
.
empty
;
}).
toList
();
if
(!
haveProgressIndicator
)
{
haveProgressIndicator
=
true
;
cells
[
0
]
=
new
DataCell
(
new
CircularProgressIndicator
());
cells
[
0
]
=
const
DataCell
(
const
CircularProgressIndicator
());
}
return
new
DataRow
.
byIndex
(
index:
index
,
...
...
packages/flutter/lib/src/material/popup_menu.dart
View file @
03c54abd
...
...
@@ -76,7 +76,7 @@ class PopupMenuDivider extends PopupMenuEntry<dynamic> {
/// Creates a horizontal divider for a popup menu.
///
/// By default, the divider has a height of 16.0 logical pixels.
PopupMenuDivider
({
Key
key
,
this
.
height
:
16.0
})
:
super
(
key:
key
);
const
PopupMenuDivider
({
Key
key
,
this
.
height
:
16.0
})
:
super
(
key:
key
);
@override
final
double
height
;
...
...
@@ -111,7 +111,7 @@ class PopupMenuItem<T> extends PopupMenuEntry<T> {
/// Creates an item for a popup menu.
///
/// By default, the item is enabled.
PopupMenuItem
({
const
PopupMenuItem
({
Key
key
,
this
.
value
,
this
.
enabled
:
true
,
...
...
@@ -195,7 +195,7 @@ class CheckedPopupMenuItem<T> extends PopupMenuItem<T> {
/// Creates a popup menu item with a checkmark.
///
/// By default, the menu item is enabled but unchecked.
CheckedPopupMenuItem
({
const
CheckedPopupMenuItem
({
Key
key
,
T
value
,
this
.
checked
:
false
,
...
...
@@ -252,7 +252,7 @@ class _CheckedPopupMenuItemState<T> extends _PopupMenuItemState<CheckedPopupMenu
}
class
_PopupMenu
<
T
>
extends
StatelessWidget
{
_PopupMenu
({
const
_PopupMenu
({
Key
key
,
this
.
route
})
:
super
(
key:
key
);
...
...
packages/flutter/lib/src/material/progress_indicator.dart
View file @
03c54abd
...
...
@@ -30,7 +30,7 @@ abstract class ProgressIndicator extends StatefulWidget {
/// The [value] argument can be either null (corresponding to an indeterminate
/// progress indcator) or non-null (corresponding to a determinate progress
/// indicator). See [value] for details.
ProgressIndicator
({
const
ProgressIndicator
({
Key
key
,
this
.
value
,
this
.
backgroundColor
,
...
...
@@ -137,7 +137,7 @@ class LinearProgressIndicator extends ProgressIndicator {
/// The [value] argument can be either null (corresponding to an indeterminate
/// progress indcator) or non-null (corresponding to a determinate progress
/// indicator). See [value] for details.
LinearProgressIndicator
({
const
LinearProgressIndicator
({
Key
key
,
double
value
})
:
super
(
key:
key
,
value:
value
);
...
...
@@ -278,7 +278,7 @@ class CircularProgressIndicator extends ProgressIndicator {
/// The [value] argument can be either null (corresponding to an indeterminate
/// progress indcator) or non-null (corresponding to a determinate progress
/// indicator). See [value] for details.
CircularProgressIndicator
({
const
CircularProgressIndicator
({
Key
key
,
double
value
,
Color
backgroundColor
,
...
...
@@ -438,7 +438,7 @@ class RefreshProgressIndicator extends CircularProgressIndicator {
///
/// Rather than creating a refresh progress indicator directly, consider using
/// a [RefreshIndicator] together with a [Scrollable] widget.
RefreshProgressIndicator
({
const
RefreshProgressIndicator
({
Key
key
,
double
value
,
Color
backgroundColor
,
...
...
packages/flutter/lib/src/material/switch.dart
View file @
03c54abd
...
...
@@ -42,7 +42,7 @@ class Switch extends StatefulWidget {
///
/// * [value] determines this switch is on or off.
/// * [onChanged] is called when the user toggles with switch on or off.
Switch
({
const
Switch
({
Key
key
,
@required
this
.
value
,
@required
this
.
onChanged
,
...
...
@@ -137,7 +137,7 @@ class _SwitchState extends State<Switch> with TickerProviderStateMixin {
}
class
_SwitchRenderObjectWidget
extends
LeafRenderObjectWidget
{
_SwitchRenderObjectWidget
({
const
_SwitchRenderObjectWidget
({
Key
key
,
this
.
value
,
this
.
activeColor
,
...
...
packages/flutter/lib/src/material/user_accounts_drawer_header.dart
View file @
03c54abd
...
...
@@ -8,7 +8,7 @@ import 'package:flutter/material.dart';
import
'debug.dart'
;
class
_AccountPictures
extends
StatelessWidget
{
_AccountPictures
({
const
_AccountPictures
({
Key
key
,
this
.
currentAccountPicture
,
this
.
otherAccountsPictures
,
...
...
@@ -49,7 +49,7 @@ class _AccountPictures extends StatelessWidget {
}
class
_AccountDetails
extends
StatelessWidget
{
_AccountDetails
({
const
_AccountDetails
({
Key
key
,
@required
this
.
accountName
,
@required
this
.
accountEmail
,
...
...
@@ -132,7 +132,7 @@ class UserAccountsDrawerHeader extends StatefulWidget {
/// Creates a material design drawer header.
///
/// Requires one of its ancestors to be a [Material] widget.
UserAccountsDrawerHeader
({
const
UserAccountsDrawerHeader
({
Key
key
,
this
.
decoration
,
this
.
margin
:
const
EdgeInsets
.
only
(
bottom:
8.0
),
...
...
packages/flutter/test/material/popup_menu_test.dart
View file @
03c54abd
...
...
@@ -26,7 +26,7 @@ void main() {
},
itemBuilder:
(
BuildContext
context
)
{
return
<
PopupMenuItem
<
int
>>[
new
PopupMenuItem
<
int
>(
const
PopupMenuItem
<
int
>(
value:
1
,
child:
const
Text
(
'One'
)
)
...
...
packages/flutter/test/material/progress_indicator_test.dart
View file @
03c54abd
...
...
@@ -13,10 +13,10 @@ void main() {
testWidgets
(
'LinearProgressIndicator(value: 0.0) can be constructed'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
new
Center
(
child:
new
SizedBox
(
const
Center
(
child:
const
SizedBox
(
width:
200.0
,
child:
new
LinearProgressIndicator
(
value:
0.0
)
child:
const
LinearProgressIndicator
(
value:
0.0
)
)
)
);
...
...
@@ -24,10 +24,10 @@ void main() {
testWidgets
(
'LinearProgressIndicator(value: null) can be constructed'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
new
Center
(
child:
new
SizedBox
(
const
Center
(
child:
const
SizedBox
(
width:
200.0
,
child:
new
LinearProgressIndicator
(
value:
null
)
child:
const
LinearProgressIndicator
(
value:
null
)
)
)
);
...
...
@@ -35,24 +35,24 @@ void main() {
testWidgets
(
'CircularProgressIndicator(value: 0.0) can be constructed'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
new
Center
(
child:
new
CircularProgressIndicator
(
value:
0.0
)
const
Center
(
child:
const
CircularProgressIndicator
(
value:
0.0
)
)
);
});
testWidgets
(
'CircularProgressIndicator(value: null) can be constructed'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
new
Center
(
child:
new
CircularProgressIndicator
(
value:
null
)
const
Center
(
child:
const
CircularProgressIndicator
(
value:
null
)
)
);
});
testWidgets
(
'LinearProgressIndicator causes a repaint when it changes'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
new
ListView
(
children:
<
Widget
>[
new
LinearProgressIndicator
(
value:
0.0
)]));
await
tester
.
pumpWidget
(
new
ListView
(
children:
<
Widget
>[
const
LinearProgressIndicator
(
value:
0.0
)]));
final
List
<
Layer
>
layers1
=
tester
.
layers
;
await
tester
.
pumpWidget
(
new
ListView
(
children:
<
Widget
>[
new
LinearProgressIndicator
(
value:
0.5
)]));
await
tester
.
pumpWidget
(
new
ListView
(
children:
<
Widget
>[
const
LinearProgressIndicator
(
value:
0.5
)]));
final
List
<
Layer
>
layers2
=
tester
.
layers
;
expect
(
layers1
,
isNot
(
equals
(
layers2
)));
});
...
...
packages/flutter/test/material/theme_test.dart
View file @
03c54abd
...
...
@@ -25,7 +25,7 @@ void main() {
key:
popupMenuButtonKey
,
itemBuilder:
(
BuildContext
context
)
{
return
<
PopupMenuItem
<
String
>>[
new
PopupMenuItem
<
String
>(
child:
const
Text
(
'menuItem'
))
const
PopupMenuItem
<
String
>(
child:
const
Text
(
'menuItem'
))
];
}
),
...
...
@@ -71,7 +71,7 @@ void main() {
key:
popupMenuButtonKey
,
itemBuilder:
(
BuildContext
context
)
{
return
<
PopupMenuItem
<
String
>>[
new
PopupMenuItem
<
String
>(
child:
const
Text
(
'menuItem'
))
const
PopupMenuItem
<
String
>(
child:
const
Text
(
'menuItem'
))
];
}
),
...
...
packages/flutter/test/widgets/ticker_provider_test.dart
View file @
03c54abd
...
...
@@ -9,7 +9,7 @@ void main() {
testWidgets
(
'TickerMode'
,
(
WidgetTester
tester
)
async
{
final
Widget
widget
=
new
TickerMode
(
enabled:
false
,
child:
new
LinearProgressIndicator
()
child:
const
LinearProgressIndicator
()
);
expect
(
widget
.
toString
,
isNot
(
throwsException
));
...
...
@@ -19,14 +19,14 @@ void main() {
await
tester
.
pumpWidget
(
new
TickerMode
(
enabled:
true
,
child:
new
LinearProgressIndicator
()
child:
const
LinearProgressIndicator
()
));
expect
(
tester
.
binding
.
transientCallbackCount
,
1
);
await
tester
.
pumpWidget
(
new
TickerMode
(
enabled:
false
,
child:
new
LinearProgressIndicator
()
child:
const
LinearProgressIndicator
()
));
expect
(
tester
.
binding
.
transientCallbackCount
,
0
);
...
...
@@ -34,7 +34,7 @@ void main() {
testWidgets
(
'Navigation with TickerMode'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
new
MaterialApp
(
home:
new
LinearProgressIndicator
(),
home:
const
LinearProgressIndicator
(),
routes:
<
String
,
WidgetBuilder
>{
'/test'
:
(
BuildContext
context
)
=>
const
Text
(
'hello'
),
},
...
...
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