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
a3dc90c4
Unverified
Commit
a3dc90c4
authored
Jul 01, 2021
by
Ahmed Ashour
Committed by
GitHub
Jul 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add space before curly parentheses. (#85306)
parent
76db0d74
Changes
45
Hide whitespace changes
Inline
Side-by-side
Showing
45 changed files
with
75 additions
and
75 deletions
+75
-75
cull_opacity.dart
dev/benchmarks/macrobenchmarks/lib/src/cull_opacity.dart
+1
-1
main.dart
...ion_tests/ios_add2app_life_cycle/flutterapp/lib/main.dart
+1
-1
logical_key_data.dart
dev/tools/gen_keycodes/lib/logical_key_data.dart
+2
-2
physical_key_data.dart
dev/tools/gen_keycodes/lib/physical_key_data.dart
+1
-1
date_picker.dart
packages/flutter/lib/src/cupertino/date_picker.dart
+1
-1
assertions.dart
packages/flutter/lib/src/foundation/assertions.dart
+1
-1
change_notifier.dart
packages/flutter/lib/src/foundation/change_notifier.dart
+1
-1
chip.dart
packages/flutter/lib/src/material/chip.dart
+1
-1
reorderable_list.dart
packages/flutter/lib/src/material/reorderable_list.dart
+2
-2
tab_controller.dart
packages/flutter/lib/src/material/tab_controller.dart
+1
-1
theme_data.dart
packages/flutter/lib/src/material/theme_data.dart
+1
-1
tooltip.dart
packages/flutter/lib/src/material/tooltip.dart
+1
-1
image_stream.dart
packages/flutter/lib/src/painting/image_stream.dart
+1
-1
layer.dart
packages/flutter/lib/src/rendering/layer.dart
+1
-1
sliver_fixed_extent_list.dart
...s/flutter/lib/src/rendering/sliver_fixed_extent_list.dart
+2
-2
sliver_multi_box_adaptor.dart
...s/flutter/lib/src/rendering/sliver_multi_box_adaptor.dart
+1
-1
raw_keyboard.dart
packages/flutter/lib/src/services/raw_keyboard.dart
+2
-2
animated_list.dart
packages/flutter/lib/src/widgets/animated_list.dart
+2
-2
editable_text.dart
packages/flutter/lib/src/widgets/editable_text.dart
+1
-1
focus_traversal.dart
packages/flutter/lib/src/widgets/focus_traversal.dart
+1
-1
navigator.dart
packages/flutter/lib/src/widgets/navigator.dart
+5
-5
platform_view.dart
packages/flutter/lib/src/widgets/platform_view.dart
+1
-1
reorderable_list.dart
packages/flutter/lib/src/widgets/reorderable_list.dart
+2
-2
chip_test.dart
packages/flutter/test/material/chip_test.dart
+1
-1
dropdown_form_field_test.dart
packages/flutter/test/material/dropdown_form_field_test.dart
+6
-6
dropdown_test.dart
packages/flutter/test/material/dropdown_test.dart
+2
-2
list_tile_test.dart
packages/flutter/test/material/list_tile_test.dart
+1
-1
text_form_field_test.dart
packages/flutter/test/material/text_form_field_test.dart
+1
-1
text_painter_test.dart
packages/flutter/test/painting/text_painter_test.dart
+5
-5
platform_view_test.dart
packages/flutter/test/rendering/platform_view_test.dart
+1
-1
framework_test.dart
packages/flutter/test/widgets/framework_test.dart
+2
-2
interactive_viewer_test.dart
packages/flutter/test/widgets/interactive_viewer_test.dart
+3
-3
navigator_test.dart
packages/flutter/test/widgets/navigator_test.dart
+4
-4
router_test.dart
packages/flutter/test/widgets/router_test.dart
+1
-1
scroll_view_test.dart
packages/flutter/test/widgets/scroll_view_test.dart
+2
-2
selectable_text_test.dart
packages/flutter/test/widgets/selectable_text_test.dart
+3
-3
live_binding_test.dart
packages/flutter_test/test/live_binding_test.dart
+1
-1
widget_tester_test.dart
packages/flutter_test/test/widget_tester_test.dart
+2
-2
cache.dart
packages/flutter_tools/lib/src/cache.dart
+1
-1
channel.dart
packages/flutter_tools/lib/src/commands/channel.dart
+1
-1
create.dart
packages/flutter_tools/lib/src/commands/create.dart
+1
-1
device.dart
packages/flutter_tools/lib/src/device.dart
+1
-1
web_driver_service.dart
packages/flutter_tools/lib/src/drive/web_driver_service.dart
+1
-1
plugins_test.dart
packages/flutter_tools/test/general.shard/plugins_test.dart
+1
-1
project_test.dart
packages/flutter_tools/test/general.shard/project_test.dart
+1
-1
No files found.
dev/benchmarks/macrobenchmarks/lib/src/cull_opacity.dart
View file @
a3dc90c4
...
...
@@ -24,7 +24,7 @@ class _CullOpacityPageState extends State<CullOpacityPage> with SingleTickerProv
// This code uses a manual listener for historical reasons and will remain
// in order to preserve compatibility with the history of measurements for
// this benchmark.
_offsetY
=
Tween
<
double
>(
begin:
0
,
end:
-
1000.0
).
animate
(
_controller
)..
addListener
((){
_offsetY
=
Tween
<
double
>(
begin:
0
,
end:
-
1000.0
).
animate
(
_controller
)..
addListener
(()
{
setState
(()
{});
});
_controller
.
repeat
();
...
...
dev/integration_tests/ios_add2app_life_cycle/flutterapp/lib/main.dart
View file @
a3dc90c4
...
...
@@ -44,7 +44,7 @@ class _LifeCycleSpyState extends State<LifeCycleSpy> with WidgetsBindingObserver
List
<
AppLifecycleState
?>?
_actualLifeCycleSequence
;
@override
void
initState
(){
void
initState
()
{
super
.
initState
();
WidgetsBinding
.
instance
?.
addObserver
(
this
);
_actualLifeCycleSequence
=
<
AppLifecycleState
?>[
...
...
dev/tools/gen_keycodes/lib/logical_key_data.dart
View file @
a3dc90c4
...
...
@@ -370,7 +370,7 @@ class LogicalKeyData {
}();
/// Returns the static map of printable representations.
static
late
final
Map
<
String
,
String
>
printable
=
((){
static
late
final
Map
<
String
,
String
>
printable
=
(()
{
final
String
printableKeys
=
File
(
path
.
join
(
dataRoot
,
'printable.json'
,)).
readAsStringSync
();
return
(
json
.
decode
(
printableKeys
)
as
Map
<
String
,
dynamic
>)
.
cast
<
String
,
String
>();
...
...
@@ -389,7 +389,7 @@ class LogicalKeyData {
/// These include synonyms for keys which don't have printable
/// representations, and appear in more than one place on the keyboard (e.g.
/// SHIFT, ALT, etc.).
static
late
final
Map
<
String
,
List
<
String
>>
synonyms
=
((){
static
late
final
Map
<
String
,
List
<
String
>>
synonyms
=
(()
{
final
String
synonymKeys
=
File
(
path
.
join
(
dataRoot
,
'synonyms.json'
,)).
readAsStringSync
();
final
Map
<
String
,
dynamic
>
dynamicSynonym
=
json
.
decode
(
synonymKeys
)
as
Map
<
String
,
dynamic
>;
return
dynamicSynonym
.
map
((
String
name
,
dynamic
values
)
{
...
...
dev/tools/gen_keycodes/lib/physical_key_data.dart
View file @
a3dc90c4
...
...
@@ -364,7 +364,7 @@ class PhysicalKeyEntry {
/// the name from the various different names available, making sure that the
/// name isn't a Dart reserved word (if it is, then it adds the word "Key" to
/// the end of the name).
late
final
String
constantName
=
((){
late
final
String
constantName
=
(()
{
String
?
result
;
if
(
name
.
isEmpty
)
{
// If it doesn't have a DomKey name then use the Chromium symbol name.
...
...
packages/flutter/lib/src/cupertino/date_picker.dart
View file @
a3dc90c4
...
...
@@ -1986,7 +1986,7 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> {
// label on top of it.
List
<
Widget
>
columns
;
if
(
widget
.
mode
==
CupertinoTimerPickerMode
.
hms
){
if
(
widget
.
mode
==
CupertinoTimerPickerMode
.
hms
)
{
// Pad the widget to make it as wide as `_kPickerWidth`.
pickerColumnWidth
=
_kTimerPickerColumnIntrinsicWidth
+
(
_kTimerPickerHalfColumnPadding
*
2
);
...
...
packages/flutter/lib/src/foundation/assertions.dart
View file @
a3dc90c4
...
...
@@ -1237,7 +1237,7 @@ class _FlutterErrorDetailsNode extends DiagnosticableNode<FlutterErrorDetails> {
@override
DiagnosticPropertiesBuilder
?
get
builder
{
final
DiagnosticPropertiesBuilder
?
builder
=
super
.
builder
;
if
(
builder
==
null
){
if
(
builder
==
null
)
{
return
null
;
}
Iterable
<
DiagnosticsNode
>
properties
=
builder
.
properties
;
...
...
packages/flutter/lib/src/foundation/change_notifier.dart
View file @
a3dc90c4
...
...
@@ -348,7 +348,7 @@ class ChangeNotifier implements Listenable {
if
(
_listeners
[
i
]
==
null
)
{
// We swap this item with the next not null item.
int
swapIndex
=
i
+
1
;
while
(
_listeners
[
swapIndex
]
==
null
){
while
(
_listeners
[
swapIndex
]
==
null
)
{
swapIndex
+=
1
;
}
_listeners
[
i
]
=
_listeners
[
swapIndex
];
...
...
packages/flutter/lib/src/material/chip.dart
View file @
a3dc90c4
...
...
@@ -1835,7 +1835,7 @@ class _RawChipState extends State<RawChip> with MaterialStateMixin, TickerProvid
}
Widget
?
_wrapWithTooltip
(
String
?
tooltip
,
VoidCallback
?
callback
,
Widget
?
child
)
{
if
(!
widget
.
useDeleteButtonTooltip
){
if
(!
widget
.
useDeleteButtonTooltip
)
{
return
child
;
}
if
(
child
==
null
||
callback
==
null
||
tooltip
==
null
)
{
...
...
packages/flutter/lib/src/material/reorderable_list.dart
View file @
a3dc90c4
...
...
@@ -35,7 +35,7 @@ import 'theme.dart';
/// final List<int> _items = List<int>.generate(50, (int index) => index);
///
/// @override
/// Widget build(BuildContext context){
/// Widget build(BuildContext context)
{
/// final ColorScheme colorScheme = Theme.of(context).colorScheme;
/// final Color oddItemColor = colorScheme.primary.withOpacity(0.05);
/// final Color evenItemColor = colorScheme.primary.withOpacity(0.15);
...
...
@@ -238,7 +238,7 @@ class ReorderableListView extends StatefulWidget {
/// final List<int> _items = List<int>.generate(50, (int index) => index);
///
/// @override
/// Widget build(BuildContext context){
/// Widget build(BuildContext context)
{
/// final ColorScheme colorScheme = Theme.of(context).colorScheme;
/// final Color oddItemColor = colorScheme.primary.withOpacity(0.05);
/// final Color evenItemColor = colorScheme.primary.withOpacity(0.15);
...
...
packages/flutter/lib/src/material/tab_controller.dart
View file @
a3dc90c4
...
...
@@ -119,7 +119,7 @@ import 'constants.dart';
/// ),
/// ),
/// body: TabBarView(
/// children: tabs.map((Tab tab){
/// children: tabs.map((Tab tab)
{
/// return Center(
/// child: Text(
/// '${tab.text!} Tab',
...
...
packages/flutter/lib/src/material/theme_data.dart
View file @
a3dc90c4
...
...
@@ -2325,7 +2325,7 @@ class VisualDensity with Diagnosticable {
///
/// The resulting minWidth and minHeight values are clamped to not exceed the
/// maxWidth and maxHeight values, respectively.
BoxConstraints
effectiveConstraints
(
BoxConstraints
constraints
){
BoxConstraints
effectiveConstraints
(
BoxConstraints
constraints
)
{
assert
(
constraints
!=
null
&&
constraints
.
debugAssertIsValid
());
return
constraints
.
copyWith
(
minWidth:
(
constraints
.
minWidth
+
baseSizeAdjustment
.
dx
).
clamp
(
0.0
,
constraints
.
maxWidth
),
...
...
packages/flutter/lib/src/material/tooltip.dart
View file @
a3dc90c4
...
...
@@ -327,7 +327,7 @@ class _TooltipState extends State<Tooltip> with SingleTickerProviderStateMixin {
}
final
bool
mouseIsConnected
=
RendererBinding
.
instance
!.
mouseTracker
.
mouseIsConnected
;
if
(
mouseIsConnected
!=
_mouseIsConnected
)
{
setState
((){
setState
(()
{
_mouseIsConnected
=
mouseIsConnected
;
});
}
...
...
packages/flutter/lib/src/painting/image_stream.dart
View file @
a3dc90c4
...
...
@@ -718,7 +718,7 @@ abstract class ImageStreamCompleter with Diagnosticable {
/// [ImageStreamListener.onChunk] specified) to notify them of a new
/// [ImageChunkEvent].
@protected
void
reportImageChunkEvent
(
ImageChunkEvent
event
){
void
reportImageChunkEvent
(
ImageChunkEvent
event
)
{
_checkDisposed
();
if
(
hasListeners
)
{
// Make a copy to allow for concurrent modification.
...
...
packages/flutter/lib/src/rendering/layer.dart
View file @
a3dc90c4
...
...
@@ -2527,7 +2527,7 @@ class FollowerLayer extends ContainerLayer {
if
(
a
.
depth
<
b
.
depth
)
{
ancestorsB
.
add
(
b
.
parent
);
return
_pathsToCommonAncestor
(
a
,
b
.
parent
,
ancestorsA
,
ancestorsB
);
}
else
if
(
a
.
depth
>
b
.
depth
){
}
else
if
(
a
.
depth
>
b
.
depth
)
{
ancestorsA
.
add
(
a
.
parent
);
return
_pathsToCommonAncestor
(
a
.
parent
,
b
,
ancestorsA
,
ancestorsB
);
}
...
...
packages/flutter/lib/src/rendering/sliver_fixed_extent_list.dart
View file @
a3dc90c4
...
...
@@ -153,7 +153,7 @@ abstract class RenderSliverFixedExtentBoxAdaptor extends RenderSliverMultiBoxAda
int
_calculateLeadingGarbage
(
int
firstIndex
)
{
RenderBox
?
walker
=
firstChild
;
int
leadingGarbage
=
0
;
while
(
walker
!=
null
&&
indexOf
(
walker
)
<
firstIndex
){
while
(
walker
!=
null
&&
indexOf
(
walker
)
<
firstIndex
)
{
leadingGarbage
+=
1
;
walker
=
childAfter
(
walker
);
}
...
...
@@ -163,7 +163,7 @@ abstract class RenderSliverFixedExtentBoxAdaptor extends RenderSliverMultiBoxAda
int
_calculateTrailingGarbage
(
int
targetLastIndex
)
{
RenderBox
?
walker
=
lastChild
;
int
trailingGarbage
=
0
;
while
(
walker
!=
null
&&
indexOf
(
walker
)
>
targetLastIndex
){
while
(
walker
!=
null
&&
indexOf
(
walker
)
>
targetLastIndex
)
{
trailingGarbage
+=
1
;
walker
=
childBefore
(
walker
);
}
...
...
packages/flutter/lib/src/rendering/sliver_multi_box_adaptor.dart
View file @
a3dc90c4
...
...
@@ -248,7 +248,7 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver
/// Verify that the child list index is in strictly increasing order.
///
/// This has no effect in release builds.
bool
_debugVerifyChildOrder
(){
bool
_debugVerifyChildOrder
()
{
if
(
_debugChildIntegrityEnabled
)
{
RenderBox
?
child
=
firstChild
;
int
index
;
...
...
packages/flutter/lib/src/services/raw_keyboard.dart
View file @
a3dc90c4
...
...
@@ -170,7 +170,7 @@ abstract class RawKeyEventData {
if
(
side
!=
null
)
{
result
[
key
]
=
side
;
}
assert
((){
assert
(()
{
if
(
side
==
null
)
{
debugPrint
(
'Raw key data is returning inconsistent information for '
...
...
@@ -767,7 +767,7 @@ class RawKeyboard {
}
}
final
Set
<
PhysicalKeyboardKey
>?
mappedKeys
=
_modifierKeyMap
[
_ModifierSidePair
(
key
,
modifiersPressed
[
key
])];
assert
((){
assert
(()
{
if
(
mappedKeys
==
null
)
{
debugPrint
(
'Platform key support for
${Platform.operatingSystem}
is '
...
...
packages/flutter/lib/src/widgets/animated_list.dart
View file @
a3dc90c4
...
...
@@ -402,7 +402,7 @@ class AnimatedList extends StatefulWidget {
static
AnimatedListState
of
(
BuildContext
context
)
{
assert
(
context
!=
null
);
final
AnimatedListState
?
result
=
context
.
findAncestorStateOfType
<
AnimatedListState
>();
assert
((){
assert
(()
{
if
(
result
==
null
)
{
throw
FlutterError
.
fromParts
(<
DiagnosticsNode
>[
ErrorSummary
(
'AnimatedList.of() called with a context that does not contain an AnimatedList.'
),
...
...
@@ -822,7 +822,7 @@ class SliverAnimatedList extends StatefulWidget {
static
SliverAnimatedListState
of
(
BuildContext
context
)
{
assert
(
context
!=
null
);
final
SliverAnimatedListState
?
result
=
context
.
findAncestorStateOfType
<
SliverAnimatedListState
>();
assert
((){
assert
(()
{
if
(
result
==
null
)
{
throw
FlutterError
(
'SliverAnimatedList.of() called with a context that does not contain a SliverAnimatedList.
\n
'
...
...
packages/flutter/lib/src/widgets/editable_text.dart
View file @
a3dc90c4
...
...
@@ -1836,7 +1836,7 @@ class EditableTextState extends State<EditableText> with AutomaticKeepAliveClien
@override
void
updateFloatingCursor
(
RawFloatingCursorPoint
point
)
{
switch
(
point
.
state
){
switch
(
point
.
state
)
{
case
FloatingCursorDragState
.
Start
:
if
(
_floatingCursorResetController
.
isAnimating
)
{
_floatingCursorResetController
.
stop
();
...
...
packages/flutter/lib/src/widgets/focus_traversal.dart
View file @
a3dc90c4
...
...
@@ -1425,7 +1425,7 @@ class FocusTraversalOrder extends InheritedWidget {
static
FocusOrder
of
(
BuildContext
context
)
{
assert
(
context
!=
null
);
final
FocusTraversalOrder
?
marker
=
context
.
getElementForInheritedWidgetOfExactType
<
FocusTraversalOrder
>()?.
widget
as
FocusTraversalOrder
?;
assert
((){
assert
(()
{
if
(
marker
==
null
)
{
throw
FlutterError
(
'FocusTraversalOrder.of() was called with a context that '
...
...
packages/flutter/lib/src/widgets/navigator.dart
View file @
a3dc90c4
...
...
@@ -3363,7 +3363,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin, Res
@override
void
initState
()
{
super
.
initState
();
assert
((){
assert
(()
{
if
(
widget
.
pages
!=
const
<
Page
<
dynamic
>>[])
{
// This navigator uses page API.
if
(
widget
.
pages
.
isEmpty
)
{
...
...
@@ -3564,7 +3564,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin, Res
@override
void
didUpdateWidget
(
Navigator
oldWidget
)
{
super
.
didUpdateWidget
(
oldWidget
);
assert
((){
assert
(()
{
if
(
widget
.
pages
!=
const
<
Page
<
dynamic
>>[])
{
// This navigator uses page API.
if
(
widget
.
pages
.
isEmpty
)
{
...
...
@@ -3603,7 +3603,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin, Res
_updateEffectiveObservers
();
}
if
(
oldWidget
.
pages
!=
widget
.
pages
&&
!
restorePending
)
{
assert
((){
assert
(()
{
if
(
widget
.
pages
.
isEmpty
)
{
FlutterError
.
reportError
(
FlutterErrorDetails
(
...
...
@@ -3626,7 +3626,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin, Res
}
void
_debugCheckDuplicatedPageKeys
()
{
assert
((){
assert
(()
{
final
Set
<
Key
>
keyReservation
=
<
Key
>{};
for
(
final
Page
<
dynamic
>
page
in
widget
.
pages
)
{
final
LocalKey
?
key
=
page
.
key
;
...
...
@@ -4513,7 +4513,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin, Res
}
bool
_debugCheckIsPagelessRoute
(
Route
<
dynamic
>
route
)
{
assert
((){
assert
(()
{
if
(
route
.
settings
is
Page
)
{
FlutterError
.
reportError
(
FlutterErrorDetails
(
...
...
packages/flutter/lib/src/widgets/platform_view.dart
View file @
a3dc90c4
...
...
@@ -899,7 +899,7 @@ class _PlatformViewLinkState extends State<PlatformViewLink> {
);
}
void
_handlePlatformFocusChanged
(
bool
isFocused
){
void
_handlePlatformFocusChanged
(
bool
isFocused
)
{
if
(
isFocused
)
{
_focusNode
!.
requestFocus
();
}
...
...
packages/flutter/lib/src/widgets/reorderable_list.dart
View file @
a3dc90c4
...
...
@@ -244,7 +244,7 @@ class ReorderableList extends StatefulWidget {
static
ReorderableListState
of
(
BuildContext
context
)
{
assert
(
context
!=
null
);
final
ReorderableListState
?
result
=
context
.
findAncestorStateOfType
<
ReorderableListState
>();
assert
((){
assert
(()
{
if
(
result
==
null
)
{
throw
FlutterError
.
fromParts
(<
DiagnosticsNode
>[
ErrorSummary
(
'ReorderableList.of() called with a context that does not contain a ReorderableList.'
),
...
...
@@ -450,7 +450,7 @@ class SliverReorderableList extends StatefulWidget {
static
SliverReorderableListState
of
(
BuildContext
context
)
{
assert
(
context
!=
null
);
final
SliverReorderableListState
?
result
=
context
.
findAncestorStateOfType
<
SliverReorderableListState
>();
assert
((){
assert
(()
{
if
(
result
==
null
)
{
throw
FlutterError
.
fromParts
(<
DiagnosticsNode
>[
ErrorSummary
(
...
...
packages/flutter/test/material/chip_test.dart
View file @
a3dc90c4
...
...
@@ -197,7 +197,7 @@ Widget _chipWithOptionalDeleteButton({
required
bool
deletable
,
TextDirection
textDirection
=
TextDirection
.
ltr
,
bool
hasDeleteButtonTooltip
=
true
,
}){
})
{
return
_wrapForChip
(
textDirection:
textDirection
,
child:
Wrap
(
...
...
packages/flutter/test/material/dropdown_form_field_test.dart
View file @
a3dc90c4
...
...
@@ -400,7 +400,7 @@ void main() {
testWidgets
(
'DropdownButtonFormField - disabledHint displays when the items list is empty, when items is null'
,
(
WidgetTester
tester
)
async
{
final
Key
buttonKey
=
UniqueKey
();
Widget
build
({
List
<
String
>?
items
}){
Widget
build
({
List
<
String
>?
items
})
{
return
buildFormFrame
(
items:
items
,
buttonKey:
buttonKey
,
...
...
@@ -426,7 +426,7 @@ void main() {
(
WidgetTester
tester
)
async
{
final
Key
buttonKey
=
UniqueKey
();
Widget
build
({
List
<
String
>?
items
}){
Widget
build
({
List
<
String
>?
items
})
{
return
buildFormFrame
(
items:
items
,
buttonKey:
buttonKey
,
...
...
@@ -448,7 +448,7 @@ void main() {
testWidgets
(
'DropdownButtonFormField - disabledHint is null by default'
,
(
WidgetTester
tester
)
async
{
final
Key
buttonKey
=
UniqueKey
();
Widget
build
({
List
<
String
>?
items
}){
Widget
build
({
List
<
String
>?
items
})
{
return
buildFormFrame
(
items:
items
,
buttonKey:
buttonKey
,
...
...
@@ -468,7 +468,7 @@ void main() {
testWidgets
(
'DropdownButtonFormField - disabledHint is null by default'
,
(
WidgetTester
tester
)
async
{
final
Key
buttonKey
=
UniqueKey
();
Widget
build
({
List
<
String
>?
items
}){
Widget
build
({
List
<
String
>?
items
})
{
return
buildFormFrame
(
items:
items
,
buttonKey:
buttonKey
,
...
...
@@ -488,7 +488,7 @@ void main() {
testWidgets
(
'DropdownButtonFormField - disabledHint displays when onChanged is null'
,
(
WidgetTester
tester
)
async
{
final
Key
buttonKey
=
UniqueKey
();
Widget
build
({
List
<
String
>?
items
,
ValueChanged
<
String
?>?
onChanged
}){
Widget
build
({
List
<
String
>?
items
,
ValueChanged
<
String
?>?
onChanged
})
{
return
buildFormFrame
(
items:
items
,
buttonKey:
buttonKey
,
...
...
@@ -506,7 +506,7 @@ void main() {
testWidgets
(
'DropdownButtonFormField - disabled hint should be of same size as enabled hint'
,
(
WidgetTester
tester
)
async
{
final
Key
buttonKey
=
UniqueKey
();
Widget
build
({
List
<
String
>?
items
}){
Widget
build
({
List
<
String
>?
items
})
{
return
buildFormFrame
(
items:
items
,
buttonKey:
buttonKey
,
...
...
packages/flutter/test/material/dropdown_test.dart
View file @
a3dc90c4
...
...
@@ -1557,7 +1557,7 @@ void main() {
(
WidgetTester
tester
)
async
{
final
Key
buttonKey
=
UniqueKey
();
Widget
build
({
List
<
String
>?
items
}){
Widget
build
({
List
<
String
>?
items
})
{
return
buildFrame
(
items:
items
,
buttonKey:
buttonKey
,
...
...
@@ -1579,7 +1579,7 @@ void main() {
testWidgets
(
'DropdownButton disabledHint is null by default'
,
(
WidgetTester
tester
)
async
{
final
Key
buttonKey
=
UniqueKey
();
Widget
build
({
List
<
String
>?
items
}){
Widget
build
({
List
<
String
>?
items
})
{
return
buildFrame
(
items:
items
,
buttonKey:
buttonKey
,
...
...
packages/flutter/test/material/list_tile_test.dart
View file @
a3dc90c4
...
...
@@ -1417,7 +1417,7 @@ void main() {
child:
ListTile
(
key:
tileKey
,
onTap:
enabled
?
()
{
setState
((){
setState
(()
{
tapped
=
true
;
});
}
:
null
,
...
...
packages/flutter/test/material/text_form_field_test.dart
View file @
a3dc90c4
...
...
@@ -121,7 +121,7 @@ void main() {
maxLength:
TextField
.
noMaxLength
,
);
asserted
=
false
;
}
catch
(
e
){
}
catch
(
e
)
{
asserted
=
true
;
}
expect
(
asserted
,
false
);
...
...
packages/flutter/test/painting/text_painter_test.dart
View file @
a3dc90c4
...
...
@@ -835,7 +835,7 @@ void main() {
},
skip:
isBrowser
);
// https://github.com/flutter/flutter/issues/56308
group
(
'TextPainter line-height'
,
()
{
test
(
'half-leading'
,
(){
test
(
'half-leading'
,
()
{
const
TextStyle
style
=
TextStyle
(
height:
20
,
fontSize:
1
,
...
...
@@ -858,7 +858,7 @@ void main() {
expect
(
insets
.
top
,
(
20
-
1
)
/
2
);
});
test
(
'half-leading with small height'
,
(){
test
(
'half-leading with small height'
,
()
{
const
TextStyle
style
=
TextStyle
(
height:
0.1
,
fontSize:
10
,
...
...
@@ -882,7 +882,7 @@ void main() {
expect
(
insets
.
top
,
(
1
-
10
)
/
2
);
});
test
(
'half-leading with leading trim'
,
(){
test
(
'half-leading with leading trim'
,
()
{
const
TextStyle
style
=
TextStyle
(
height:
0.1
,
fontSize:
10
,
...
...
@@ -908,7 +908,7 @@ void main() {
expect
(
glyphBox
.
topLeft
,
Offset
.
zero
);
});
test
(
'TextLeadingDistribution falls back to paragraph style'
,
(){
test
(
'TextLeadingDistribution falls back to paragraph style'
,
()
{
const
TextStyle
style
=
TextStyle
(
height:
20
,
fontSize:
1
);
final
TextPainter
painter
=
TextPainter
()
..
textDirection
=
TextDirection
.
ltr
...
...
@@ -928,7 +928,7 @@ void main() {
expect
(
insets
.
top
,
(
20
-
1
)
/
2
);
});
test
(
'TextLeadingDistribution does nothing if height multiplier is null'
,
(){
test
(
'TextLeadingDistribution does nothing if height multiplier is null'
,
()
{
const
TextStyle
style
=
TextStyle
(
fontSize:
1
);
final
TextPainter
painter
=
TextPainter
()
..
textDirection
=
TextDirection
.
ltr
...
...
packages/flutter/test/rendering/platform_view_test.dart
View file @
a3dc90c4
...
...
@@ -40,7 +40,7 @@ void main() {
expect
(
platformViewRenderBox
.
size
,
const
Size
(
100
,
100
));
});
test
(
'send semantics update if id is changed'
,
(){
test
(
'send semantics update if id is changed'
,
()
{
final
RenderConstrainedBox
tree
=
RenderConstrainedBox
(
additionalConstraints:
const
BoxConstraints
.
tightFor
(
height:
20.0
,
width:
20.0
),
child:
platformViewRenderBox
,
...
...
packages/flutter/test/widgets/framework_test.dart
View file @
a3dc90c4
...
...
@@ -1084,7 +1084,7 @@ void main() {
expect
(
tabController
.
index
,
0
);
// switch tabs 0 -> 1
setState
((){
setState
(()
{
tabController
.
index
=
1
;
});
...
...
@@ -1093,7 +1093,7 @@ void main() {
expect
(
tabController
.
index
,
1
);
// rebuild TabBarView that only have the 1st page with GlobalKey 'key1'
setState
((){
setState
(()
{
tabBarViewCnt
=
1
;
tabController
=
TabController
(
length:
tabBarViewCnt
,
vsync:
const
TestVSync
());
});
...
...
packages/flutter/test/widgets/interactive_viewer_test.dart
View file @
a3dc90c4
...
...
@@ -635,15 +635,15 @@ void main() {
body:
Center
(
child:
InteractiveViewer
(
transformationController:
transformationController
,
onInteractionStart:
(
ScaleStartDetails
details
){
onInteractionStart:
(
ScaleStartDetails
details
)
{
calledStart
=
true
;
},
onInteractionUpdate:
(
ScaleUpdateDetails
details
){
onInteractionUpdate:
(
ScaleUpdateDetails
details
)
{
scaleChange
=
details
.
scale
;
focalPoint
=
details
.
focalPoint
;
localFocalPoint
=
details
.
localFocalPoint
;
},
onInteractionEnd:
(
ScaleEndDetails
details
){
onInteractionEnd:
(
ScaleEndDetails
details
)
{
currentVelocity
=
details
.
velocity
;
},
child:
const
SizedBox
(
width:
200.0
,
height:
200.0
),
...
...
packages/flutter/test/widgets/navigator_test.dart
View file @
a3dc90c4
...
...
@@ -780,7 +780,7 @@ void main() {
),
'/A/B'
:
(
BuildContext
context
)
=>
OnTapPage
(
id:
'B'
,
onTap:
(){
onTap:
()
{
Navigator
.
of
(
context
).
popUntil
((
Route
<
dynamic
>
route
)
=>
route
.
isFirst
);
Navigator
.
of
(
context
).
pushReplacementNamed
(
'/C'
);
},
...
...
@@ -847,7 +847,7 @@ void main() {
),
'/A/B'
:
(
BuildContext
context
)
=>
OnTapPage
(
id:
'B'
,
onTap:
(){
onTap:
()
{
// Pops all routes with bad predicate.
Navigator
.
of
(
context
).
popUntil
((
Route
<
dynamic
>
route
)
=>
false
);
},
...
...
@@ -2543,7 +2543,7 @@ void main() {
);
});
group
(
'Page api'
,
(){
group
(
'Page api'
,
()
{
Widget
buildNavigator
({
required
List
<
Page
<
dynamic
>>
pages
,
required
PopPageCallback
onPopPage
,
...
...
@@ -2650,7 +2650,7 @@ void main() {
final
Map
<
String
,
WidgetBuilder
>
routes
=
<
String
,
WidgetBuilder
>{
'/'
:
(
BuildContext
context
)
=>
OnTapPage
(
id:
action
,
onTap:
(){
onTap:
()
{
if
(
action
==
'push'
)
{
Navigator
.
of
(
context
).
push
(
myPage
.
createRoute
(
context
));
}
else
if
(
action
==
'pushReplacement'
)
{
...
...
packages/flutter/test/widgets/router_test.dart
View file @
a3dc90c4
...
...
@@ -1080,7 +1080,7 @@ testWidgets('ChildBackButtonDispatcher take priority recursively', (WidgetTester
));
// Only update BackButtonListener widget.
setState
((){
setState
(()
{
location
=
'second callback'
;
});
...
...
packages/flutter/test/widgets/scroll_view_test.dart
View file @
a3dc90c4
...
...
@@ -278,7 +278,7 @@ void main() {
gridDelegate:
const
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
),
keyboardDismissBehavior:
ScrollViewKeyboardDismissBehavior
.
onDrag
,
itemCount:
focusNodes
.
length
,
itemBuilder:
(
BuildContext
context
,
int
index
){
itemBuilder:
(
BuildContext
context
,
int
index
)
{
return
Container
(
height:
50
,
color:
Colors
.
green
,
...
...
@@ -590,7 +590,7 @@ void main() {
gridDelegate:
const
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
),
keyboardDismissBehavior:
ScrollViewKeyboardDismissBehavior
.
manual
,
itemCount:
focusNodes
.
length
,
itemBuilder:
(
BuildContext
context
,
int
index
){
itemBuilder:
(
BuildContext
context
,
int
index
)
{
return
Container
(
height:
50
,
color:
Colors
.
green
,
...
...
packages/flutter/test/widgets/selectable_text_test.dart
View file @
a3dc90c4
...
...
@@ -4648,7 +4648,7 @@ void main() {
MaterialApp
(
home:
SelectableText
(
' blah blah'
,
onSelectionChanged:
(
TextSelection
newSelection
,
SelectionChangedCause
?
cause
){
onSelectionChanged:
(
TextSelection
newSelection
,
SelectionChangedCause
?
cause
)
{
selection
=
newSelection
;
},
),
...
...
@@ -4694,7 +4694,7 @@ void main() {
child:
Center
(
child:
SelectableText
(
' blah blah'
,
onSelectionChanged:
(
TextSelection
newSelection
,
SelectionChangedCause
?
cause
){
onSelectionChanged:
(
TextSelection
newSelection
,
SelectionChangedCause
?
cause
)
{
selection
=
newSelection
;
},
),
...
...
@@ -4747,7 +4747,7 @@ void main() {
child:
Center
(
child:
SelectableText
(
' blah blah
\n
blah'
,
onSelectionChanged:
(
TextSelection
newSelection
,
SelectionChangedCause
?
cause
){
onSelectionChanged:
(
TextSelection
newSelection
,
SelectionChangedCause
?
cause
)
{
selection
=
newSelection
;
},
),
...
...
packages/flutter_test/test/live_binding_test.dart
View file @
a3dc90c4
...
...
@@ -23,7 +23,7 @@ void main() {
PointerHoverEvent
?
hoverEvent
;
await
tester
.
pumpWidget
(
MaterialApp
(
home:
MouseRegion
(
child:
const
Text
(
'Test'
),
onHover:
(
PointerHoverEvent
event
){
onHover:
(
PointerHoverEvent
event
)
{
hoverEvent
=
event
;
},
)));
...
...
packages/flutter_test/test/widget_tester_test.dart
View file @
a3dc90c4
...
...
@@ -706,11 +706,11 @@ void main() {
int
numberOfVariationsRun
=
0
;
TargetPlatform
?
origTargetPlatform
;
setUpAll
((){
setUpAll
(()
{
origTargetPlatform
=
debugDefaultTargetPlatformOverride
;
});
tearDownAll
((){
tearDownAll
(()
{
expect
(
debugDefaultTargetPlatformOverride
,
equals
(
origTargetPlatform
));
});
...
...
packages/flutter_tools/lib/src/cache.dart
View file @
a3dc90c4
...
...
@@ -1106,7 +1106,7 @@ class ArtifactUpdater {
}
@visibleForTesting
String
flattenNameSubdirs
(
Uri
url
,
FileSystem
fileSystem
){
String
flattenNameSubdirs
(
Uri
url
,
FileSystem
fileSystem
)
{
final
List
<
String
>
pieces
=
<
String
>[
url
.
host
,
...
url
.
pathSegments
];
final
Iterable
<
String
>
convertedPieces
=
pieces
.
map
<
String
>(
_flattenNameNoSubdirs
);
return
fileSystem
.
path
.
joinAll
(
convertedPieces
);
...
...
packages/flutter_tools/lib/src/commands/channel.dart
View file @
a3dc90c4
...
...
@@ -96,7 +96,7 @@ class ChannelCommand extends FlutterCommand {
// only print non-missing channels
if
(
availableChannels
[
i
])
{
String
currentIndicator
=
' '
;
if
(
officialChannels
[
i
]
==
currentChannel
){
if
(
officialChannels
[
i
]
==
currentChannel
)
{
currentIndicator
=
'*'
;
}
globals
.
printStatus
(
'
$currentIndicator
${officialChannels[i]}
'
);
...
...
packages/flutter_tools/lib/src/commands/create.dart
View file @
a3dc90c4
...
...
@@ -308,7 +308,7 @@ class CreateCommand extends CreateBase {
_printPluginDirectoryLocationMessage
(
relativePluginPath
,
projectName
,
platformsString
);
if
(!
creatingNewProject
&&
requestedPlatforms
.
isNotEmpty
)
{
_printPluginUpdatePubspecMessage
(
relativePluginPath
,
platformsString
);
}
else
if
(
_getSupportedPlatformsInPlugin
(
projectDir
).
isEmpty
){
}
else
if
(
_getSupportedPlatformsInPlugin
(
projectDir
).
isEmpty
)
{
_printNoPluginMessage
();
}
...
...
packages/flutter_tools/lib/src/device.dart
View file @
a3dc90c4
...
...
@@ -266,7 +266,7 @@ abstract class DeviceManager {
.
where
((
Device
device
)
=>
device
.
ephemeral
==
true
)
.
toList
();
if
(
ephemeralDevices
.
length
==
1
){
if
(
ephemeralDevices
.
length
==
1
)
{
devices
=
ephemeralDevices
;
}
}
...
...
packages/flutter_tools/lib/src/drive/web_driver_service.dart
View file @
a3dc90c4
...
...
@@ -279,7 +279,7 @@ Map<String, dynamic> getDesiredCapabilities(Browser browser, bool headless, [Str
}
/// Converts [browserName] string to [Browser]
Browser
_browserNameToEnum
(
String
browserName
){
Browser
_browserNameToEnum
(
String
browserName
)
{
switch
(
browserName
)
{
case
'android-chrome'
:
return
Browser
.
androidChrome
;
case
'chrome'
:
return
Browser
.
chrome
;
...
...
packages/flutter_tools/test/general.shard/plugins_test.dart
View file @
a3dc90c4
...
...
@@ -834,7 +834,7 @@ dependencies:
const
String
newPluginName
=
'flutterEngine.getPlugins().add(new plugin1.UseNewEmbedding());'
;
const
String
oldPluginName
=
'abcplugin1.UseOldEmbedding.registerWith(shimPluginRegistry.registrarFor("abcplugin1.UseOldEmbedding"));'
;
final
String
content
=
registrant
.
readAsStringSync
();
for
(
final
String
plugin
in
<
String
>[
newPluginName
,
oldPluginName
]){
for
(
final
String
plugin
in
<
String
>[
newPluginName
,
oldPluginName
])
{
expect
(
content
,
contains
(
plugin
));
expect
(
content
.
split
(
plugin
).
first
.
trim
().
endsWith
(
'try {'
),
isTrue
);
expect
(
content
.
split
(
plugin
).
last
.
trim
().
startsWith
(
'} catch(Exception e) {'
),
isTrue
);
...
...
packages/flutter_tools/test/general.shard/project_test.dart
View file @
a3dc90c4
...
...
@@ -277,7 +277,7 @@ void main() {
expectExists
(
pluginRegistrantClasses
.
childFile
(
'GeneratedPluginRegistrant.m'
));
});
testUsingContext
(
'Version.json info is correct'
,
(){
testUsingContext
(
'Version.json info is correct'
,
()
{
final
MemoryFileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
FlutterManifest
manifest
=
FlutterManifest
.
createFromString
(
'''
name: test
...
...
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