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
15a7eb3b
Commit
15a7eb3b
authored
Jan 22, 2017
by
Ian Hickson
Committed by
GitHub
Jan 22, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move to real generic method syntax (#7235)
parent
2e196037
Changes
60
Hide whitespace changes
Inline
Side-by-side
Showing
60 changed files
with
154 additions
and
157 deletions
+154
-157
utils.dart
dev/devicelab/lib/framework/utils.dart
+3
-4
card_collection.dart
dev/manual_tests/card_collection.dart
+1
-1
data_table_demo.dart
examples/flutter_gallery/lib/demo/data_table_demo.dart
+13
-13
dialog_demo.dart
examples/flutter_gallery/lib/demo/dialog_demo.dart
+6
-6
modal_bottom_sheet_demo.dart
...les/flutter_gallery/lib/demo/modal_bottom_sheet_demo.dart
+1
-1
persistent_bottom_sheet_demo.dart
...lutter_gallery/lib/demo/persistent_bottom_sheet_demo.dart
+1
-1
shrine_page.dart
examples/flutter_gallery/lib/demo/shrine/shrine_page.dart
+1
-1
text_field_demo.dart
examples/flutter_gallery/lib/demo/text_field_demo.dart
+1
-1
stock_home.dart
examples/stocks/lib/stock_home.dart
+1
-1
basic_types.dart
packages/flutter/lib/src/foundation/basic_types.dart
+4
-4
synchronous_future.dart
packages/flutter/lib/src/foundation/synchronous_future.dart
+3
-3
drag.dart
packages/flutter/lib/src/gestures/drag.dart
+7
-7
long_press.dart
packages/flutter/lib/src/gestures/long_press.dart
+1
-1
multidrag.dart
packages/flutter/lib/src/gestures/multidrag.dart
+1
-1
multitap.dart
packages/flutter/lib/src/gestures/multitap.dart
+6
-6
recognizer.dart
packages/flutter/lib/src/gestures/recognizer.dart
+2
-2
scale.dart
packages/flutter/lib/src/gestures/scale.dart
+4
-4
tap.dart
packages/flutter/lib/src/gestures/tap.dart
+5
-5
http.dart
packages/flutter/lib/src/http/http.dart
+1
-1
io_client.dart
packages/flutter/lib/src/http/io_client.dart
+1
-1
utils.dart
packages/flutter/lib/src/http/utils.dart
+1
-1
about.dart
packages/flutter/lib/src/material/about.dart
+1
-1
arc.dart
packages/flutter/lib/src/material/arc.dart
+4
-4
bottom_sheet.dart
packages/flutter/lib/src/material/bottom_sheet.dart
+2
-2
button_bar.dart
packages/flutter/lib/src/material/button_bar.dart
+1
-1
dialog.dart
packages/flutter/lib/src/material/dialog.dart
+2
-2
paginated_data_table.dart
packages/flutter/lib/src/material/paginated_data_table.dart
+4
-4
popup_menu.dart
packages/flutter/lib/src/material/popup_menu.dart
+5
-5
scaffold.dart
packages/flutter/lib/src/material/scaffold.dart
+3
-3
grid.dart
packages/flutter/lib/src/rendering/grid.dart
+1
-1
list.dart
packages/flutter/lib/src/rendering/list.dart
+1
-1
object.dart
packages/flutter/lib/src/rendering/object.dart
+2
-2
drag_target.dart
packages/flutter/lib/src/widgets/drag_target.dart
+3
-3
gesture_detector.dart
packages/flutter/lib/src/widgets/gesture_detector.dart
+1
-1
table.dart
packages/flutter/lib/src/widgets/table.dart
+2
-2
scaffold_test.dart
packages/flutter/test/material/scaffold_test.dart
+4
-4
will_pop_test.dart
packages/flutter/test/material/will_pop_test.dart
+1
-1
bottom_sheet_rebuild_test.dart
packages/flutter/test/widgets/bottom_sheet_rebuild_test.dart
+1
-1
bottom_sheet_test.dart
packages/flutter/test/widgets/bottom_sheet_test.dart
+2
-2
build_scope_test.dart
packages/flutter/test/widgets/build_scope_test.dart
+2
-2
image_resolution_test.dart
packages/flutter/test/widgets/image_resolution_test.dart
+2
-2
layout_builder_and_parent_data_test.dart
...ter/test/widgets/layout_builder_and_parent_data_test.dart
+1
-1
page_transitions_test.dart
packages/flutter/test/widgets/page_transitions_test.dart
+1
-1
remember_scroll_position_test.dart
...s/flutter/test/widgets/remember_scroll_position_test.dart
+1
-1
reparent_state_with_layout_builder_test.dart
...test/widgets/reparent_state_with_layout_builder_test.dart
+1
-1
scroll_interaction_test.dart
packages/flutter/test/widgets/scroll_interaction_test.dart
+1
-1
scrollable_dispose_test.dart
packages/flutter/test/widgets/scrollable_dispose_test.dart
+1
-1
slivers_test.dart
packages/flutter/test/widgets/slivers_test.dart
+4
-4
state_setting_in_scrollables_test.dart
...utter/test/widgets/state_setting_in_scrollables_test.dart
+2
-2
test_widgets.dart
packages/flutter/test/widgets/test_widgets.dart
+1
-1
ticker_provider_test.dart
packages/flutter/test/widgets/ticker_provider_test.dart
+2
-2
driver.dart
packages/flutter_driver/lib/src/driver.dart
+3
-3
timeline_summary.dart
packages/flutter_driver/lib/src/timeline_summary.dart
+2
-2
controller.dart
packages/flutter_test/lib/src/controller.dart
+20
-22
widget_tester.dart
packages/flutter_test/lib/src/widget_tester.dart
+1
-1
executable.dart
packages/flutter_tools/lib/executable.dart
+1
-1
process_manager.dart
packages/flutter_tools/lib/src/base/process_manager.dart
+1
-1
analyze_continuously.dart
.../flutter_tools/lib/src/commands/analyze_continuously.dart
+1
-1
analyze_once.dart
packages/flutter_tools/lib/src/commands/analyze_once.dart
+1
-1
flutter_command_runner.dart
.../flutter_tools/lib/src/runner/flutter_command_runner.dart
+1
-1
No files found.
dev/devicelab/lib/framework/utils.dart
View file @
15a7eb3b
...
...
@@ -278,12 +278,11 @@ String requireEnvVar(String name) {
return
value
;
}
dynamic
/*=T*/
requireConfigProperty
/*<T>*/
(
Map
<
String
,
dynamic
/*<T>*/
>
map
,
String
propertyName
)
{
T
requireConfigProperty
<
T
>(
Map
<
String
,
dynamic
>
map
,
String
propertyName
)
{
if
(!
map
.
containsKey
(
propertyName
))
fail
(
'Configuration property not found:
$propertyName
'
);
return
map
[
propertyName
]
;
T
result
=
map
[
propertyName
];
return
result
;
}
String
jsonEncode
(
dynamic
data
)
{
...
...
dev/manual_tests/card_collection.dart
View file @
15a7eb3b
...
...
@@ -411,7 +411,7 @@ class CardCollectionState extends State<CardCollection> {
cardCollection
=
new
ScrollableList
(
snapOffsetCallback:
_snapToCenter
?
_toSnapOffset
:
null
,
itemExtent:
kFixedCardHeight
,
children:
_cardIndices
.
map
/*<Widget>*/
((
int
index
)
=>
_buildCard
(
context
,
index
))
children:
_cardIndices
.
map
<
Widget
>
((
int
index
)
=>
_buildCard
(
context
,
index
))
);
}
else
{
cardCollection
=
new
LazyBlock
(
...
...
examples/flutter_gallery/lib/demo/data_table_demo.dart
View file @
15a7eb3b
...
...
@@ -77,15 +77,15 @@ class DesertDataSource extends DataTableSource {
new
Desert
(
'Coconut slice and KitKat'
,
677
,
41.0
,
72
,
8.5
,
63
,
12
,
12
),
];
void
_sort
/*<T>*/
(
Comparable
<
dynamic
/*=T*/
>
getField
(
Desert
d
),
bool
ascending
)
{
void
_sort
<
T
>(
Comparable
<
T
>
getField
(
Desert
d
),
bool
ascending
)
{
_deserts
.
sort
((
Desert
a
,
Desert
b
)
{
if
(!
ascending
)
{
final
Desert
c
=
a
;
a
=
b
;
b
=
c
;
}
final
Comparable
<
dynamic
/*=T*/
>
aValue
=
getField
(
a
);
final
Comparable
<
dynamic
/*=T*/
>
bValue
=
getField
(
b
);
final
Comparable
<
T
>
aValue
=
getField
(
a
);
final
Comparable
<
T
>
bValue
=
getField
(
b
);
return
Comparable
.
compare
(
aValue
,
bValue
);
});
notifyListeners
();
...
...
@@ -153,8 +153,8 @@ class _DataTableDemoState extends State<DataTableDemo> {
bool
_sortAscending
=
true
;
DesertDataSource
_desertsDataSource
=
new
DesertDataSource
();
void
_sort
/*<T>*/
(
Comparable
<
dynamic
/*=T*/
>
getField
(
Desert
d
),
int
columnIndex
,
bool
ascending
)
{
_desertsDataSource
.
_sort
/*<T>*/
(
getField
,
ascending
);
void
_sort
<
T
>(
Comparable
<
T
>
getField
(
Desert
d
),
int
columnIndex
,
bool
ascending
)
{
_desertsDataSource
.
_sort
<
T
>
(
getField
,
ascending
);
setState
(()
{
_sortColumnIndex
=
columnIndex
;
_sortAscending
=
ascending
;
...
...
@@ -178,44 +178,44 @@ class _DataTableDemoState extends State<DataTableDemo> {
columns:
<
DataColumn
>[
new
DataColumn
(
label:
new
Text
(
'Dessert (100g serving)'
),
onSort:
(
int
columnIndex
,
bool
ascending
)
=>
_sort
/*<String>*/
((
Desert
d
)
=>
d
.
name
,
columnIndex
,
ascending
)
onSort:
(
int
columnIndex
,
bool
ascending
)
=>
_sort
<
String
>
((
Desert
d
)
=>
d
.
name
,
columnIndex
,
ascending
)
),
new
DataColumn
(
label:
new
Text
(
'Calories'
),
tooltip:
'The total amount of food energy in the given serving size.'
,
numeric:
true
,
onSort:
(
int
columnIndex
,
bool
ascending
)
=>
_sort
/*<num>*/
((
Desert
d
)
=>
d
.
calories
,
columnIndex
,
ascending
)
onSort:
(
int
columnIndex
,
bool
ascending
)
=>
_sort
<
num
>
((
Desert
d
)
=>
d
.
calories
,
columnIndex
,
ascending
)
),
new
DataColumn
(
label:
new
Text
(
'Fat (g)'
),
numeric:
true
,
onSort:
(
int
columnIndex
,
bool
ascending
)
=>
_sort
/*<num>*/
((
Desert
d
)
=>
d
.
fat
,
columnIndex
,
ascending
)
onSort:
(
int
columnIndex
,
bool
ascending
)
=>
_sort
<
num
>
((
Desert
d
)
=>
d
.
fat
,
columnIndex
,
ascending
)
),
new
DataColumn
(
label:
new
Text
(
'Carbs (g)'
),
numeric:
true
,
onSort:
(
int
columnIndex
,
bool
ascending
)
=>
_sort
/*<num>*/
((
Desert
d
)
=>
d
.
carbs
,
columnIndex
,
ascending
)
onSort:
(
int
columnIndex
,
bool
ascending
)
=>
_sort
<
num
>
((
Desert
d
)
=>
d
.
carbs
,
columnIndex
,
ascending
)
),
new
DataColumn
(
label:
new
Text
(
'Protein (g)'
),
numeric:
true
,
onSort:
(
int
columnIndex
,
bool
ascending
)
=>
_sort
/*<num>*/
((
Desert
d
)
=>
d
.
protein
,
columnIndex
,
ascending
)
onSort:
(
int
columnIndex
,
bool
ascending
)
=>
_sort
<
num
>
((
Desert
d
)
=>
d
.
protein
,
columnIndex
,
ascending
)
),
new
DataColumn
(
label:
new
Text
(
'Sodium (mg)'
),
numeric:
true
,
onSort:
(
int
columnIndex
,
bool
ascending
)
=>
_sort
/*<num>*/
((
Desert
d
)
=>
d
.
sodium
,
columnIndex
,
ascending
)
onSort:
(
int
columnIndex
,
bool
ascending
)
=>
_sort
<
num
>
((
Desert
d
)
=>
d
.
sodium
,
columnIndex
,
ascending
)
),
new
DataColumn
(
label:
new
Text
(
'Calcium (%)'
),
tooltip:
'The amount of calcium as a percentage of the recommended daily amount.'
,
numeric:
true
,
onSort:
(
int
columnIndex
,
bool
ascending
)
=>
_sort
/*<num>*/
((
Desert
d
)
=>
d
.
calcium
,
columnIndex
,
ascending
)
onSort:
(
int
columnIndex
,
bool
ascending
)
=>
_sort
<
num
>
((
Desert
d
)
=>
d
.
calcium
,
columnIndex
,
ascending
)
),
new
DataColumn
(
label:
new
Text
(
'Iron (%)'
),
numeric:
true
,
onSort:
(
int
columnIndex
,
bool
ascending
)
=>
_sort
/*<num>*/
((
Desert
d
)
=>
d
.
iron
,
columnIndex
,
ascending
)
onSort:
(
int
columnIndex
,
bool
ascending
)
=>
_sort
<
num
>
((
Desert
d
)
=>
d
.
iron
,
columnIndex
,
ascending
)
),
],
source
:
_desertsDataSource
...
...
examples/flutter_gallery/lib/demo/dialog_demo.dart
View file @
15a7eb3b
...
...
@@ -65,12 +65,12 @@ class DialogDemoState extends State<DialogDemo> {
_selectedTime
=
new
TimeOfDay
(
hour:
now
.
hour
,
minute:
now
.
minute
);
}
void
showDemoDialog
/*<T>*/
({
BuildContext
context
,
Widget
child
})
{
showDialog
/*<T>*/
(
void
showDemoDialog
<
T
>
({
BuildContext
context
,
Widget
child
})
{
showDialog
<
T
>
(
context:
context
,
child:
child
)
.
then
((
dynamic
/*=T*/
value
)
{
// The value passed to Navigator.pop() or null.
.
then
((
T
value
)
{
// The value passed to Navigator.pop() or null.
if
(
value
!=
null
)
{
_scaffoldKey
.
currentState
.
showSnackBar
(
new
SnackBar
(
content:
new
Text
(
'You selected:
$value
'
)
...
...
@@ -95,7 +95,7 @@ class DialogDemoState extends State<DialogDemo> {
new
RaisedButton
(
child:
new
Text
(
'ALERT'
),
onPressed:
()
{
showDemoDialog
/*<DialogDemoAction>*/
(
showDemoDialog
<
DialogDemoAction
>
(
context:
context
,
child:
new
AlertDialog
(
content:
new
Text
(
...
...
@@ -119,7 +119,7 @@ class DialogDemoState extends State<DialogDemo> {
new
RaisedButton
(
child:
new
Text
(
'ALERT WITH TITLE'
),
onPressed:
()
{
showDemoDialog
/*<DialogDemoAction>*/
(
showDemoDialog
<
DialogDemoAction
>
(
context:
context
,
child:
new
AlertDialog
(
title:
new
Text
(
'Use Google
\'
s location service?'
),
...
...
@@ -144,7 +144,7 @@ class DialogDemoState extends State<DialogDemo> {
new
RaisedButton
(
child:
new
Text
(
'SIMPLE'
),
onPressed:
()
{
showDemoDialog
/*<String>*/
(
showDemoDialog
<
String
>
(
context:
context
,
child:
new
SimpleDialog
(
title:
new
Text
(
'Set backup account'
),
...
...
examples/flutter_gallery/lib/demo/modal_bottom_sheet_demo.dart
View file @
15a7eb3b
...
...
@@ -15,7 +15,7 @@ class ModalBottomSheetDemo extends StatelessWidget {
child:
new
RaisedButton
(
child:
new
Text
(
'SHOW BOTTOM SHEET'
),
onPressed:
()
{
showModalBottomSheet
/*<Null>*/
(
context:
context
,
builder:
(
BuildContext
context
)
{
showModalBottomSheet
<
Null
>
(
context:
context
,
builder:
(
BuildContext
context
)
{
return
new
Container
(
child:
new
Padding
(
padding:
const
EdgeInsets
.
all
(
32.0
),
...
...
examples/flutter_gallery/lib/demo/persistent_bottom_sheet_demo.dart
View file @
15a7eb3b
...
...
@@ -27,7 +27,7 @@ class _PersistentBottomSheetDemoState extends State<PersistentBottomSheetDemo> {
setState
(()
{
// disable the button
_showBottomSheetCallback
=
null
;
});
_scaffoldKey
.
currentState
.
showBottomSheet
/*<Null>*/
((
BuildContext
context
)
{
_scaffoldKey
.
currentState
.
showBottomSheet
<
Null
>
((
BuildContext
context
)
{
final
ThemeData
themeData
=
Theme
.
of
(
context
);
return
new
Container
(
decoration:
new
BoxDecoration
(
...
...
examples/flutter_gallery/lib/demo/shrine/shrine_page.dart
View file @
15a7eb3b
...
...
@@ -51,7 +51,7 @@ class ShrinePageState extends State<ShrinePage> {
}
void
_showShoppingCart
()
{
showModalBottomSheet
/*<Null>*/
(
context:
context
,
builder:
(
BuildContext
context
)
{
showModalBottomSheet
<
Null
>
(
context:
context
,
builder:
(
BuildContext
context
)
{
if
(
config
.
shoppingCart
.
isEmpty
)
{
return
new
Padding
(
padding:
const
EdgeInsets
.
all
(
24.0
),
...
...
examples/flutter_gallery/lib/demo/text_field_demo.dart
View file @
15a7eb3b
...
...
@@ -80,7 +80,7 @@ class TextFieldDemoState extends State<TextFieldDemo> {
if
(!
_formWasEdited
||
form
.
validate
())
return
new
Future
<
bool
>.
value
(
true
);
return
showDialog
/*<bool>*/
(
return
showDialog
<
bool
>
(
context:
context
,
child:
new
AlertDialog
(
title:
new
Text
(
'This form has errors'
),
...
...
examples/stocks/lib/stock_home.dart
View file @
15a7eb3b
...
...
@@ -300,7 +300,7 @@ class StockHomeState extends State<StockHome> {
}
void
_handleCreateCompany
()
{
showModalBottomSheet
/*<Null>*/
(
showModalBottomSheet
<
Null
>
(
context:
context
,
builder:
(
BuildContext
context
)
=>
new
_CreateCompanySheet
()
);
...
...
packages/flutter/lib/src/foundation/basic_types.dart
View file @
15a7eb3b
...
...
@@ -161,8 +161,8 @@ class CachingIterable<E> extends IterableBase<E> {
}
@override
Iterable
<
dynamic
/*=T*/
>
map
/*<T>*/
(
/*=T*/
f
(
E
e
))
{
return
new
CachingIterable
<
dynamic
/*=T*/
>(
super
.
map
/*<T>*/
(
f
).
iterator
);
Iterable
<
T
>
map
<
T
>(
T
f
(
E
e
))
{
return
new
CachingIterable
<
T
>(
super
.
map
<
T
>
(
f
).
iterator
);
}
@override
...
...
@@ -171,8 +171,8 @@ class CachingIterable<E> extends IterableBase<E> {
}
@override
Iterable
<
dynamic
/*=T*/
>
expand
/*<T>*/
(
Iterable
/*<T>*/
f
(
E
element
))
{
return
new
CachingIterable
<
dynamic
/*=T*/
>(
super
.
expand
/*<T>*/
(
f
).
iterator
);
Iterable
<
T
>
expand
<
T
>(
Iterable
<
T
>
f
(
E
element
))
{
return
new
CachingIterable
<
T
>(
super
.
expand
<
T
>
(
f
).
iterator
);
}
@override
...
...
packages/flutter/lib/src/foundation/synchronous_future.dart
View file @
15a7eb3b
...
...
@@ -34,11 +34,11 @@ class SynchronousFuture<T> implements Future<T> {
Future
<
T
>
catchError
(
Function
onError
,
{
bool
test
(
dynamic
error
)
})
=>
new
Completer
<
T
>().
future
;
@override
Future
<
dynamic
/*=E*/
>
then
/*<E>*/
(
dynamic
f
(
T
value
),
{
Function
onError
})
{
Future
<
E
>
then
<
E
>
(
dynamic
f
(
T
value
),
{
Function
onError
})
{
dynamic
result
=
f
(
_value
);
if
(
result
is
Future
<
dynamic
/*=E*/
>)
if
(
result
is
Future
<
E
>)
return
result
;
return
new
SynchronousFuture
<
dynamic
/*=E*/
>(
result
);
return
new
SynchronousFuture
<
E
>(
result
);
}
@override
...
...
packages/flutter/lib/src/gestures/drag.dart
View file @
15a7eb3b
...
...
@@ -275,7 +275,7 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
_initialPosition
=
event
.
position
;
_pendingDragOffset
=
Offset
.
zero
;
if
(
onDown
!=
null
)
invokeCallback
/*<Null>*/
(
'onDown'
,
()
=>
onDown
(
new
DragDownDetails
(
globalPosition:
_initialPosition
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
Null
>
(
'onDown'
,
()
=>
onDown
(
new
DragDownDetails
(
globalPosition:
_initialPosition
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
}
}
...
...
@@ -289,7 +289,7 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
Offset
delta
=
event
.
delta
;
if
(
_state
==
_DragState
.
accepted
)
{
if
(
onUpdate
!=
null
)
{
invokeCallback
/*<Null>*/
(
'onUpdate'
,
()
=>
onUpdate
(
new
DragUpdateDetails
(
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
Null
>
(
'onUpdate'
,
()
=>
onUpdate
(
new
DragUpdateDetails
(
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
delta:
_getDeltaForDetails
(
delta
),
primaryDelta:
_getPrimaryValueFromOffset
(
delta
),
globalPosition:
event
.
position
,
...
...
@@ -311,12 +311,12 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
Offset
delta
=
_pendingDragOffset
;
_pendingDragOffset
=
Offset
.
zero
;
if
(
onStart
!=
null
)
{
invokeCallback
/*<Null>*/
(
'onStart'
,
()
=>
onStart
(
new
DragStartDetails
(
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
Null
>
(
'onStart'
,
()
=>
onStart
(
new
DragStartDetails
(
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
globalPosition:
_initialPosition
,
)));
}
if
(
delta
!=
Offset
.
zero
&&
onUpdate
!=
null
)
{
invokeCallback
/*<Null>*/
(
'onUpdate'
,
()
=>
onUpdate
(
new
DragUpdateDetails
(
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
Null
>
(
'onUpdate'
,
()
=>
onUpdate
(
new
DragUpdateDetails
(
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
delta:
_getDeltaForDetails
(
delta
),
primaryDelta:
_getPrimaryValueFromOffset
(
delta
),
globalPosition:
_initialPosition
,
...
...
@@ -336,7 +336,7 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
resolve
(
GestureDisposition
.
rejected
);
_state
=
_DragState
.
ready
;
if
(
onCancel
!=
null
)
invokeCallback
/*<Null>*/
(
'onCancel'
,
onCancel
);
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
Null
>
(
'onCancel'
,
onCancel
);
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
return
;
}
bool
wasAccepted
=
(
_state
==
_DragState
.
accepted
);
...
...
@@ -350,12 +350,12 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
final
Offset
pixelsPerSecond
=
velocity
.
pixelsPerSecond
;
if
(
pixelsPerSecond
.
distanceSquared
>
kMaxFlingVelocity
*
kMaxFlingVelocity
)
velocity
=
new
Velocity
(
pixelsPerSecond:
(
pixelsPerSecond
/
pixelsPerSecond
.
distance
)
*
kMaxFlingVelocity
);
invokeCallback
/*<Null>*/
(
'onEnd'
,
()
=>
onEnd
(
new
DragEndDetails
(
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
Null
>
(
'onEnd'
,
()
=>
onEnd
(
new
DragEndDetails
(
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
velocity:
velocity
,
primaryVelocity:
_getPrimaryValueFromOffset
(
velocity
.
pixelsPerSecond
),
)));
}
else
{
invokeCallback
/*<Null>*/
(
'onEnd'
,
()
=>
onEnd
(
new
DragEndDetails
(
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
Null
>
(
'onEnd'
,
()
=>
onEnd
(
new
DragEndDetails
(
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
velocity:
Velocity
.
zero
,
primaryVelocity:
0.0
,
)));
...
...
packages/flutter/lib/src/gestures/long_press.dart
View file @
15a7eb3b
...
...
@@ -26,7 +26,7 @@ class LongPressGestureRecognizer extends PrimaryPointerGestureRecognizer {
void
didExceedDeadline
()
{
resolve
(
GestureDisposition
.
accepted
);
if
(
onLongPress
!=
null
)
invokeCallback
/*<Null>*/
(
'onLongPress'
,
onLongPress
);
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
Null
>
(
'onLongPress'
,
onLongPress
);
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
}
@override
...
...
packages/flutter/lib/src/gestures/multidrag.dart
View file @
15a7eb3b
...
...
@@ -261,7 +261,7 @@ abstract class MultiDragGestureRecognizer<T extends MultiDragPointerState> exten
assert
(
state
.
_pendingDelta
!=
null
);
Drag
drag
;
if
(
onStart
!=
null
)
drag
=
invokeCallback
/*<Drag>*/
(
'onStart'
,
()
=>
onStart
(
initialPosition
));
drag
=
invokeCallback
<
Drag
>
(
'onStart'
,
()
=>
onStart
(
initialPosition
));
if
(
drag
!=
null
)
{
state
.
_startDrag
(
drag
);
}
else
{
...
...
packages/flutter/lib/src/gestures/multitap.dart
View file @
15a7eb3b
...
...
@@ -191,7 +191,7 @@ class DoubleTapGestureRecognizer extends GestureRecognizer {
_freezeTracker
(
tracker
);
_trackers
.
remove
(
tracker
.
pointer
);
if
(
onDoubleTap
!=
null
)
invokeCallback
/*<Null>*/
(
'onDoubleTap'
,
onDoubleTap
);
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
Null
>
(
'onDoubleTap'
,
onDoubleTap
);
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
_reset
();
}
...
...
@@ -352,7 +352,7 @@ class MultiTapGestureRecognizer extends GestureRecognizer {
longTapDelay:
longTapDelay
);
if
(
onTapDown
!=
null
)
invokeCallback
/*<Null>*/
(
'onTapDown'
,
()
=>
onTapDown
(
event
.
pointer
,
new
TapDownDetails
(
globalPosition:
event
.
position
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
Null
>
(
'onTapDown'
,
()
=>
onTapDown
(
event
.
pointer
,
new
TapDownDetails
(
globalPosition:
event
.
position
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
}
@override
...
...
@@ -372,22 +372,22 @@ class MultiTapGestureRecognizer extends GestureRecognizer {
assert
(
_gestureMap
.
containsKey
(
pointer
));
_gestureMap
.
remove
(
pointer
);
if
(
onTapCancel
!=
null
)
invokeCallback
/*<Null>*/
(
'onTapCancel'
,
()
=>
onTapCancel
(
pointer
));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
Null
>
(
'onTapCancel'
,
()
=>
onTapCancel
(
pointer
));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
}
void
_dispatchTap
(
int
pointer
,
Point
globalPosition
)
{
assert
(
_gestureMap
.
containsKey
(
pointer
));
_gestureMap
.
remove
(
pointer
);
if
(
onTapUp
!=
null
)
invokeCallback
/*<Null>*/
(
'onTapUp'
,
()
=>
onTapUp
(
pointer
,
new
TapUpDetails
(
globalPosition:
globalPosition
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
Null
>
(
'onTapUp'
,
()
=>
onTapUp
(
pointer
,
new
TapUpDetails
(
globalPosition:
globalPosition
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
if
(
onTap
!=
null
)
invokeCallback
/*<Null>*/
(
'onTap'
,
()
=>
onTap
(
pointer
));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
Null
>
(
'onTap'
,
()
=>
onTap
(
pointer
));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
}
void
_dispatchLongTap
(
int
pointer
,
Point
lastPosition
)
{
assert
(
_gestureMap
.
containsKey
(
pointer
));
if
(
onLongTapDown
!=
null
)
invokeCallback
/*<Null>*/
(
'onLongTapDown'
,
()
=>
onLongTapDown
(
pointer
,
new
TapDownDetails
(
globalPosition:
lastPosition
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
Null
>
(
'onLongTapDown'
,
()
=>
onLongTapDown
(
pointer
,
new
TapDownDetails
(
globalPosition:
lastPosition
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
}
@override
...
...
packages/flutter/lib/src/gestures/recognizer.dart
View file @
15a7eb3b
...
...
@@ -59,8 +59,8 @@ abstract class GestureRecognizer extends GestureArenaMember {
/// Invoke a callback provided by the application, catching and logging any
/// exceptions.
@protected
dynamic
/*=T*/
invokeCallback
/*<T>*/
(
String
name
,
RecognizerCallback
<
dynamic
/*=T*/
>
callback
)
{
dynamic
/*=T*/
result
;
T
invokeCallback
<
T
>(
String
name
,
RecognizerCallback
<
T
>
callback
)
{
T
result
;
try
{
result
=
callback
();
}
catch
(
exception
,
stack
)
{
...
...
packages/flutter/lib/src/gestures/scale.dart
View file @
15a7eb3b
...
...
@@ -180,9 +180,9 @@ class ScaleGestureRecognizer extends OneSequenceGestureRecognizer {
final
Offset
pixelsPerSecond
=
velocity
.
pixelsPerSecond
;
if
(
pixelsPerSecond
.
distanceSquared
>
kMaxFlingVelocity
*
kMaxFlingVelocity
)
velocity
=
new
Velocity
(
pixelsPerSecond:
(
pixelsPerSecond
/
pixelsPerSecond
.
distance
)
*
kMaxFlingVelocity
);
invokeCallback
/*<Null>*/
(
'onEnd'
,
()
=>
onEnd
(
new
ScaleEndDetails
(
velocity:
velocity
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
Null
>
(
'onEnd'
,
()
=>
onEnd
(
new
ScaleEndDetails
(
velocity:
velocity
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
}
else
{
invokeCallback
/*<Null>*/
(
'onEnd'
,
()
=>
onEnd
(
new
ScaleEndDetails
(
velocity:
Velocity
.
zero
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
Null
>
(
'onEnd'
,
()
=>
onEnd
(
new
ScaleEndDetails
(
velocity:
Velocity
.
zero
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
}
}
_state
=
ScaleState
.
accepted
;
...
...
@@ -200,11 +200,11 @@ class ScaleGestureRecognizer extends OneSequenceGestureRecognizer {
if
(
_state
==
ScaleState
.
accepted
&&
!
configChanged
)
{
_state
=
ScaleState
.
started
;
if
(
onStart
!=
null
)
invokeCallback
/*<Null>*/
(
'onStart'
,
()
=>
onStart
(
new
ScaleStartDetails
(
focalPoint:
focalPoint
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
Null
>
(
'onStart'
,
()
=>
onStart
(
new
ScaleStartDetails
(
focalPoint:
focalPoint
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
}
if
(
_state
==
ScaleState
.
started
&&
onUpdate
!=
null
)
invokeCallback
/*<Null>*/
(
'onUpdate'
,
()
=>
onUpdate
(
new
ScaleUpdateDetails
(
scale:
_scaleFactor
,
focalPoint:
focalPoint
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
Null
>
(
'onUpdate'
,
()
=>
onUpdate
(
new
ScaleUpdateDetails
(
scale:
_scaleFactor
,
focalPoint:
focalPoint
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
}
@override
...
...
packages/flutter/lib/src/gestures/tap.dart
View file @
15a7eb3b
...
...
@@ -99,7 +99,7 @@ class TapGestureRecognizer extends PrimaryPointerGestureRecognizer {
void
resolve
(
GestureDisposition
disposition
)
{
if
(
_wonArenaForPrimaryPointer
&&
disposition
==
GestureDisposition
.
rejected
)
{
if
(
onTapCancel
!=
null
)
invokeCallback
/*<Null>*/
(
'onTapCancel'
,
onTapCancel
);
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
Null
>
(
'onTapCancel'
,
onTapCancel
);
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
_reset
();
}
super
.
resolve
(
disposition
);
...
...
@@ -126,7 +126,7 @@ class TapGestureRecognizer extends PrimaryPointerGestureRecognizer {
if
(
pointer
==
primaryPointer
)
{
assert
(
state
==
GestureRecognizerState
.
defunct
);
if
(
onTapCancel
!=
null
)
invokeCallback
/*<Null>*/
(
'onTapCancel'
,
onTapCancel
);
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
Null
>
(
'onTapCancel'
,
onTapCancel
);
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
_reset
();
}
}
...
...
@@ -134,7 +134,7 @@ class TapGestureRecognizer extends PrimaryPointerGestureRecognizer {
void
_checkDown
()
{
if
(!
_sentTapDown
)
{
if
(
onTapDown
!=
null
)
invokeCallback
/*<Null>*/
(
'onTapDown'
,
()
=>
onTapDown
(
new
TapDownDetails
(
globalPosition:
initialPosition
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
Null
>
(
'onTapDown'
,
()
=>
onTapDown
(
new
TapDownDetails
(
globalPosition:
initialPosition
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
_sentTapDown
=
true
;
}
}
...
...
@@ -143,9 +143,9 @@ class TapGestureRecognizer extends PrimaryPointerGestureRecognizer {
if
(
_wonArenaForPrimaryPointer
&&
_finalPosition
!=
null
)
{
resolve
(
GestureDisposition
.
accepted
);
if
(
onTapUp
!=
null
)
invokeCallback
/*<Null>*/
(
'onTapUp'
,
()
=>
onTapUp
(
new
TapUpDetails
(
globalPosition:
_finalPosition
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
Null
>
(
'onTapUp'
,
()
=>
onTapUp
(
new
TapUpDetails
(
globalPosition:
_finalPosition
)));
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
if
(
onTap
!=
null
)
invokeCallback
/*<Null>*/
(
'onTap'
,
onTap
);
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
invokeCallback
<
Null
>
(
'onTap'
,
onTap
);
// ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27504
_reset
();
}
}
...
...
packages/flutter/lib/src/http/http.dart
View file @
15a7eb3b
...
...
@@ -161,7 +161,7 @@ Future<String> read(dynamic url, {Map<String, String> headers}) =>
Future
<
Uint8List
>
readBytes
(
dynamic
url
,
{
Map
<
String
,
String
>
headers
})
=>
_withClient
((
Client
client
)
=>
client
.
readBytes
(
url
,
headers:
headers
));
Future
/*<T>*/
_withClient
/*<T>*/
(
Future
/*<T>*/
fn
(
Client
client
))
async
{
Future
<
T
>
_withClient
<
T
>(
Future
<
T
>
fn
(
Client
client
))
async
{
Client
client
=
new
Client
();
try
{
return
await
fn
(
client
);
...
...
packages/flutter/lib/src/http/io_client.dart
View file @
15a7eb3b
...
...
@@ -62,7 +62,7 @@ class IOClient extends BaseClient {
});
return
new
StreamedResponse
(
DelegatingStream
.
typed
/*<List<int>>*/
(
response
).
handleError
((
dynamic
error
)
=>
DelegatingStream
.
typed
<
List
<
int
>>
(
response
).
handleError
((
dynamic
error
)
=>
throw
new
ClientException
(
error
.
message
,
error
.
uri
),
test:
(
dynamic
error
)
=>
io
.
isHttpException
(
error
)),
response
.
statusCode
,
...
...
packages/flutter/lib/src/http/utils.dart
View file @
15a7eb3b
...
...
@@ -85,7 +85,7 @@ ByteStream toByteStream(Stream<List<int>> stream) {
/// Calls [onDone] once [stream] (a single-subscription [Stream]) is finished.
/// The return value, also a single-subscription [Stream] should be used in
/// place of [stream] after calling this method.
Stream
/*<T>*/
onDone
/*<T>*/
(
Stream
/*<T>*/
stream
,
void
onDone
())
=>
Stream
<
T
>
onDone
<
T
>(
Stream
<
T
>
stream
,
void
onDone
())
=>
stream
.
transform
(
new
StreamTransformer
.
fromHandlers
(
handleDone:
(
EventSink
<
dynamic
>
sink
)
{
// ignore: always_specify_types
sink
.
close
();
onDone
();
...
...
packages/flutter/lib/src/material/about.dart
View file @
15a7eb3b
...
...
@@ -147,7 +147,7 @@ void showAboutDialog({
String
applicationLegalese
,
List
<
Widget
>
children
})
{
showDialog
/*<Null>*/
(
showDialog
<
Null
>
(
context:
context
,
child:
new
AboutDialog
(
applicationName:
applicationName
,
...
...
packages/flutter/lib/src/material/arc.dart
View file @
15a7eb3b
...
...
@@ -163,10 +163,10 @@ const List<_Diagonal> _allDiagonals = const <_Diagonal>[
typedef
dynamic
_KeyFunc
<
T
>(
T
input
);
// Select the element for which the key function returns the maximum value.
dynamic
/*=T*/
_maxBy
/*<T>*/
(
Iterable
<
dynamic
/*=T*/
>
input
,
_KeyFunc
/*<T>*/
keyFunc
)
{
dynamic
/*=T*/
maxValue
;
T
_maxBy
<
T
>(
Iterable
<
T
>
input
,
_KeyFunc
<
T
>
keyFunc
)
{
T
maxValue
;
dynamic
maxKey
;
for
(
dynamic
/*=T*/
value
in
input
)
{
for
(
T
value
in
input
)
{
dynamic
key
=
keyFunc
(
value
);
if
(
maxKey
==
null
||
key
>
maxKey
)
{
maxValue
=
value
;
...
...
@@ -200,7 +200,7 @@ class MaterialRectArcTween extends RectTween {
assert
(
begin
!=
null
);
assert
(
end
!=
null
);
final
Offset
centersVector
=
end
.
center
-
begin
.
center
;
_diagonal
=
_maxBy
/*<_Diagonal>*/
(
_allDiagonals
,
(
_Diagonal
d
)
=>
_diagonalSupport
(
centersVector
,
d
));
_diagonal
=
_maxBy
<
_Diagonal
>
(
_allDiagonals
,
(
_Diagonal
d
)
=>
_diagonalSupport
(
centersVector
,
d
));
_beginArc
=
new
MaterialPointArcTween
(
begin:
_cornerFor
(
begin
,
_diagonal
.
beginId
),
end:
_cornerFor
(
end
,
_diagonal
.
beginId
)
...
...
packages/flutter/lib/src/material/bottom_sheet.dart
View file @
15a7eb3b
...
...
@@ -256,10 +256,10 @@ class _ModalBottomSheetRoute<T> extends PopupRoute<T> {
/// * [BottomSheet]
/// * [Scaffold.showBottomSheet]
/// * <https://material.google.com/components/bottom-sheets.html#bottom-sheets-modal-bottom-sheets>
Future
<
dynamic
/*=T*/
>
showModalBottomSheet
/*<T>*/
({
BuildContext
context
,
WidgetBuilder
builder
})
{
Future
<
T
>
showModalBottomSheet
<
T
>
({
BuildContext
context
,
WidgetBuilder
builder
})
{
assert
(
context
!=
null
);
assert
(
builder
!=
null
);
return
Navigator
.
push
(
context
,
new
_ModalBottomSheetRoute
<
dynamic
/*=T*/
>(
return
Navigator
.
push
(
context
,
new
_ModalBottomSheetRoute
<
T
>(
builder:
builder
,
theme:
Theme
.
of
(
context
,
shadowThemeOnly:
true
),
));
...
...
packages/flutter/lib/src/material/button_bar.dart
View file @
15a7eb3b
...
...
@@ -57,7 +57,7 @@ class ButtonBar extends StatelessWidget {
child:
new
Row
(
mainAxisAlignment:
alignment
,
mainAxisSize:
mainAxisSize
,
children:
children
.
map
/*<Widget>*/
((
Widget
child
)
{
children:
children
.
map
<
Widget
>
((
Widget
child
)
{
return
new
Padding
(
padding:
new
EdgeInsets
.
symmetric
(
horizontal:
paddingUnit
),
child:
child
...
...
packages/flutter/lib/src/material/dialog.dart
View file @
15a7eb3b
...
...
@@ -361,11 +361,11 @@ class _DialogRoute<T> extends PopupRoute<T> {
/// * [AlertDialog], for dialogs that have a row of buttons below the body.
/// * [Dialog], on which [SimpleDialog] and [AlertDialog] are based.
/// * <https://material.google.com/components/dialogs.html>
Future
<
dynamic
/*=T*/
>
showDialog
/*<T>*/
({
Future
<
T
>
showDialog
<
T
>
({
@required
BuildContext
context
,
@required
Widget
child
})
{
return
Navigator
.
push
(
context
,
new
_DialogRoute
<
dynamic
/*=T*/
>(
return
Navigator
.
push
(
context
,
new
_DialogRoute
<
T
>(
child:
child
,
theme:
Theme
.
of
(
context
,
shadowThemeOnly:
true
),
));
...
...
packages/flutter/lib/src/material/paginated_data_table.dart
View file @
15a7eb3b
...
...
@@ -221,13 +221,13 @@ class PaginatedDataTableState extends State<PaginatedDataTable> {
DataRow
_getBlankRowFor
(
int
index
)
{
return
new
DataRow
.
byIndex
(
index:
index
,
cells:
config
.
columns
.
map
/*<DataCell>*/
((
DataColumn
column
)
=>
DataCell
.
empty
).
toList
()
cells:
config
.
columns
.
map
<
DataCell
>
((
DataColumn
column
)
=>
DataCell
.
empty
).
toList
()
);
}
DataRow
_getProgressIndicatorRowFor
(
int
index
)
{
bool
haveProgressIndicator
=
false
;
final
List
<
DataCell
>
cells
=
config
.
columns
.
map
/*<DataCell>*/
((
DataColumn
column
)
{
final
List
<
DataCell
>
cells
=
config
.
columns
.
map
<
DataCell
>
((
DataColumn
column
)
{
if
(!
column
.
numeric
)
{
haveProgressIndicator
=
true
;
return
new
DataCell
(
new
CircularProgressIndicator
());
...
...
@@ -291,7 +291,7 @@ class PaginatedDataTableState extends State<PaginatedDataTable> {
}
if
(
config
.
actions
!=
null
)
{
headerWidgets
.
addAll
(
config
.
actions
.
map
/*<Widget>*/
((
Widget
widget
)
{
config
.
actions
.
map
<
Widget
>
((
Widget
widget
)
{
return
new
Padding
(
// 8.0 is the default padding of an icon button
padding:
const
EdgeInsets
.
only
(
left:
24.0
-
8.0
*
2.0
),
...
...
@@ -307,7 +307,7 @@ class PaginatedDataTableState extends State<PaginatedDataTable> {
if
(
config
.
onRowsPerPageChanged
!=
null
)
{
List
<
Widget
>
availableRowsPerPage
=
config
.
availableRowsPerPage
.
where
((
int
value
)
=>
value
<=
_rowCount
)
.
map
/*<DropdownMenuItem<int>>*/
((
int
value
)
{
.
map
<
DropdownMenuItem
<
int
>>
((
int
value
)
{
return
new
DropdownMenuItem
<
int
>(
value:
value
,
child:
new
Text
(
'
$value
'
)
...
...
packages/flutter/lib/src/material/popup_menu.dart
View file @
15a7eb3b
...
...
@@ -437,16 +437,16 @@ class _PopupMenuRoute<T> extends PopupRoute<T> {
/// menu. The following elevations have defined shadows: 1, 2, 3, 4, 6, 8, 9,
/// 12, 16, 24. The elevation defaults to 8, the appropriate elevation for popup
/// menus.
Future
<
dynamic
/*=T*/
>
showMenu
/*<T>*/
({
Future
<
T
>
showMenu
<
T
>
({
BuildContext
context
,
RelativeRect
position
,
List
<
PopupMenuEntry
<
dynamic
/*=T*/
>>
items
,
dynamic
/*=T*/
initialValue
,
List
<
PopupMenuEntry
<
T
>>
items
,
T
initialValue
,
int
elevation:
8
})
{
assert
(
context
!=
null
);
assert
(
items
!=
null
&&
items
.
isNotEmpty
);
return
Navigator
.
push
(
context
,
new
_PopupMenuRoute
<
dynamic
/*=T*/
>(
return
Navigator
.
push
(
context
,
new
_PopupMenuRoute
<
T
>(
position:
position
,
items:
items
,
initialValue:
initialValue
,
...
...
@@ -525,7 +525,7 @@ class _PopupMenuButtonState<T> extends State<PopupMenuButton<T>> {
void
showButtonMenu
()
{
final
RenderBox
renderBox
=
context
.
findRenderObject
();
final
Point
topLeft
=
renderBox
.
localToGlobal
(
Point
.
origin
);
showMenu
/*<T>*/
(
showMenu
<
T
>
(
context:
context
,
elevation:
config
.
elevation
,
items:
config
.
itemBuilder
(
context
),
...
...
packages/flutter/lib/src/material/scaffold.dart
View file @
15a7eb3b
...
...
@@ -676,12 +676,12 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin {
/// sheet.
/// * [Scaffold.of], for information about how to obtain the [ScaffoldState].
/// * <https://material.google.com/components/bottom-sheets.html#bottom-sheets-persistent-bottom-sheets>
PersistentBottomSheetController
<
dynamic
/*=T*/
>
showBottomSheet
/*<T>*/
(
WidgetBuilder
builder
)
{
PersistentBottomSheetController
<
T
>
showBottomSheet
<
T
>
(
WidgetBuilder
builder
)
{
if
(
_currentBottomSheet
!=
null
)
{
_currentBottomSheet
.
close
();
assert
(
_currentBottomSheet
==
null
);
}
Completer
<
dynamic
/*=T*/
>
completer
=
new
Completer
<
dynamic
/*=T*/
>();
Completer
<
T
>
completer
=
new
Completer
<
T
>();
GlobalKey
<
_PersistentBottomSheetState
>
bottomSheetKey
=
new
GlobalKey
<
_PersistentBottomSheetState
>();
AnimationController
controller
=
BottomSheet
.
createAnimationController
(
this
)
..
forward
();
...
...
@@ -717,7 +717,7 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin {
);
ModalRoute
.
of
(
context
).
addLocalHistoryEntry
(
entry
);
setState
(()
{
_currentBottomSheet
=
new
PersistentBottomSheetController
<
dynamic
/*=T*/
>.
_
(
_currentBottomSheet
=
new
PersistentBottomSheetController
<
T
>.
_
(
bottomSheet
,
completer
,
()
=>
entry
.
remove
(),
...
...
packages/flutter/lib/src/rendering/grid.dart
View file @
15a7eb3b
...
...
@@ -643,7 +643,7 @@ class RenderGrid extends RenderVirtualViewport<GridParentData> {
size
=
constraints
.
constrain
(
gridSize
);
if
(
callback
!=
null
)
invokeLayoutCallback
/*<BoxConstraints>*/
(
callback
);
invokeLayoutCallback
<
BoxConstraints
>
(
callback
);
double
gridTopPadding
=
0.0
;
double
gridLeftPadding
=
0.0
;
...
...
packages/flutter/lib/src/rendering/list.dart
View file @
15a7eb3b
...
...
@@ -153,7 +153,7 @@ class RenderList extends RenderVirtualViewport<ListParentData> {
}
if
(
callback
!=
null
)
invokeLayoutCallback
/*<BoxConstraints>*/
(
callback
);
invokeLayoutCallback
<
BoxConstraints
>
(
callback
);
double
itemWidth
;
double
itemHeight
;
...
...
packages/flutter/lib/src/rendering/object.dart
View file @
15a7eb3b
...
...
@@ -1824,7 +1824,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
///
/// This function can only be called during layout.
@protected
void
invokeLayoutCallback
/*<T extends Constraints>*/
(
LayoutCallback
/*<T>*/
callback
)
{
void
invokeLayoutCallback
<
T
extends
Constraints
>(
LayoutCallback
<
T
>
callback
)
{
assert
(
_debugMutationsLocked
);
assert
(
_debugDoingThisLayout
);
assert
(!
_doingThisLayoutWithCallback
);
...
...
@@ -2413,7 +2413,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
debugFillDescription
(
description
);
result
+=
description
.
expand
((
String
description
)
=>
debugWordWrap
(
description
,
65
,
wrapIndent:
' '
))
.
map
/*<String>*/
((
String
line
)
=>
"
$descriptionPrefix$line
\n
"
)
.
map
<
String
>
((
String
line
)
=>
"
$descriptionPrefix$line
\n
"
)
.
join
();
if
(
childrenDescription
==
''
)
result
+=
'
$prefixOtherLines
\n
'
;
...
...
packages/flutter/lib/src/widgets/drag_target.dart
View file @
15a7eb3b
...
...
@@ -375,8 +375,8 @@ class DragTarget<T> extends StatefulWidget {
_DragTargetState
<
T
>
createState
()
=>
new
_DragTargetState
<
T
>();
}
List
/*<T>*/
_mapAvatarsToData
/*<T>*/
(
List
/*<_DragAvatar<T>>*/
avatars
)
{
return
avatars
.
map
/*<T>*/
((
_DragAvatar
/*<T>*/
avatar
)
=>
avatar
.
data
).
toList
();
List
<
T
>
_mapAvatarsToData
<
T
>(
List
<
_DragAvatar
<
T
>>
avatars
)
{
return
avatars
.
map
<
T
>((
_DragAvatar
<
T
>
avatar
)
=>
avatar
.
data
).
toList
();
}
class
_DragTargetState
<
T
>
extends
State
<
DragTarget
<
T
>>
{
...
...
@@ -423,7 +423,7 @@ class _DragTargetState<T> extends State<DragTarget<T>> {
return
new
MetaData
(
metaData:
this
,
behavior:
HitTestBehavior
.
translucent
,
child:
config
.
builder
(
context
,
_mapAvatarsToData
/*<T>*/
(
_candidateAvatars
),
_mapAvatarsToData
(
_rejectedAvatars
))
child:
config
.
builder
(
context
,
_mapAvatarsToData
<
T
>
(
_candidateAvatars
),
_mapAvatarsToData
(
_rejectedAvatars
))
);
}
}
...
...
packages/flutter/lib/src/widgets/gesture_detector.dart
View file @
15a7eb3b
...
...
@@ -454,7 +454,7 @@ class RawGestureDetectorState extends State<RawGestureDetector> {
if
(
_recognizers
==
null
)
{
description
.
add
(
'DISPOSED'
);
}
else
{
List
<
String
>
gestures
=
_recognizers
.
values
.
map
/*<String>*/
((
GestureRecognizer
recognizer
)
=>
recognizer
.
toStringShort
()).
toList
();
List
<
String
>
gestures
=
_recognizers
.
values
.
map
<
String
>
((
GestureRecognizer
recognizer
)
=>
recognizer
.
toStringShort
()).
toList
();
if
(
gestures
.
isEmpty
)
gestures
.
add
(
'<none>'
);
description
.
add
(
'gestures:
${gestures.join(", ")}
'
);
...
...
packages/flutter/lib/src/widgets/table.dart
View file @
15a7eb3b
...
...
@@ -100,7 +100,7 @@ class Table extends RenderObjectWidget {
this
.
textBaseline
})
:
children
=
children
,
_rowDecorations
=
children
.
any
((
TableRow
row
)
=>
row
.
decoration
!=
null
)
?
children
.
map
/*<Decoration>*/
((
TableRow
row
)
=>
row
.
decoration
).
toList
(
growable:
false
)
?
children
.
map
<
Decoration
>
((
TableRow
row
)
=>
row
.
decoration
).
toList
(
growable:
false
)
:
null
,
super
(
key:
key
)
{
assert
(
children
!=
null
);
...
...
@@ -246,7 +246,7 @@ class _TableElement extends RenderObjectElement {
_children
=
widget
.
children
.
map
((
TableRow
row
)
{
return
new
_TableElementRow
(
key:
row
.
key
,
children:
row
.
children
.
map
/*<Element>*/
((
Widget
child
)
{
children:
row
.
children
.
map
<
Element
>
((
Widget
child
)
{
assert
(
child
!=
null
);
return
inflateWidget
(
child
,
null
);
}).
toList
(
growable:
false
)
...
...
packages/flutter/test/material/scaffold_test.dart
View file @
15a7eb3b
...
...
@@ -313,7 +313,7 @@ void main() {
new
Scaffold
(
body:
new
Container
(
key:
testKey
))
);
expect
(
tester
.
element
(
find
.
byKey
(
testKey
)).
size
,
const
Size
(
800.0
,
600.0
));
expect
(
tester
.
renderObject
/*<RenderBox>*/
(
find
.
byKey
(
testKey
)).
localToGlobal
(
Point
.
origin
),
const
Point
(
0.0
,
0.0
));
expect
(
tester
.
renderObject
<
RenderBox
>
(
find
.
byKey
(
testKey
)).
localToGlobal
(
Point
.
origin
),
const
Point
(
0.0
,
0.0
));
});
testWidgets
(
'body size with sized container'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -322,7 +322,7 @@ void main() {
new
Scaffold
(
body:
new
Container
(
key:
testKey
,
height:
100.0
))
);
expect
(
tester
.
element
(
find
.
byKey
(
testKey
)).
size
,
const
Size
(
800.0
,
100.0
));
expect
(
tester
.
renderObject
/*<RenderBox>*/
(
find
.
byKey
(
testKey
)).
localToGlobal
(
Point
.
origin
),
const
Point
(
0.0
,
0.0
));
expect
(
tester
.
renderObject
<
RenderBox
>
(
find
.
byKey
(
testKey
)).
localToGlobal
(
Point
.
origin
),
const
Point
(
0.0
,
0.0
));
});
testWidgets
(
'body size with centered container'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -331,7 +331,7 @@ void main() {
new
Scaffold
(
body:
new
Center
(
child:
new
Container
(
key:
testKey
)))
);
expect
(
tester
.
element
(
find
.
byKey
(
testKey
)).
size
,
const
Size
(
800.0
,
600.0
));
expect
(
tester
.
renderObject
/*<RenderBox>*/
(
find
.
byKey
(
testKey
)).
localToGlobal
(
Point
.
origin
),
const
Point
(
0.0
,
0.0
));
expect
(
tester
.
renderObject
<
RenderBox
>
(
find
.
byKey
(
testKey
)).
localToGlobal
(
Point
.
origin
),
const
Point
(
0.0
,
0.0
));
});
testWidgets
(
'body size with button'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -340,7 +340,7 @@ void main() {
new
Scaffold
(
body:
new
FlatButton
(
key:
testKey
,
onPressed:
()
{
},
child:
new
Text
(
''
)))
);
expect
(
tester
.
element
(
find
.
byKey
(
testKey
)).
size
,
const
Size
(
88.0
,
36.0
));
expect
(
tester
.
renderObject
/*<RenderBox>*/
(
find
.
byKey
(
testKey
)).
localToGlobal
(
Point
.
origin
),
const
Point
(
0.0
,
0.0
));
expect
(
tester
.
renderObject
<
RenderBox
>
(
find
.
byKey
(
testKey
)).
localToGlobal
(
Point
.
origin
),
const
Point
(
0.0
,
0.0
));
});
});
}
packages/flutter/test/material/will_pop_test.dart
View file @
15a7eb3b
...
...
@@ -155,7 +155,7 @@ void main() {
testWidgets
(
'Form.willPop callbacks do not accumulate'
,
(
WidgetTester
tester
)
async
{
Future
<
bool
>
showYesNoAlert
(
BuildContext
context
)
{
return
showDialog
/*<bool>*/
(
return
showDialog
<
bool
>
(
context:
context
,
child:
new
AlertDialog
(
actions:
<
Widget
>
[
...
...
packages/flutter/test/widgets/bottom_sheet_rebuild_test.dart
View file @
15a7eb3b
...
...
@@ -18,7 +18,7 @@ void main() {
)
));
bottomSheet
=
scaffoldKey
.
currentState
.
showBottomSheet
/*<Null>*/
((
_
)
{
bottomSheet
=
scaffoldKey
.
currentState
.
showBottomSheet
<
Null
>
((
_
)
{
return
new
Builder
(
builder:
(
BuildContext
context
)
{
buildCount
+=
1
;
...
...
packages/flutter/test/widgets/bottom_sheet_test.dart
View file @
15a7eb3b
...
...
@@ -23,7 +23,7 @@ void main() {
expect
(
find
.
text
(
'BottomSheet'
),
findsNothing
);
bool
showBottomSheetThenCalled
=
false
;
showModalBottomSheet
/*<Null>*/
(
showModalBottomSheet
<
Null
>
(
context:
savedContext
,
builder:
(
BuildContext
context
)
=>
new
Text
(
'BottomSheet'
)
).
then
((
Null
result
)
{
...
...
@@ -45,7 +45,7 @@ void main() {
expect
(
find
.
text
(
'BottomSheet'
),
findsNothing
);
showBottomSheetThenCalled
=
false
;
showModalBottomSheet
/*<Null>*/
(
showModalBottomSheet
<
Null
>
(
context:
savedContext
,
builder:
(
BuildContext
context
)
=>
new
Text
(
'BottomSheet'
),
).
then
((
Null
result
)
{
...
...
packages/flutter/test/widgets/build_scope_test.dart
View file @
15a7eb3b
...
...
@@ -206,7 +206,7 @@ void main() {
middle
=
part2
;
await
tester
.
pumpWidget
(
part1
);
for
(
StatefulWrapperState
state
in
tester
.
stateList
/*<StatefulWrapperState>*/
(
find
.
byType
(
StatefulWrapper
)))
{
for
(
StatefulWrapperState
state
in
tester
.
stateList
<
StatefulWrapperState
>
(
find
.
byType
(
StatefulWrapper
)))
{
expect
(
state
.
built
,
isNotNull
);
state
.
oldBuilt
=
state
.
built
;
state
.
trigger
();
...
...
@@ -219,7 +219,7 @@ void main() {
didMiddle
=
false
;
await
tester
.
pumpWidget
(
part2
);
for
(
StatefulWrapperState
state
in
tester
.
stateList
/*<StatefulWrapperState>*/
(
find
.
byType
(
StatefulWrapper
)))
{
for
(
StatefulWrapperState
state
in
tester
.
stateList
<
StatefulWrapperState
>
(
find
.
byType
(
StatefulWrapper
)))
{
expect
(
state
.
built
,
isNotNull
);
expect
(
state
.
built
,
isNot
(
equals
(
state
.
oldBuilt
)));
}
...
...
packages/flutter/test/widgets/image_resolution_test.dart
View file @
15a7eb3b
...
...
@@ -133,10 +133,10 @@ Widget buildImageAtRatio(String image, Key key, double ratio, bool inferSize) {
}
RenderImage
getRenderImage
(
WidgetTester
tester
,
Key
key
)
{
return
tester
.
renderObject
/*<RenderImage>*/
(
find
.
byKey
(
key
));
return
tester
.
renderObject
<
RenderImage
>
(
find
.
byKey
(
key
));
}
TestImage
getTestImage
(
WidgetTester
tester
,
Key
key
)
{
return
tester
.
renderObject
/*<RenderImage>*/
(
find
.
byKey
(
key
)).
image
;
return
tester
.
renderObject
<
RenderImage
>
(
find
.
byKey
(
key
)).
image
;
}
Future
<
Null
>
pumpTreeToLayout
(
WidgetTester
tester
,
Widget
widget
)
{
...
...
packages/flutter/test/widgets/layout_builder_and_parent_data_test.dart
View file @
15a7eb3b
...
...
@@ -66,7 +66,7 @@ void main() {
})
));
frame
+=
1
;
tester
.
state
/*<SizeChangerState>*/
(
find
.
byType
(
SizeChanger
)).
trigger
();
tester
.
state
<
SizeChangerState
>
(
find
.
byType
(
SizeChanger
)).
trigger
();
await
tester
.
pump
();
});
}
packages/flutter/test/widgets/page_transitions_test.dart
View file @
15a7eb3b
...
...
@@ -26,7 +26,7 @@ class PersistentBottomSheetTestState extends State<PersistentBottomSheetTest> {
bool
setStateCalled
=
false
;
void
showBottomSheet
()
{
_scaffoldKey
.
currentState
.
showBottomSheet
/*<Null>*/
((
BuildContext
context
)
{
_scaffoldKey
.
currentState
.
showBottomSheet
<
Null
>
((
BuildContext
context
)
{
return
new
Text
(
'bottomSheet'
);
})
.
closed
.
then
((
_
)
{
...
...
packages/flutter/test/widgets/remember_scroll_position_test.dart
View file @
15a7eb3b
...
...
@@ -60,7 +60,7 @@ Future<Null> performTest(WidgetTester tester, bool maintainState) async {
expect
(
find
.
text
(
'100'
),
findsNothing
);
Completer
<
Null
>
completer
=
new
Completer
<
Null
>();
tester
.
state
/*<ScrollableState>*/
(
find
.
byType
(
Scrollable
)).
scrollTo
(
1000.0
).
whenComplete
(
completer
.
complete
);
tester
.
state
<
ScrollableState
>
(
find
.
byType
(
Scrollable
)).
scrollTo
(
1000.0
).
whenComplete
(
completer
.
complete
);
expect
(
completer
.
isCompleted
,
isFalse
);
await
tester
.
pump
(
const
Duration
(
seconds:
1
));
expect
(
completer
.
isCompleted
,
isTrue
);
...
...
packages/flutter/test/widgets/reparent_state_with_layout_builder_test.dart
View file @
15a7eb3b
...
...
@@ -71,7 +71,7 @@ void main() {
expect
(
StatefulCreationCounterState
.
creationCount
,
0
);
await
tester
.
pumpWidget
(
new
Bar
());
expect
(
StatefulCreationCounterState
.
creationCount
,
1
);
BarState
s
=
tester
.
state
/*<BarState>*/
(
find
.
byType
(
Bar
));
BarState
s
=
tester
.
state
<
BarState
>
(
find
.
byType
(
Bar
));
s
.
trigger
();
await
tester
.
pump
();
expect
(
StatefulCreationCounterState
.
creationCount
,
1
);
...
...
packages/flutter/test/widgets/scroll_interaction_test.dart
View file @
15a7eb3b
...
...
@@ -14,7 +14,7 @@ void main() {
));
ScrollableState
scrollable
=
tester
.
state
/*<ScrollableState>*/
(
find
.
byType
(
Scrollable
));
tester
.
state
<
ScrollableState
>
(
find
.
byType
(
Scrollable
));
expect
(
scrollable
.
scrollOffset
,
equals
(
0.0
));
...
...
packages/flutter/test/widgets/scrollable_dispose_test.dart
View file @
15a7eb3b
...
...
@@ -20,7 +20,7 @@ void main() {
await
tester
.
fling
(
find
.
byType
(
Scrollable
),
const
Offset
(
0.0
,
-
200.0
),
1000.0
);
await
tester
.
pump
();
tester
.
state
/*<FlipWidgetState>*/
(
find
.
byType
(
FlipWidget
)).
flip
();
tester
.
state
<
FlipWidgetState
>
(
find
.
byType
(
FlipWidget
)).
flip
();
await
tester
.
pump
(
const
Duration
(
hours:
5
));
});
}
packages/flutter/test/widgets/slivers_test.dart
View file @
15a7eb3b
...
...
@@ -21,10 +21,10 @@ Future<Null> test(WidgetTester tester, double offset, { double anchor: 0.0 }) {
}
void
verify
(
WidgetTester
tester
,
List
<
Point
>
idealPositions
,
List
<
bool
>
idealVisibles
)
{
List
<
Point
>
actualPositions
=
tester
.
renderObjectList
/*<RenderBox>*/
(
find
.
byType
(
SizedBox
)).
map
/*<Point>*/
(
List
<
Point
>
actualPositions
=
tester
.
renderObjectList
<
RenderBox
>(
find
.
byType
(
SizedBox
)).
map
<
Point
>
(
(
RenderBox
target
)
=>
target
.
localToGlobal
(
const
Point
(
0.0
,
0.0
))
).
toList
();
List
<
bool
>
actualVisibles
=
tester
.
renderObjectList
/*<RenderSliverToBoxAdapter>*/
(
find
.
byType
(
SliverToBoxAdapter
)).
map
/*<bool>*/
(
List
<
bool
>
actualVisibles
=
tester
.
renderObjectList
<
RenderSliverToBoxAdapter
>(
find
.
byType
(
SliverToBoxAdapter
)).
map
<
bool
>
(
(
RenderSliverToBoxAdapter
target
)
=>
target
.
geometry
.
visible
).
toList
();
expect
(
actualPositions
,
equals
(
idealPositions
));
...
...
@@ -34,7 +34,7 @@ void verify(WidgetTester tester, List<Point> idealPositions, List<bool> idealVis
void
main
(
)
{
testWidgets
(
'Viewport2 basic test'
,
(
WidgetTester
tester
)
async
{
await
test
(
tester
,
0.0
);
expect
(
tester
.
renderObject
/*<RenderBox>*/
(
find
.
byType
(
Viewport2
)).
size
,
equals
(
const
Size
(
800.0
,
600.0
)));
expect
(
tester
.
renderObject
<
RenderBox
>
(
find
.
byType
(
Viewport2
)).
size
,
equals
(
const
Size
(
800.0
,
600.0
)));
verify
(
tester
,
<
Point
>[
const
Point
(
0.0
,
0.0
),
const
Point
(
0.0
,
400.0
),
...
...
@@ -73,7 +73,7 @@ void main() {
testWidgets
(
'Viewport2 anchor test'
,
(
WidgetTester
tester
)
async
{
await
test
(
tester
,
0.0
,
anchor:
100.0
);
expect
(
tester
.
renderObject
/*<RenderBox>*/
(
find
.
byType
(
Viewport2
)).
size
,
equals
(
const
Size
(
800.0
,
600.0
)));
expect
(
tester
.
renderObject
<
RenderBox
>
(
find
.
byType
(
Viewport2
)).
size
,
equals
(
const
Size
(
800.0
,
600.0
)));
verify
(
tester
,
<
Point
>[
const
Point
(
0.0
,
100.0
),
const
Point
(
0.0
,
500.0
),
...
...
packages/flutter/test/widgets/state_setting_in_scrollables_test.dart
View file @
15a7eb3b
...
...
@@ -89,10 +89,10 @@ class FooScrollConfiguration extends ScrollConfigurationDelegate {
void
main
(
)
{
testWidgets
(
'https://github.com/flutter/flutter/issues/5630'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
new
Foo
());
expect
(
tester
.
state
/*<ScrollableState>*/
(
find
.
byType
(
Scrollable
)).
scrollOffset
,
0.0
);
expect
(
tester
.
state
<
ScrollableState
>
(
find
.
byType
(
Scrollable
)).
scrollOffset
,
0.0
);
await
tester
.
tap
(
find
.
byType
(
GestureDetector
).
first
);
await
tester
.
pump
();
await
tester
.
pump
(
const
Duration
(
seconds:
1
));
expect
(
tester
.
state
/*<ScrollableState>*/
(
find
.
byType
(
Scrollable
)).
scrollOffset
,
200.0
);
expect
(
tester
.
state
<
ScrollableState
>
(
find
.
byType
(
Scrollable
)).
scrollOffset
,
200.0
);
});
}
packages/flutter/test/widgets/test_widgets.dart
View file @
15a7eb3b
...
...
@@ -54,5 +54,5 @@ class FlipWidgetState extends State<FlipWidget> {
}
void
flipStatefulWidget
(
WidgetTester
tester
)
{
tester
.
state
/*<FlipWidgetState>*/
(
find
.
byType
(
FlipWidget
)).
flip
();
tester
.
state
<
FlipWidgetState
>
(
find
.
byType
(
FlipWidget
)).
flip
();
}
packages/flutter/test/widgets/ticker_provider_test.dart
View file @
15a7eb3b
...
...
@@ -40,13 +40,13 @@ void main() {
},
));
expect
(
tester
.
binding
.
transientCallbackCount
,
1
);
tester
.
state
/*<NavigatorState>*/
(
find
.
byType
(
Navigator
)).
pushNamed
(
'/test'
);
tester
.
state
<
NavigatorState
>
(
find
.
byType
(
Navigator
)).
pushNamed
(
'/test'
);
expect
(
tester
.
binding
.
transientCallbackCount
,
2
);
await
tester
.
pump
();
expect
(
tester
.
binding
.
transientCallbackCount
,
2
);
await
tester
.
pump
(
const
Duration
(
seconds:
5
));
expect
(
tester
.
binding
.
transientCallbackCount
,
0
);
tester
.
state
/*<NavigatorState>*/
(
find
.
byType
(
Navigator
)).
pop
();
tester
.
state
<
NavigatorState
>
(
find
.
byType
(
Navigator
)).
pop
();
expect
(
tester
.
binding
.
transientCallbackCount
,
1
);
await
tester
.
pump
();
expect
(
tester
.
binding
.
transientCallbackCount
,
2
);
...
...
packages/flutter_driver/lib/src/driver.dart
View file @
15a7eb3b
...
...
@@ -196,7 +196,7 @@ class FlutterDriver {
// option, then the VM service extension is not registered yet. Wait for
// it to be registered.
Future
<
dynamic
>
whenResumed
=
resumeLeniently
();
Future
<
dynamic
>
whenServiceExtensionReady
=
Future
.
any
/*<dynamic>*/
(<
Future
<
dynamic
>>[
Future
<
dynamic
>
whenServiceExtensionReady
=
Future
.
any
<
dynamic
>
(<
Future
<
dynamic
>>[
waitForServiceExtension
(),
// We will never receive the extension event if the user does not
// register it. If that happens time out.
...
...
@@ -452,9 +452,9 @@ class FlutterDriver {
/// With frame sync disabled, its the responsibility of the test author to
/// ensure that no action is performed while the app is undergoing a
/// transition to avoid flakiness.
Future
<
dynamic
/*=T*/
>
runUnsynchronized
/*<T>*/
(
Future
<
dynamic
/*=T*/
>
action
())
async
{
Future
<
T
>
runUnsynchronized
<
T
>(
Future
<
T
>
action
())
async
{
await
_sendCommand
(
new
SetFrameSync
(
false
));
dynamic
/*=T*/
result
;
T
result
;
try
{
result
=
await
action
();
}
finally
{
...
...
packages/flutter_driver/lib/src/timeline_summary.dart
View file @
15a7eb3b
...
...
@@ -160,7 +160,7 @@ class TimelineSummary {
if
(
events
.
length
==
0
)
return
null
;
int
total
=
events
.
fold
/*<int>*/
(
0
,
(
int
t
,
TimedEvent
e
)
=>
t
+
e
.
duration
.
inMilliseconds
);
int
total
=
events
.
fold
<
int
>
(
0
,
(
int
t
,
TimedEvent
e
)
=>
t
+
e
.
duration
.
inMilliseconds
);
return
total
/
events
.
length
;
}
...
...
@@ -169,7 +169,7 @@ class TimelineSummary {
return
null
;
return
events
.
map
/*<double>*/
((
TimedEvent
e
)
=>
e
.
duration
.
inMilliseconds
.
toDouble
())
.
map
<
double
>
((
TimedEvent
e
)
=>
e
.
duration
.
inMilliseconds
.
toDouble
())
.
reduce
((
double
a
,
double
b
)
=>
math
.
max
(
a
,
b
));
}
...
...
packages/flutter_test/lib/src/controller.dart
View file @
15a7eb3b
...
...
@@ -52,7 +52,7 @@ class WidgetController {
///
/// * Use [firstWidget] if you expect to match several widgets but only want the first.
/// * Use [widgetList] if you expect to match several widgets and want all of them.
Widget
/*=T*/
widget
/*<T extends Widget>*/
(
Finder
finder
)
{
T
widget
<
T
extends
Widget
>
(
Finder
finder
)
{
TestAsyncUtils
.
guardSync
();
return
finder
.
evaluate
().
single
.
widget
;
}
...
...
@@ -63,7 +63,7 @@ class WidgetController {
/// Throws a [StateError] if `finder` is empty.
///
/// * Use [widget] if you only expect to match one widget.
Widget
/*=T*/
firstWidget
/*<T extends Widget>*/
(
Finder
finder
)
{
T
firstWidget
<
T
extends
Widget
>
(
Finder
finder
)
{
TestAsyncUtils
.
guardSync
();
return
finder
.
evaluate
().
first
.
widget
;
}
...
...
@@ -72,11 +72,10 @@ class WidgetController {
///
/// * Use [widget] if you only expect to match one widget.
/// * Use [firstWidget] if you expect to match several but only want the first.
Iterable
<
Widget
/*=T*/
>
widgetList
/*<T extends Widget>*/
(
Finder
finder
)
{
Iterable
<
T
>
widgetList
<
T
extends
Widget
>
(
Finder
finder
)
{
TestAsyncUtils
.
guardSync
();
return
finder
.
evaluate
().
map
/*<T>*/
((
Element
element
)
{
// TODO(ianh): simplify once the VM can infer the return type
dynamic
/*=T*/
result
=
element
.
widget
;
return
finder
.
evaluate
().
map
<
T
>((
Element
element
)
{
T
result
=
element
.
widget
;
return
result
;
});
}
...
...
@@ -99,7 +98,7 @@ class WidgetController {
///
/// * Use [firstElement] if you expect to match several elements but only want the first.
/// * Use [elementList] if you expect to match several elements and want all of them.
Element
/*=T*/
element
/*<T extends Element>*/
(
Finder
finder
)
{
T
element
<
T
extends
Element
>
(
Finder
finder
)
{
TestAsyncUtils
.
guardSync
();
return
finder
.
evaluate
().
single
;
}
...
...
@@ -110,7 +109,7 @@ class WidgetController {
/// Throws a [StateError] if `finder` is empty.
///
/// * Use [element] if you only expect to match one element.
Element
/*=T*/
firstElement
/*<T extends Element>*/
(
Finder
finder
)
{
T
firstElement
<
T
extends
Element
>
(
Finder
finder
)
{
TestAsyncUtils
.
guardSync
();
return
finder
.
evaluate
().
first
;
}
...
...
@@ -119,7 +118,7 @@ class WidgetController {
///
/// * Use [element] if you only expect to match one element.
/// * Use [firstElement] if you expect to match several but only want the first.
Iterable
<
Element
/*=T*/
>
elementList
/*<T extends Element>*/
(
Finder
finder
)
{
Iterable
<
T
>
elementList
<
T
extends
Element
>
(
Finder
finder
)
{
TestAsyncUtils
.
guardSync
();
return
finder
.
evaluate
();
}
...
...
@@ -144,9 +143,9 @@ class WidgetController {
///
/// * Use [firstState] if you expect to match several states but only want the first.
/// * Use [stateList] if you expect to match several states and want all of them.
State
/*=T*/
state
/*<T extends State>*/
(
Finder
finder
)
{
T
state
<
T
extends
State
>
(
Finder
finder
)
{
TestAsyncUtils
.
guardSync
();
return
_stateOf
/*<T>*/
(
finder
.
evaluate
().
single
,
finder
);
return
_stateOf
<
T
>
(
finder
.
evaluate
().
single
,
finder
);
}
/// The first matching state according to a depth-first pre-order
...
...
@@ -156,9 +155,9 @@ class WidgetController {
/// matching widget has no state.
///
/// * Use [state] if you only expect to match one state.
State
/*=T*/
firstState
/*<T extends State>*/
(
Finder
finder
)
{
T
firstState
<
T
extends
State
>
(
Finder
finder
)
{
TestAsyncUtils
.
guardSync
();
return
_stateOf
/*<T>*/
(
finder
.
evaluate
().
first
,
finder
);
return
_stateOf
<
T
>
(
finder
.
evaluate
().
first
,
finder
);
}
/// The matching states in the widget tree.
...
...
@@ -168,12 +167,12 @@ class WidgetController {
///
/// * Use [state] if you only expect to match one state.
/// * Use [firstState] if you expect to match several but only want the first.
Iterable
<
State
/*=T*/
>
stateList
/*<T extends State>*/
(
Finder
finder
)
{
Iterable
<
T
>
stateList
<
T
extends
State
>
(
Finder
finder
)
{
TestAsyncUtils
.
guardSync
();
return
finder
.
evaluate
().
map
((
Element
element
)
=>
_stateOf
/*<T>*/
(
element
,
finder
));
return
finder
.
evaluate
().
map
((
Element
element
)
=>
_stateOf
<
T
>
(
element
,
finder
));
}
State
/*=T*/
_stateOf
/*<T extends State>*/
(
Element
element
,
Finder
finder
)
{
T
_stateOf
<
T
extends
State
>
(
Element
element
,
Finder
finder
)
{
TestAsyncUtils
.
guardSync
();
if
(
element
is
StatefulElement
)
return
element
.
state
;
...
...
@@ -201,7 +200,7 @@ class WidgetController {
///
/// * Use [firstRenderObject] if you expect to match several render objects but only want the first.
/// * Use [renderObjectList] if you expect to match several render objects and want all of them.
RenderObject
/*=T*/
renderObject
/*<T extends RenderObject>*/
(
Finder
finder
)
{
T
renderObject
<
T
extends
RenderObject
>
(
Finder
finder
)
{
TestAsyncUtils
.
guardSync
();
return
finder
.
evaluate
().
single
.
renderObject
;
}
...
...
@@ -212,7 +211,7 @@ class WidgetController {
/// Throws a [StateError] if `finder` is empty.
///
/// * Use [renderObject] if you only expect to match one render object.
RenderObject
/*=T*/
firstRenderObject
/*<T extends RenderObject>*/
(
Finder
finder
)
{
T
firstRenderObject
<
T
extends
RenderObject
>
(
Finder
finder
)
{
TestAsyncUtils
.
guardSync
();
return
finder
.
evaluate
().
first
.
renderObject
;
}
...
...
@@ -221,11 +220,10 @@ class WidgetController {
///
/// * Use [renderObject] if you only expect to match one render object.
/// * Use [firstRenderObject] if you expect to match several but only want the first.
Iterable
<
RenderObject
/*=T*/
>
renderObjectList
/*<T extends RenderObject>*/
(
Finder
finder
)
{
Iterable
<
T
>
renderObjectList
<
T
extends
RenderObject
>
(
Finder
finder
)
{
TestAsyncUtils
.
guardSync
();
return
finder
.
evaluate
().
map
/*<T>*/
((
Element
element
)
{
// TODO(ianh): simplify once the VM can infer the return type
dynamic
/*=T*/
result
=
element
.
renderObject
;
return
finder
.
evaluate
().
map
<
T
>((
Element
element
)
{
T
result
=
element
.
renderObject
;
return
result
;
});
}
...
...
packages/flutter_test/lib/src/widget_tester.dart
View file @
15a7eb3b
...
...
@@ -224,7 +224,7 @@ class WidgetTester extends WidgetController implements HitTestDispatcher, Ticker
await
binding
.
pump
(
duration
,
phase
);
count
+=
1
;
}
}).
then
/*<int>*/
((
Null
_
)
=>
count
);
}).
then
<
int
>
((
Null
_
)
=>
count
);
}
@override
...
...
packages/flutter_tools/lib/executable.dart
View file @
15a7eb3b
...
...
@@ -120,7 +120,7 @@ Future<Null> main(List<String> args) async {
context
.
putIfAbsent
(
SimControl
,
()
=>
new
SimControl
());
context
.
putIfAbsent
(
Usage
,
()
=>
new
Usage
());
return
Chain
.
capture
/*<Future<Null>>*/
(()
async
{
return
Chain
.
capture
<
Future
<
Null
>>
(()
async
{
await
runner
.
run
(
args
);
_exit
(
0
);
},
onError:
(
dynamic
error
,
Chain
chain
)
{
...
...
packages/flutter_tools/lib/src/base/process_manager.dart
View file @
15a7eb3b
...
...
@@ -19,7 +19,7 @@ ProcessManager get processManager => context[ProcessManager];
const
String
_kManifestName
=
'MANIFEST.txt'
;
bool
_areListsEqual
/*<T>*/
(
List
<
dynamic
/*=T*/
>
list1
,
List
<
dynamic
/*=T*/
>
list2
)
{
bool
_areListsEqual
<
T
>(
List
<
T
>
list1
,
List
<
T
>
list2
)
{
int
i
=
0
;
return
list1
!=
null
&&
list2
!=
null
...
...
packages/flutter_tools/lib/src/commands/analyze_continuously.dart
View file @
15a7eb3b
...
...
@@ -94,7 +94,7 @@ class AnalyzeContinuously extends AnalyzeBase {
printTrace
(
'error code:
${error.code}
'
);
}
dumpErrors
(
errors
.
map
/*<String>*/
((
AnalysisError
error
)
=>
error
.
toLegacyString
()));
dumpErrors
(
errors
.
map
<
String
>
((
AnalysisError
error
)
=>
error
.
toLegacyString
()));
// Print an analysis summary.
String
errorsMessage
;
...
...
packages/flutter_tools/lib/src/commands/analyze_once.dart
View file @
15a7eb3b
...
...
@@ -183,7 +183,7 @@ class AnalyzeOnce extends AnalyzeBase {
printError
(
error
.
asString
());
errorCount
+=
1
;
}
dumpErrors
(
errors
.
map
/*<String>*/
((
AnalysisErrorDescription
error
)
=>
error
.
asString
()));
dumpErrors
(
errors
.
map
<
String
>
((
AnalysisErrorDescription
error
)
=>
error
.
asString
()));
stopwatch
.
stop
();
String
elapsed
=
(
stopwatch
.
elapsedMilliseconds
/
1000.0
).
toStringAsFixed
(
1
);
...
...
packages/flutter_tools/lib/src/runner/flutter_command_runner.dart
View file @
15a7eb3b
...
...
@@ -323,7 +323,7 @@ class FlutterCommandRunner extends CommandRunner<Null> {
// And since analyzer refuses to look at paths that end in "packages/":
result
.
addAll
(
_gatherProjectPaths
(
path
.
join
(
rootPath
,
'packages'
))
.
map
/*<Directory>*/
((
String
path
)
=>
fs
.
directory
(
path
))
.
map
<
Directory
>
((
String
path
)
=>
fs
.
directory
(
path
))
);
return
result
;
}
...
...
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