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
5e1ba701
Unverified
Commit
5e1ba701
authored
May 16, 2023
by
Michael Goderbauer
Committed by
GitHub
May 16, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable no_literal_bool_comparisons lint (#126647)
parent
b45f9b36
Changes
46
Hide whitespace changes
Inline
Side-by-side
Showing
46 changed files
with
79 additions
and
79 deletions
+79
-79
analysis_options.yaml
analysis_options.yaml
+1
-1
test.dart
dev/bots/test.dart
+1
-1
codesign.dart
dev/conductor/core/lib/src/codesign.dart
+1
-1
next.dart
dev/conductor/core/lib/src/next.dart
+7
-7
run.dart
dev/devicelab/bin/run.dart
+2
-2
nav_bar.dart
packages/flutter/lib/src/cupertino/nav_bar.dart
+1
-1
assertions.dart
packages/flutter/lib/src/foundation/assertions.dart
+1
-1
diagnostics.dart
packages/flutter/lib/src/foundation/diagnostics.dart
+1
-1
events.dart
packages/flutter/lib/src/gestures/events.dart
+3
-3
long_press.dart
packages/flutter/lib/src/gestures/long_press.dart
+1
-1
multitap.dart
packages/flutter/lib/src/gestures/multitap.dart
+1
-1
chip.dart
packages/flutter/lib/src/material/chip.dart
+5
-5
selectable_text.dart
packages/flutter/lib/src/material/selectable_text.dart
+1
-1
slider_theme.dart
packages/flutter/lib/src/material/slider_theme.dart
+2
-2
text_field.dart
packages/flutter/lib/src/material/text_field.dart
+1
-1
debug.dart
packages/flutter/lib/src/painting/debug.dart
+1
-1
inline_span.dart
packages/flutter/lib/src/painting/inline_span.dart
+1
-1
sliver_multi_box_adaptor.dart
...s/flutter/lib/src/rendering/sliver_multi_box_adaptor.dart
+1
-1
platform_views.dart
packages/flutter/lib/src/services/platform_views.dart
+2
-2
actions.dart
packages/flutter/lib/src/widgets/actions.dart
+1
-1
routes.dart
packages/flutter/lib/src/widgets/routes.dart
+1
-1
visibility.dart
packages/flutter/lib/src/widgets/visibility.dart
+8
-8
widget_inspector.dart
packages/flutter/lib/src/widgets/widget_inspector.dart
+2
-2
image_test.dart
packages/flutter/test/widgets/image_test.dart
+1
-1
widget_tester.dart
packages/flutter_test/lib/src/widget_tester.dart
+2
-2
build.dart
packages/flutter_tools/lib/src/base/build.dart
+1
-1
logger.dart
packages/flutter_tools/lib/src/base/logger.dart
+1
-1
custom_devices.dart
packages/flutter_tools/lib/src/commands/custom_devices.dart
+2
-2
compile.dart
packages/flutter_tools/lib/src/compile.dart
+1
-1
custom_device.dart
...s/flutter_tools/lib/src/custom_devices/custom_device.dart
+2
-2
desktop_device.dart
packages/flutter_tools/lib/src/desktop_device.dart
+1
-1
device.dart
packages/flutter_tools/lib/src/device.dart
+2
-2
doctor.dart
packages/flutter_tools/lib/src/doctor.dart
+1
-1
emulator.dart
packages/flutter_tools/lib/src/emulator.dart
+2
-2
devices.dart
packages/flutter_tools/lib/src/ios/devices.dart
+1
-1
xcodeproj.dart
packages/flutter_tools/lib/src/ios/xcodeproj.dart
+2
-2
cmake_custom_command_migration.dart
...ls/lib/src/migrations/cmake_custom_command_migration.dart
+1
-1
devices.dart
packages/flutter_tools/lib/src/proxied_devices/devices.dart
+1
-1
flutter_command.dart
packages/flutter_tools/lib/src/runner/flutter_command.dart
+1
-1
xcode_project.dart
packages/flutter_tools/lib/src/xcode_project.dart
+1
-1
analyze_continuously_test.dart
...st/commands.shard/hermetic/analyze_continuously_test.dart
+3
-3
clean_test.dart
...lutter_tools/test/commands.shard/hermetic/clean_test.dart
+1
-1
create_usage_test.dart
...tools/test/commands.shard/hermetic/create_usage_test.dart
+1
-1
run_test.dart
.../flutter_tools/test/commands.shard/hermetic/run_test.dart
+2
-2
args_test.dart
packages/flutter_tools/test/general.shard/args_test.dart
+1
-1
channel_test.dart
packages/flutter_tools/test/general.shard/channel_test.dart
+2
-2
No files found.
analysis_options.yaml
View file @
5e1ba701
...
...
@@ -127,7 +127,7 @@ linter:
-
no_duplicate_case_values
-
no_leading_underscores_for_library_prefixes
-
no_leading_underscores_for_local_identifiers
# - no_literal_bool_comparisons # needs quick fix, https://github.com/dart-lang/linter/issues/4333
-
no_literal_bool_comparisons
-
no_logic_in_create_state
# - no_runtimeType_toString # ok in tests; we enable this only in packages/
-
non_constant_identifier_names
...
...
dev/bots/test.dart
View file @
5e1ba701
...
...
@@ -809,7 +809,7 @@ Future<void> _runFrameworkTests() async {
final
List
<
String
>
tests
=
Directory
(
path
.
join
(
flutterRoot
,
'packages'
,
'flutter'
,
'test'
))
.
listSync
(
followLinks:
false
)
.
whereType
<
Directory
>()
.
where
((
Directory
dir
)
=>
dir
.
path
.
endsWith
(
'widgets'
)
==
false
)
.
where
((
Directory
dir
)
=>
!
dir
.
path
.
endsWith
(
'widgets'
)
)
.
map
<
String
>((
Directory
dir
)
=>
path
.
join
(
'test'
,
path
.
basename
(
dir
.
path
))
+
path
.
separator
)
.
toList
();
printProgress
(
'
${green}
Running packages/flutter tests
$reset
for
$cyan${tests.join(", ")}$reset
'
);
...
...
dev/conductor/core/lib/src/codesign.dart
View file @
5e1ba701
...
...
@@ -99,7 +99,7 @@ class CodesignCommand extends Command<void> {
);
}
if
(
argResults
![
'verify'
]
as
bool
!=
true
)
{
if
(
!(
argResults
![
'verify'
]
as
bool
)
)
{
throw
ConductorException
(
'Sorry, but codesigning is not implemented yet. Please pass the '
'--
$kVerify
flag to verify signatures.'
,
...
...
dev/conductor/core/lib/src/next.dart
View file @
5e1ba701
...
...
@@ -128,7 +128,7 @@ class NextContext extends Context {
stdio
.
printStatus
(
'These must be applied manually in the directory '
'
${state.engine.checkoutPath}
before proceeding.
\n
'
);
}
if
(
autoAccept
==
false
)
{
if
(
!
autoAccept
)
{
final
bool
response
=
await
prompt
(
'Are you ready to push your engine branch to the repository '
'
${state.engine.mirror.url}
?'
,
...
...
@@ -146,7 +146,7 @@ class NextContext extends Context {
'You must validate pre-submit CI for your engine PR, merge it, and codesign'
,
'binaries before proceeding.
\n
'
,
].
join
(
'
\n
'
));
if
(
autoAccept
==
false
)
{
if
(
!
autoAccept
)
{
// TODO(fujino): actually test if binaries have been codesigned on macOS
final
bool
response
=
await
prompt
(
'Has CI passed for the engine PR and binaries been codesigned?'
,
...
...
@@ -236,7 +236,7 @@ class NextContext extends Context {
);
}
if
(
autoAccept
==
false
)
{
if
(
!
autoAccept
)
{
final
bool
response
=
await
prompt
(
'Are you ready to push your framework branch to the repository '
'
${state.framework.mirror.url}
?'
,
...
...
@@ -276,7 +276,7 @@ class NextContext extends Context {
previousCheckoutLocation:
state
.
engine
.
checkoutPath
,
);
final
String
engineHead
=
await
engine
.
reverseParse
(
'HEAD'
);
if
(
autoAccept
==
false
)
{
if
(
!
autoAccept
)
{
final
bool
response
=
await
prompt
(
'Are you ready to tag commit
$frameworkHead
as
${state.releaseVersion}
\n
'
'and push to remote
${state.framework.upstream.url}
?'
,
...
...
@@ -302,7 +302,7 @@ class NextContext extends Context {
previousCheckoutLocation:
state
.
framework
.
checkoutPath
,
);
final
String
headRevision
=
await
framework
.
reverseParse
(
'HEAD'
);
if
(
autoAccept
==
false
)
{
if
(
!
autoAccept
)
{
// dryRun: true means print out git command
await
framework
.
pushRef
(
fromRef:
headRevision
,
...
...
@@ -332,7 +332,7 @@ class NextContext extends Context {
'The current status of packaging builds can be seen at:
\n
'
'
\t
$kLuciPackagingConsoleLink
'
,
);
if
(
autoAccept
==
false
)
{
if
(
!
autoAccept
)
{
final
bool
response
=
await
prompt
(
'Have all packaging builds finished successfully and post release announcements been completed?'
);
if
(!
response
)
{
...
...
@@ -373,7 +373,7 @@ class NextContext extends Context {
force:
force
,
);
}
on
GitException
catch
(
exception
)
{
if
(
exception
.
type
==
GitExceptionType
.
PushRejected
&&
force
==
fals
e
)
{
if
(
exception
.
type
==
GitExceptionType
.
PushRejected
&&
!
forc
e
)
{
throw
ConductorException
(
'Push failed because the working branch named '
'
${pbRepository.workingBranch}
already exists on your mirror. '
...
...
dev/devicelab/bin/run.dart
View file @
5e1ba701
...
...
@@ -176,7 +176,7 @@ Future<void> _runABTest({
abTest
.
addBResult
(
localEngineResult
);
if
(
silent
!=
true
&&
i
<
runsPerTest
)
{
if
(
!
silent
&&
i
<
runsPerTest
)
{
section
(
'A/B results so far'
);
print
(
abTest
.
printSummary
());
}
...
...
@@ -186,7 +186,7 @@ Future<void> _runABTest({
final
File
jsonFile
=
_uniqueFile
(
resultsFile
);
jsonFile
.
writeAsStringSync
(
const
JsonEncoder
.
withIndent
(
' '
).
convert
(
abTest
.
jsonMap
));
if
(
silent
!=
true
)
{
if
(
!
silent
)
{
section
(
'Raw results'
);
print
(
abTest
.
rawResults
());
}
...
...
packages/flutter/lib/src/cupertino/nav_bar.dart
View file @
5e1ba701
...
...
@@ -602,7 +602,7 @@ class CupertinoSliverNavigationBar extends StatefulWidget {
this
.
heroTag
=
_defaultHeroTag
,
this
.
stretch
=
false
,
})
:
assert
(
automaticallyImplyTitle
==
true
||
largeTitle
!=
null
,
automaticallyImplyTitle
||
largeTitle
!=
null
,
'No largeTitle has been provided but automaticallyImplyTitle is also '
'false. Either provide a largeTitle or set automaticallyImplyTitle to '
'true.'
,
...
...
packages/flutter/lib/src/foundation/assertions.dart
View file @
5e1ba701
...
...
@@ -1009,7 +1009,7 @@ class FlutterError extends Error with DiagnosticableTreeMixin implements Asserti
isInDebugMode
=
true
;
return
true
;
}());
final
bool
reportError
=
isInDebugMode
||
details
.
silent
!=
true
;
// could be null
final
bool
reportError
=
isInDebugMode
||
!
details
.
silent
;
// could be null
if
(!
reportError
&&
!
forceReport
)
{
return
;
}
...
...
packages/flutter/lib/src/foundation/diagnostics.dart
View file @
5e1ba701
...
...
@@ -1616,7 +1616,7 @@ abstract class DiagnosticsNode {
'showSeparator'
:
showSeparator
,
if
(
level
!=
DiagnosticLevel
.
info
)
'level'
:
level
.
name
,
if
(
showName
==
fals
e
)
if
(
!
showNam
e
)
'showName'
:
showName
,
if
(
emptyBodyDescription
!=
null
)
'emptyBodyDescription'
:
emptyBodyDescription
,
...
...
packages/flutter/lib/src/gestures/events.dart
View file @
5e1ba701
...
...
@@ -205,9 +205,9 @@ int smallestButton(int buttons) => buttons & (-buttons);
/// Example:
///
/// ```dart
/// assert(isSingleButton(0x1)
== true
);
/// assert(
isSingleButton(0x11) == false
);
/// assert(
isSingleButton(0) == false
);
/// assert(isSingleButton(0x1));
/// assert(
!isSingleButton(0x11)
);
/// assert(
!isSingleButton(0)
);
/// ```
///
/// See also:
...
...
packages/flutter/lib/src/gestures/long_press.dart
View file @
5e1ba701
...
...
@@ -629,7 +629,7 @@ class LongPressGestureRecognizer extends PrimaryPointerGestureRecognizer {
}
if
(
event
is
PointerUpEvent
)
{
if
(
_longPressAccepted
==
true
)
{
if
(
_longPressAccepted
)
{
_checkLongPressEnd
(
event
);
}
else
{
// Pointer is lifted before timeout.
...
...
packages/flutter/lib/src/gestures/multitap.dart
View file @
5e1ba701
...
...
@@ -208,7 +208,7 @@ class DoubleTapGestureRecognizer extends GestureRecognizer {
// If second tap is not allowed, reset the state.
final
bool
isPointerAllowed
=
super
.
isPointerAllowed
(
event
);
if
(
isPointerAllowed
==
false
)
{
if
(
!
isPointerAllowed
)
{
_reset
();
}
return
isPointerAllowed
;
...
...
packages/flutter/lib/src/material/chip.dart
View file @
5e1ba701
...
...
@@ -875,7 +875,7 @@ class _RawChipState extends State<RawChip> with MaterialStateMixin, TickerProvid
setMaterialState
(
MaterialState
.
selected
,
widget
.
selected
);
selectController
=
AnimationController
(
duration:
_kSelectDuration
,
value:
widget
.
selected
==
true
?
1.0
:
0.0
,
value:
widget
.
selected
?
1.0
:
0.0
,
vsync:
this
,
);
selectionFade
=
CurvedAnimation
(
...
...
@@ -884,7 +884,7 @@ class _RawChipState extends State<RawChip> with MaterialStateMixin, TickerProvid
);
avatarDrawerController
=
AnimationController
(
duration:
_kDrawerDuration
,
value:
hasAvatar
||
widget
.
selected
==
true
?
1.0
:
0.0
,
value:
hasAvatar
||
widget
.
selected
?
1.0
:
0.0
,
vsync:
this
,
);
deleteDrawerController
=
AnimationController
(
...
...
@@ -1042,7 +1042,7 @@ class _RawChipState extends State<RawChip> with MaterialStateMixin, TickerProvid
}
if
(
oldWidget
.
avatar
!=
widget
.
avatar
||
oldWidget
.
selected
!=
widget
.
selected
)
{
setState
(()
{
if
(
hasAvatar
||
widget
.
selected
==
true
)
{
if
(
hasAvatar
||
widget
.
selected
)
{
avatarDrawerController
.
forward
();
}
else
{
avatarDrawerController
.
reverse
();
...
...
@@ -1052,7 +1052,7 @@ class _RawChipState extends State<RawChip> with MaterialStateMixin, TickerProvid
if
(
oldWidget
.
selected
!=
widget
.
selected
)
{
setState
(()
{
setMaterialState
(
MaterialState
.
selected
,
widget
.
selected
);
if
(
widget
.
selected
==
true
)
{
if
(
widget
.
selected
)
{
selectController
.
forward
();
}
else
{
selectController
.
reverse
();
...
...
@@ -1979,7 +1979,7 @@ class _RenderChip extends RenderBox with SlottedContainerRenderObjectMixin<_Chip
_paintSelectionOverlay
(
context
,
offset
);
}
if
(
theme
.
showAvatar
==
false
&&
avatarDrawerAnimation
.
isDismissed
)
{
if
(
!
theme
.
showAvatar
&&
avatarDrawerAnimation
.
isDismissed
)
{
return
;
}
final
Color
disabledColor
=
_disabledColor
;
...
...
packages/flutter/lib/src/material/selectable_text.dart
View file @
5e1ba701
...
...
@@ -607,7 +607,7 @@ class _SelectableTextState extends State<SelectableText> implements TextSelectio
assert
(
debugCheckHasMediaQuery
(
context
));
assert
(
debugCheckHasDirectionality
(
context
));
assert
(
!(
widget
.
style
!=
null
&&
widget
.
style
!.
inherit
==
false
&&
!(
widget
.
style
!=
null
&&
!
widget
.
style
!.
inherit
&&
(
widget
.
style
!.
fontSize
==
null
||
widget
.
style
!.
textBaseline
==
null
)),
'inherit false style must supply fontSize and textBaseline'
,
);
...
...
packages/flutter/lib/src/material/slider_theme.dart
View file @
5e1ba701
...
...
@@ -2335,7 +2335,7 @@ class RoundSliderThumbShape extends SliderComponentShape {
@override
Size
getPreferredSize
(
bool
isEnabled
,
bool
isDiscrete
)
{
return
Size
.
fromRadius
(
isEnabled
==
true
?
enabledThumbRadius
:
_disabledThumbRadius
);
return
Size
.
fromRadius
(
isEnabled
?
enabledThumbRadius
:
_disabledThumbRadius
);
}
@override
...
...
@@ -2444,7 +2444,7 @@ class RoundRangeSliderThumbShape extends RangeSliderThumbShape {
@override
Size
getPreferredSize
(
bool
isEnabled
,
bool
isDiscrete
)
{
return
Size
.
fromRadius
(
isEnabled
==
true
?
enabledThumbRadius
:
_disabledThumbRadius
);
return
Size
.
fromRadius
(
isEnabled
?
enabledThumbRadius
:
_disabledThumbRadius
);
}
@override
...
...
packages/flutter/lib/src/material/text_field.dart
View file @
5e1ba701
...
...
@@ -1234,7 +1234,7 @@ class _TextFieldState extends State<TextField> with RestorationMixin implements
assert
(
debugCheckHasMaterialLocalizations
(
context
));
assert
(
debugCheckHasDirectionality
(
context
));
assert
(
!(
widget
.
style
!=
null
&&
widget
.
style
!.
inherit
==
false
&&
!(
widget
.
style
!=
null
&&
!
widget
.
style
!.
inherit
&&
(
widget
.
style
!.
fontSize
==
null
||
widget
.
style
!.
textBaseline
==
null
)),
'inherit false style must supply fontSize and textBaseline'
,
);
...
...
packages/flutter/lib/src/painting/debug.dart
View file @
5e1ba701
...
...
@@ -185,7 +185,7 @@ bool debugAssertAllPaintingVarsUnset(String reason, { bool debugDisableShadowsOv
if
(
debugDisableShadows
!=
debugDisableShadowsOverride
||
debugNetworkImageHttpClientProvider
!=
null
||
debugOnPaintImage
!=
null
||
debugInvertOversizedImages
==
true
||
debugInvertOversizedImages
||
debugImageOverheadAllowance
!=
_imageOverheadAllowanceDefault
)
{
throw
FlutterError
(
reason
);
}
...
...
packages/flutter/lib/src/painting/inline_span.dart
View file @
5e1ba701
...
...
@@ -60,7 +60,7 @@ class InlineSpanSemanticsInformation {
this
.
semanticsLabel
,
this
.
stringAttributes
=
const
<
ui
.
StringAttribute
>[],
this
.
recognizer
,
})
:
assert
(
isPlaceholder
==
false
||
(
text
==
'
\
uFFFC'
&&
semanticsLabel
==
null
&&
recognizer
==
null
)),
})
:
assert
(
!
isPlaceholder
||
(
text
==
'
\
uFFFC'
&&
semanticsLabel
==
null
&&
recognizer
==
null
)),
requiresOwnNode
=
isPlaceholder
||
recognizer
!=
null
;
/// The text info for a [PlaceholderSpan].
...
...
packages/flutter/lib/src/rendering/sliver_multi_box_adaptor.dart
View file @
5e1ba701
...
...
@@ -151,7 +151,7 @@ class SliverMultiBoxAdaptorParentData extends SliverLogicalParentData with Conta
bool
_keptAlive
=
false
;
@override
String
toString
()
=>
'index=
$index
;
${keepAlive
== true
? "keepAlive; " : ""}${super.toString()}
'
;
String
toString
()
=>
'index=
$index
;
${keepAlive ? "keepAlive; " : ""}${super.toString()}
'
;
}
/// A sliver with multiple box children.
...
...
packages/flutter/lib/src/services/platform_views.dart
View file @
5e1ba701
...
...
@@ -1158,10 +1158,10 @@ abstract class _AndroidViewControllerInternals {
'id'
:
viewId
,
'viewType'
:
viewType
,
'direction'
:
AndroidViewController
.
_getAndroidDirection
(
layoutDirection
),
if
(
hybrid
==
true
)
'hybrid'
:
hybrid
,
if
(
hybrid
)
'hybrid'
:
hybrid
,
if
(
size
!=
null
)
'width'
:
size
.
width
,
if
(
size
!=
null
)
'height'
:
size
.
height
,
if
(
hybridFallback
==
true
)
'hybridFallback'
:
hybridFallback
,
if
(
hybridFallback
)
'hybridFallback'
:
hybridFallback
,
if
(
position
!=
null
)
'left'
:
position
.
dx
,
if
(
position
!=
null
)
'top'
:
position
.
dy
,
};
...
...
packages/flutter/lib/src/widgets/actions.dart
View file @
5e1ba701
...
...
@@ -690,7 +690,7 @@ class Actions extends StatefulWidget {
static
bool
_visitActionsAncestors
(
BuildContext
context
,
bool
Function
(
InheritedElement
element
)
visitor
)
{
InheritedElement
?
actionsElement
=
context
.
getElementForInheritedWidgetOfExactType
<
_ActionsScope
>();
while
(
actionsElement
!=
null
)
{
if
(
visitor
(
actionsElement
)
==
true
)
{
if
(
visitor
(
actionsElement
))
{
break
;
}
// _getParent is needed here because
...
...
packages/flutter/lib/src/widgets/routes.dart
View file @
5e1ba701
...
...
@@ -1499,7 +1499,7 @@ abstract class ModalRoute<T> extends TransitionRoute<T> with LocalHistoryRoute<T
final
_ModalScopeState
<
T
>?
scope
=
_scopeKey
.
currentState
;
assert
(
scope
!=
null
);
for
(
final
WillPopCallback
callback
in
List
<
WillPopCallback
>.
of
(
_willPopCallbacks
))
{
if
(
await
callback
()
!=
true
)
{
if
(
!
await
callback
()
)
{
return
RoutePopDisposition
.
doNotPop
;
}
}
...
...
packages/flutter/lib/src/widgets/visibility.dart
View file @
5e1ba701
...
...
@@ -64,19 +64,19 @@ class Visibility extends StatelessWidget {
this
.
maintainSemantics
=
false
,
this
.
maintainInteractivity
=
false
,
})
:
assert
(
maintainState
==
true
||
maintainAnimation
==
false
,
maintainState
||
!
maintainAnimation
,
'Cannot maintain animations if the state is not also maintained.'
,
),
assert
(
maintainAnimation
==
true
||
maintainSize
==
fals
e
,
maintainAnimation
||
!
maintainSiz
e
,
'Cannot maintain size if animations are not maintained.'
,
),
assert
(
maintainSize
==
true
||
maintainSemantics
==
false
,
maintainSize
||
!
maintainSemantics
,
'Cannot maintain semantics if size is not maintained.'
,
),
assert
(
maintainSize
==
true
||
maintainInteractivity
==
false
,
maintainSize
||
!
maintainInteractivity
,
'Cannot maintain interactivity if size is not maintained.'
,
);
...
...
@@ -354,19 +354,19 @@ class SliverVisibility extends StatelessWidget {
this
.
maintainSemantics
=
false
,
this
.
maintainInteractivity
=
false
,
})
:
assert
(
maintainState
==
true
||
maintainAnimation
==
false
,
maintainState
||
!
maintainAnimation
,
'Cannot maintain animations if the state is not also maintained.'
,
),
assert
(
maintainAnimation
==
true
||
maintainSize
==
fals
e
,
maintainAnimation
||
!
maintainSiz
e
,
'Cannot maintain size if animations are not maintained.'
,
),
assert
(
maintainSize
==
true
||
maintainSemantics
==
false
,
maintainSize
||
!
maintainSemantics
,
'Cannot maintain semantics if size is not maintained.'
,
),
assert
(
maintainSize
==
true
||
maintainInteractivity
==
false
,
maintainSize
||
!
maintainInteractivity
,
'Cannot maintain interactivity if size is not maintained.'
,
);
...
...
packages/flutter/lib/src/widgets/widget_inspector.dart
View file @
5e1ba701
...
...
@@ -3010,7 +3010,7 @@ class _InspectorOverlayLayer extends Layer {
inDebugMode
=
true
;
return
true
;
}());
if
(
inDebugMode
==
fals
e
)
{
if
(
!
inDebugMod
e
)
{
throw
FlutterError
.
fromParts
(<
DiagnosticsNode
>[
ErrorSummary
(
'The inspector should never be used in production mode due to the '
...
...
@@ -3627,7 +3627,7 @@ class InspectorSerializationDelegate implements DiagnosticsSerializationDelegate
@override
List
<
DiagnosticsNode
>
truncateNodesList
(
List
<
DiagnosticsNode
>
nodes
,
DiagnosticsNode
?
owner
)
{
if
(
maxDescendantsTruncatableNode
>=
0
&&
owner
!.
allowTruncate
==
true
&&
owner
!.
allowTruncate
&&
nodes
.
length
>
maxDescendantsTruncatableNode
)
{
nodes
=
service
.
_truncateNodes
(
nodes
,
maxDescendantsTruncatableNode
);
}
...
...
packages/flutter/test/widgets/image_test.dart
View file @
5e1ba701
...
...
@@ -2182,7 +2182,7 @@ class _FailingImageProvider extends ImageProvider<int> {
this
.
failOnLoad
=
false
,
required
this
.
throws
,
required
this
.
image
,
})
:
assert
(
failOnLoad
==
true
||
failOnObtainKey
==
true
);
})
:
assert
(
failOnLoad
||
failOnObtainKey
);
final
bool
failOnObtainKey
;
final
bool
failOnLoad
;
...
...
packages/flutter_test/lib/src/widget_tester.dart
View file @
5e1ba701
...
...
@@ -149,7 +149,7 @@ void testWidgets(
tester
.
_testDescription
=
combinedDescription
;
SemanticsHandle
?
semanticsHandle
;
tester
.
_recordNumberOfSemanticsHandles
();
if
(
semanticsEnabled
==
true
)
{
if
(
semanticsEnabled
)
{
semanticsHandle
=
tester
.
ensureSemantics
();
}
test_package
.
addTearDown
(
binding
.
postTest
);
...
...
@@ -420,7 +420,7 @@ Future<void> benchmarkWidgets(
assert
(
binding
is
!
AutomatedTestWidgetsFlutterBinding
);
final
WidgetTester
tester
=
WidgetTester
.
_
(
binding
);
SemanticsHandle
?
semanticsHandle
;
if
(
semanticsEnabled
==
true
)
{
if
(
semanticsEnabled
)
{
semanticsHandle
=
tester
.
ensureSemantics
();
}
tester
.
_recordNumberOfSemanticsHandles
();
...
...
packages/flutter_tools/lib/src/base/build.dart
View file @
5e1ba701
...
...
@@ -328,7 +328,7 @@ class AOTSnapshotter {
}
}
}
else
{
assert
(
stripAfterBuild
==
false
);
assert
(
!
stripAfterBuild
);
}
return
0
;
...
...
packages/flutter_tools/lib/src/base/logger.dart
View file @
5e1ba701
...
...
@@ -1101,7 +1101,7 @@ class PrefixedErrorLogger extends DelegatingLogger {
bool
?
wrap
,
})
{
hadErrorOutput
=
true
;
if
(
message
.
trim
().
isNotEmpty
==
true
)
{
if
(
message
.
trim
().
isNotEmpty
)
{
message
=
'ERROR:
$message
'
;
}
super
.
printError
(
...
...
packages/flutter_tools/lib/src/commands/custom_devices.dart
View file @
5e1ba701
...
...
@@ -537,7 +537,7 @@ class CustomDevicesAddCommand extends CustomDevicesCommandBase {
String
?
description
,
bool
defaultsTo
=
true
,
})
async
{
final
String
defaultsToStr
=
defaultsTo
==
true
?
'[Y/n]'
:
'[y/N]'
;
final
String
defaultsToStr
=
defaultsTo
?
'[Y/n]'
:
'[y/N]'
;
logger
.
printStatus
(
'
$description
$defaultsToStr
(empty for default)'
);
while
(
true
)
{
final
String
input
=
await
inputs
.
next
;
...
...
@@ -784,7 +784,7 @@ class CustomDevicesAddCommand extends CustomDevicesCommandBase {
if
(
stringArg
(
_kJson
)
!=
null
)
{
return
runNonInteractively
();
}
if
(
boolArg
(
_kSsh
)
==
true
)
{
if
(
boolArg
(
_kSsh
))
{
return
runInteractivelySsh
();
}
throw
UnsupportedError
(
'Unknown run mode'
);
...
...
packages/flutter_tools/lib/src/compile.dart
View file @
5e1ba701
...
...
@@ -793,7 +793,7 @@ class DefaultResidentCompiler implements ResidentCompiler {
'--platform'
,
platformDill
!,
],
if
(
unsafePackageSerialization
==
true
)
'--unsafe-package-serialization'
,
if
(
unsafePackageSerialization
)
'--unsafe-package-serialization'
,
// See: https://github.com/flutter/flutter/issues/103994
'--verbosity=error'
,
...?
extraFrontEndOptions
,
...
...
packages/flutter_tools/lib/src/custom_devices/custom_device.dart
View file @
5e1ba701
...
...
@@ -706,7 +706,7 @@ class CustomDevice extends Device {
@override
Future
<
void
>
takeScreenshot
(
File
outputFile
)
async
{
if
(
supportsScreenshot
==
false
)
{
if
(
!
supportsScreenshot
)
{
throw
UnsupportedError
(
'Screenshotting is not supported for this device.'
);
}
...
...
@@ -874,7 +874,7 @@ class CustomDevices extends PollingDeviceDiscovery {
);
// remove all the devices we couldn't reach.
pingedDevices
.
removeWhere
((
_
,
bool
value
)
=>
value
==
fals
e
);
pingedDevices
.
removeWhere
((
_
,
bool
value
)
=>
!
valu
e
);
// return only the devices.
return
pingedDevices
.
keys
.
toList
();
...
...
packages/flutter_tools/lib/src/desktop_device.dart
View file @
5e1ba701
...
...
@@ -149,7 +149,7 @@ abstract class DesktopDevice extends Device {
unawaited
(
process
.
exitCode
.
then
((
_
)
=>
_runningProcesses
.
remove
(
process
)));
_deviceLogReader
.
initializeProcess
(
process
);
if
(
debuggingOptions
.
buildInfo
.
isRelease
==
true
)
{
if
(
debuggingOptions
.
buildInfo
.
isRelease
)
{
return
LaunchResult
.
succeeded
();
}
final
ProtocolDiscovery
vmServiceDiscovery
=
ProtocolDiscovery
.
vmService
(
_deviceLogReader
,
...
...
packages/flutter_tools/lib/src/device.dart
View file @
5e1ba701
...
...
@@ -283,7 +283,7 @@ abstract class DeviceManager {
bool
includeDevicesUnsupportedByProject
=
false
,
})
{
FlutterProject
?
flutterProject
;
if
(
includeDevicesUnsupportedByProject
==
false
)
{
if
(
!
includeDevicesUnsupportedByProject
)
{
flutterProject
=
FlutterProject
.
current
();
}
if
(
hasSpecifiedAllDevices
)
{
...
...
@@ -312,7 +312,7 @@ abstract class DeviceManager {
Device
?
getSingleEphemeralDevice
(
List
<
Device
>
devices
){
if
(!
hasSpecifiedDeviceId
)
{
try
{
return
devices
.
singleWhere
((
Device
device
)
=>
device
.
ephemeral
==
true
);
return
devices
.
singleWhere
((
Device
device
)
=>
device
.
ephemeral
);
}
on
StateError
{
return
null
;
}
...
...
packages/flutter_tools/lib/src/doctor.dart
View file @
5e1ba701
...
...
@@ -410,7 +410,7 @@ class Doctor {
}
for
(
final
ValidationMessage
message
in
result
.
messages
)
{
if
(!
message
.
isInformation
||
verbose
==
true
)
{
if
(!
message
.
isInformation
||
verbose
)
{
int
hangingIndent
=
2
;
int
indent
=
4
;
final
String
indicator
=
showColor
?
message
.
coloredIndicator
:
message
.
indicator
;
...
...
packages/flutter_tools/lib/src/emulator.dart
View file @
5e1ba701
...
...
@@ -56,8 +56,8 @@ class EmulatorManager {
emulator
.
id
.
toLowerCase
()
==
searchText
||
emulator
.
name
.
toLowerCase
()
==
searchText
;
bool
startsWithEmulatorId
(
Emulator
emulator
)
=>
emulator
.
id
.
toLowerCase
().
startsWith
(
searchText
)
==
true
||
emulator
.
name
.
toLowerCase
().
startsWith
(
searchText
)
==
true
;
emulator
.
id
.
toLowerCase
().
startsWith
(
searchText
)
||
emulator
.
name
.
toLowerCase
().
startsWith
(
searchText
);
Emulator
?
exactMatch
;
for
(
final
Emulator
emulator
in
emulators
)
{
...
...
packages/flutter_tools/lib/src/ios/devices.dart
View file @
5e1ba701
...
...
@@ -607,7 +607,7 @@ class IOSDevice extends Device {
// If the debugger is not attached, killing the ios-deploy process won't stop the app.
final
IOSDeployDebugger
?
deployDebugger
=
iosDeployDebugger
;
if
(
deployDebugger
!=
null
&&
deployDebugger
.
debuggerAttached
)
{
return
deployDebugger
.
exit
()
==
true
;
return
deployDebugger
.
exit
();
}
return
false
;
}
...
...
packages/flutter_tools/lib/src/ios/xcodeproj.dart
View file @
5e1ba701
...
...
@@ -201,9 +201,9 @@ class XcodeProjectInterpreter {
if
(
buildContext
.
environmentType
==
EnvironmentType
.
simulator
)
...<
String
>[
'-sdk'
,
'iphonesimulator'
],
'-destination'
,
if
(
buildContext
.
isWatch
==
true
&&
buildContext
.
environmentType
==
EnvironmentType
.
physical
)
if
(
buildContext
.
isWatch
&&
buildContext
.
environmentType
==
EnvironmentType
.
physical
)
'generic/platform=watchOS'
else
if
(
buildContext
.
isWatch
==
true
)
else
if
(
buildContext
.
isWatch
)
'generic/platform=watchOS Simulator'
else
if
(
deviceId
!=
null
)
'id=
$deviceId
'
...
...
packages/flutter_tools/lib/src/migrations/cmake_custom_command_migration.dart
View file @
5e1ba701
...
...
@@ -48,7 +48,7 @@ class CmakeCustomCommandMigration extends ProjectMigrator {
for
(
final
RegExpMatch
match
in
matches
)
{
final
String
?
addCustomCommandOriginal
=
match
.
group
(
1
);
if
(
addCustomCommandOriginal
!=
null
&&
addCustomCommandOriginal
.
contains
(
'VERBATIM'
)
==
false
)
{
if
(
addCustomCommandOriginal
!=
null
&&
!
addCustomCommandOriginal
.
contains
(
'VERBATIM'
)
)
{
final
String
addCustomCommandReplacement
=
'
$addCustomCommandOriginal
\n
VERBATIM'
;
newProjectContents
=
newProjectContents
.
replaceAll
(
addCustomCommandOriginal
,
addCustomCommandReplacement
);
}
...
...
packages/flutter_tools/lib/src/proxied_devices/devices.dart
View file @
5e1ba701
...
...
@@ -638,7 +638,7 @@ class ProxiedPortForwarder extends DevicePortForwarder {
}
Future
<
ServerSocket
>
_defaultCreateServerSocket
(
Logger
logger
,
int
?
hostPort
,
bool
?
ipv6
)
async
{
if
(
ipv6
==
null
||
ipv6
==
false
)
{
if
(
ipv6
==
null
||
!
ipv6
)
{
try
{
return
await
ServerSocket
.
bind
(
InternetAddress
.
loopbackIPv4
,
hostPort
??
0
);
}
on
SocketException
{
...
...
packages/flutter_tools/lib/src/runner/flutter_command.dart
View file @
5e1ba701
...
...
@@ -1172,7 +1172,7 @@ abstract class FlutterCommand extends Command<void> {
}
final
bool
treeShakeIcons
=
argParser
.
options
.
containsKey
(
'tree-shake-icons'
)
&&
buildMode
.
isPrecompiled
==
true
&&
buildMode
.
isPrecompiled
&&
boolArg
(
'tree-shake-icons'
);
final
String
?
bundleSkSLPath
=
argParser
.
options
.
containsKey
(
FlutterOptions
.
kBundleSkSLPathOption
)
...
...
packages/flutter_tools/lib/src/xcode_project.dart
View file @
5e1ba701
...
...
@@ -508,7 +508,7 @@ class IosProject extends XcodeBasedProject {
// In newer versions of Xcode, the build settings of the watchOS companion
// app's scheme should contain the key INFOPLIST_KEY_WKCompanionAppBundleIdentifier.
final
bool
watchIdentifierFound
=
xcodeProjectInfoFile
.
readAsStringSync
().
contains
(
'WKCompanionAppBundleIdentifier'
);
if
(
watchIdentifierFound
==
false
)
{
if
(
!
watchIdentifierFound
)
{
return
false
;
}
...
...
packages/flutter_tools/test/commands.shard/hermetic/analyze_continuously_test.dart
View file @
5e1ba701
...
...
@@ -103,7 +103,7 @@ void main() {
);
int
errorCount
=
0
;
final
Future
<
bool
>
onDone
=
server
.
onAnalyzing
.
where
((
bool
analyzing
)
=>
analyzing
==
false
).
first
;
final
Future
<
bool
>
onDone
=
server
.
onAnalyzing
.
where
((
bool
analyzing
)
=>
!
analyzing
).
first
;
server
.
onErrors
.
listen
((
FileAnalysisErrors
errors
)
=>
errorCount
+=
errors
.
errors
.
length
);
await
server
.
start
();
...
...
@@ -144,7 +144,7 @@ void main() {
);
int
errorCount
=
0
;
final
Future
<
bool
>
onDone
=
server
.
onAnalyzing
.
where
((
bool
analyzing
)
=>
analyzing
==
false
).
first
;
final
Future
<
bool
>
onDone
=
server
.
onAnalyzing
.
where
((
bool
analyzing
)
=>
!
analyzing
).
first
;
server
.
onErrors
.
listen
((
FileAnalysisErrors
errors
)
{
errorCount
+=
errors
.
errors
.
length
;
});
...
...
@@ -172,7 +172,7 @@ void main() {
);
int
errorCount
=
0
;
final
Future
<
bool
>
onDone
=
server
.
onAnalyzing
.
where
((
bool
analyzing
)
=>
analyzing
==
false
).
first
;
final
Future
<
bool
>
onDone
=
server
.
onAnalyzing
.
where
((
bool
analyzing
)
=>
!
analyzing
).
first
;
server
.
onErrors
.
listen
((
FileAnalysisErrors
errors
)
{
errorCount
+=
errors
.
errors
.
length
;
});
...
...
packages/flutter_tools/test/commands.shard/hermetic/clean_test.dart
View file @
5e1ba701
...
...
@@ -224,7 +224,7 @@ void main() {
FlutterProject
setupProjectUnderTest
(
Directory
currentDirectory
,
bool
setupXcodeWorkspace
)
{
// This needs to be run within testWithoutContext and not setUp since FlutterProject uses context.
final
FlutterProject
projectUnderTest
=
FlutterProject
.
fromDirectory
(
currentDirectory
);
if
(
setupXcodeWorkspace
==
true
)
{
if
(
setupXcodeWorkspace
)
{
projectUnderTest
.
ios
.
hostAppRoot
.
childDirectory
(
'Runner.xcworkspace'
).
createSync
(
recursive:
true
);
projectUnderTest
.
macos
.
hostAppRoot
.
childDirectory
(
'Runner.xcworkspace'
).
createSync
(
recursive:
true
);
}
...
...
packages/flutter_tools/test/commands.shard/hermetic/create_usage_test.dart
View file @
5e1ba701
...
...
@@ -39,7 +39,7 @@ class FakePub extends Fake implements Pub {
PubOutputMode
outputMode
=
PubOutputMode
.
all
,
})
async
{
project
.
directory
.
childFile
(
'.packages'
).
createSync
();
if
(
offline
==
true
)
{
if
(
offline
)
{
calledGetOffline
+=
1
;
}
else
{
calledOnline
+=
1
;
...
...
packages/flutter_tools/test/commands.shard/hermetic/run_test.dart
View file @
5e1ba701
...
...
@@ -1278,10 +1278,10 @@ class FakeDevice extends Fake implements Device {
bool
ipv6
=
false
,
String
?
userIdentifier
,
})
async
{
if
(
startAppSuccess
==
false
)
{
if
(
!
startAppSuccess
)
{
return
LaunchResult
.
failed
();
}
if
(
startAppSuccess
==
true
)
{
if
(
startAppSuccess
)
{
return
LaunchResult
.
succeeded
();
}
final
String
dartFlags
=
debuggingOptions
.
dartFlags
;
...
...
packages/flutter_tools/test/general.shard/args_test.dart
View file @
5e1ba701
...
...
@@ -124,7 +124,7 @@ void verifyCommand(Command<Object?> runner) {
final
String
firstDescriptionLine
=
runner
.
description
.
split
(
'
\n
'
).
first
;
expect
(
firstDescriptionLine
,
matches
(
_allowedTrailingPatterns
),
reason:
"command
${runner.name}
's description does not end with the expected single period that a full sentence should end with"
);
if
(
runner
.
hidden
==
false
&&
runner
.
parent
==
null
)
{
if
(
!
runner
.
hidden
&&
runner
.
parent
==
null
)
{
expect
(
runner
.
category
,
anyOf
(
...
...
packages/flutter_tools/test/general.shard/channel_test.dart
View file @
5e1ba701
...
...
@@ -163,7 +163,7 @@ void main() {
final
Iterable
<
String
>
rows
=
testLogger
.
statusText
.
split
(
'
\n
'
)
.
map
((
String
line
)
=>
line
.
trim
())
.
where
((
String
line
)
=>
line
.
isNotEmpty
==
true
)
.
where
((
String
line
)
=>
line
.
isNotEmpty
)
.
skip
(
1
);
// remove `Flutter channels:` line
expect
(
rows
,
<
String
>[
'beta'
,
'stable'
,
'Currently not on an official channel.'
]);
...
...
@@ -194,7 +194,7 @@ void main() {
final
Iterable
<
String
>
rows
=
testLogger
.
statusText
.
split
(
'
\n
'
)
.
map
((
String
line
)
=>
line
.
trim
())
.
where
((
String
line
)
=>
line
.
isNotEmpty
==
true
)
.
where
((
String
line
)
=>
line
.
isNotEmpty
)
.
skip
(
1
);
// remove `Flutter channels:` line
expect
(
rows
,
<
String
>[
'beta'
,
'stable'
,
'Currently not on an official channel.'
]);
...
...
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