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
0d8d4f77
Unverified
Commit
0d8d4f77
authored
Oct 08, 2020
by
Alexandre Ardhuin
Committed by
GitHub
Oct 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unnecessary null comparison (#67525)
parent
0b78110b
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
38 additions
and
64 deletions
+38
-64
refresh_indicator.dart
packages/flutter/lib/src/material/refresh_indicator.dart
+4
-1
scaffold.dart
packages/flutter/lib/src/material/scaffold.dart
+21
-31
binary_messenger.dart
packages/flutter/lib/src/services/binary_messenger.dart
+2
-2
binding.dart
packages/flutter/lib/src/services/binding.dart
+1
-1
platform_messages.dart
packages/flutter/lib/src/services/platform_messages.dart
+1
-1
mock_canvas.dart
packages/flutter/test/rendering/mock_canvas.dart
+1
-11
find.dart
packages/flutter_driver/lib/src/common/find.dart
+1
-2
wait_conditions.dart
...ges/flutter_driver/lib/src/extension/wait_conditions.dart
+1
-7
binding.dart
packages/flutter_test/lib/src/binding.dart
+5
-6
widget_tester.dart
packages/flutter_test/lib/src/widget_tester.dart
+1
-2
No files found.
packages/flutter/lib/src/material/refresh_indicator.dart
View file @
0d8d4f77
...
@@ -378,7 +378,10 @@ class RefreshIndicatorState extends State<RefreshIndicator> with TickerProviderS
...
@@ -378,7 +378,10 @@ class RefreshIndicatorState extends State<RefreshIndicator> with TickerProviderS
));
));
return
true
;
return
true
;
}());
}());
if
(
refreshResult
==
null
)
// `refreshResult` has a non-nullable type, but might be null when
// running with weak checking, so we need to null check it anyway (and
// ignore the warning that the null-handling logic is dead code).
if
(
refreshResult
==
null
)
// ignore: dead_code
return
;
return
;
refreshResult
.
whenComplete
(()
{
refreshResult
.
whenComplete
(()
{
if
(
mounted
&&
_mode
==
_RefreshIndicatorMode
.
refresh
)
{
if
(
mounted
&&
_mode
==
_RefreshIndicatorMode
.
refresh
)
{
...
...
packages/flutter/lib/src/material/scaffold.dart
View file @
0d8d4f77
...
@@ -3326,7 +3326,6 @@ class _StandardBottomSheetState extends State<_StandardBottomSheet> {
...
@@ -3326,7 +3326,6 @@ class _StandardBottomSheetState extends State<_StandardBottomSheet> {
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
if
(
widget
.
animationController
!=
null
)
{
return
AnimatedBuilder
(
return
AnimatedBuilder
(
animation:
widget
.
animationController
,
animation:
widget
.
animationController
,
builder:
(
BuildContext
context
,
Widget
?
child
)
{
builder:
(
BuildContext
context
,
Widget
?
child
)
{
...
@@ -3353,15 +3352,6 @@ class _StandardBottomSheetState extends State<_StandardBottomSheet> {
...
@@ -3353,15 +3352,6 @@ class _StandardBottomSheetState extends State<_StandardBottomSheet> {
);
);
}
}
return
_wrapBottomSheet
(
BottomSheet
(
onClosing:
widget
.
onClosing
!,
builder:
widget
.
builder
,
backgroundColor:
widget
.
backgroundColor
,
),
);
}
}
}
/// A [ScaffoldFeatureController] for standard bottom sheets.
/// A [ScaffoldFeatureController] for standard bottom sheets.
...
...
packages/flutter/lib/src/services/binary_messenger.dart
View file @
0d8d4f77
...
@@ -10,7 +10,7 @@ import 'package:flutter/foundation.dart';
...
@@ -10,7 +10,7 @@ import 'package:flutter/foundation.dart';
import
'binding.dart'
;
import
'binding.dart'
;
/// A function which takes a platform message and asynchronously returns an encoded response.
/// A function which takes a platform message and asynchronously returns an encoded response.
typedef
MessageHandler
=
Future
<
ByteData
?>
Function
(
ByteData
?
message
);
typedef
MessageHandler
=
Future
<
ByteData
?>
?
Function
(
ByteData
?
message
);
/// A messenger which sends binary data across the Flutter platform barrier.
/// A messenger which sends binary data across the Flutter platform barrier.
///
///
...
@@ -31,7 +31,7 @@ abstract class BinaryMessenger {
...
@@ -31,7 +31,7 @@ abstract class BinaryMessenger {
///
///
/// Returns a [Future] which completes to the received response, undecoded,
/// Returns a [Future] which completes to the received response, undecoded,
/// in binary form.
/// in binary form.
Future
<
ByteData
?>
send
(
String
channel
,
ByteData
?
message
);
Future
<
ByteData
?>
?
send
(
String
channel
,
ByteData
?
message
);
/// Set a callback for receiving messages from the platform plugins on the
/// Set a callback for receiving messages from the platform plugins on the
/// given channel, without decoding them.
/// given channel, without decoding them.
...
...
packages/flutter/lib/src/services/binding.dart
View file @
0d8d4f77
...
@@ -300,7 +300,7 @@ class _DefaultBinaryMessenger extends BinaryMessenger {
...
@@ -300,7 +300,7 @@ class _DefaultBinaryMessenger extends BinaryMessenger {
}
}
@override
@override
Future
<
ByteData
?>
send
(
String
channel
,
ByteData
?
message
)
{
Future
<
ByteData
?>
?
send
(
String
channel
,
ByteData
?
message
)
{
final
MessageHandler
?
handler
=
_mockHandlers
[
channel
];
final
MessageHandler
?
handler
=
_mockHandlers
[
channel
];
if
(
handler
!=
null
)
if
(
handler
!=
null
)
return
handler
(
message
);
return
handler
(
message
);
...
...
packages/flutter/lib/src/services/platform_messages.dart
View file @
0d8d4f77
...
@@ -65,7 +65,7 @@ class BinaryMessages {
...
@@ -65,7 +65,7 @@ class BinaryMessages {
'Use defaultBinaryMessenger.send instead. '
'Use defaultBinaryMessenger.send instead. '
'This feature was deprecated after v1.6.5.'
'This feature was deprecated after v1.6.5.'
)
)
static
Future
<
ByteData
?>
send
(
String
channel
,
ByteData
?
message
)
{
static
Future
<
ByteData
?>
?
send
(
String
channel
,
ByteData
?
message
)
{
return
_binaryMessenger
.
send
(
channel
,
message
);
return
_binaryMessenger
.
send
(
channel
,
message
);
}
}
...
...
packages/flutter/test/rendering/mock_canvas.dart
View file @
0d8d4f77
...
@@ -821,10 +821,6 @@ class _TestRecordingCanvasPatternMatcher extends _TestRecordingCanvasMatcher imp
...
@@ -821,10 +821,6 @@ class _TestRecordingCanvasPatternMatcher extends _TestRecordingCanvasMatcher imp
final
Iterator
<
RecordedInvocation
>
call
=
calls
.
iterator
..
moveNext
();
final
Iterator
<
RecordedInvocation
>
call
=
calls
.
iterator
..
moveNext
();
try
{
try
{
while
(
predicate
.
moveNext
())
{
while
(
predicate
.
moveNext
())
{
if
(
call
.
current
==
null
)
{
throw
'It painted less on its canvas than the paint pattern expected. '
'The first missing paint call was:
${predicate.current}
'
;
}
predicate
.
current
.
match
(
call
);
predicate
.
current
.
match
(
call
);
}
}
assert
(
predicate
.
current
==
null
);
assert
(
predicate
.
current
==
null
);
...
@@ -836,11 +832,7 @@ class _TestRecordingCanvasPatternMatcher extends _TestRecordingCanvasMatcher imp
...
@@ -836,11 +832,7 @@ class _TestRecordingCanvasPatternMatcher extends _TestRecordingCanvasMatcher imp
return
false
;
return
false
;
}
on
String
catch
(
s
)
{
}
on
String
catch
(
s
)
{
description
.
writeln
(
s
);
description
.
writeln
(
s
);
if
(
call
.
current
!=
null
)
{
description
.
write
(
'The stack of the offending call was:
\n
${call.current.stackToString(indent: " ")}
\n
'
);
description
.
write
(
'The stack of the offending call was:
\n
${call.current.stackToString(indent: " ")}
\n
'
);
}
else
{
description
.
write
(
'The stack of the first call was:
\n
${calls.first.stackToString(indent: " ")}
\n
'
);
}
return
false
;
return
false
;
}
}
return
true
;
return
true
;
...
@@ -1390,8 +1382,6 @@ class _SomethingPaintPredicate extends _PaintPredicate {
...
@@ -1390,8 +1382,6 @@ class _SomethingPaintPredicate extends _PaintPredicate {
RecordedInvocation
currentCall
;
RecordedInvocation
currentCall
;
do
{
do
{
currentCall
=
call
.
current
;
currentCall
=
call
.
current
;
if
(
currentCall
==
null
)
throw
'It did not call anything that was matched by the predicate passed to a "something" step of the paint pattern.'
;
if
(!
currentCall
.
invocation
.
isMethod
)
if
(!
currentCall
.
invocation
.
isMethod
)
throw
'It called
$currentCall
, which was not a method, when the paint pattern expected a method call'
;
throw
'It called
$currentCall
, which was not a method, when the paint pattern expected a method call'
;
call
.
moveNext
();
call
.
moveNext
();
...
...
packages/flutter_driver/lib/src/common/find.dart
View file @
0d8d4f77
...
@@ -42,8 +42,7 @@ DriverError _createInvalidKeyValueTypeError(String invalidType) {
...
@@ -42,8 +42,7 @@ DriverError _createInvalidKeyValueTypeError(String invalidType) {
abstract
class
CommandWithTarget
extends
Command
{
abstract
class
CommandWithTarget
extends
Command
{
/// Constructs this command given a [finder].
/// Constructs this command given a [finder].
CommandWithTarget
(
this
.
finder
,
{
Duration
timeout
})
:
super
(
timeout:
timeout
)
{
CommandWithTarget
(
this
.
finder
,
{
Duration
timeout
})
:
super
(
timeout:
timeout
)
{
if
(
finder
==
null
)
assert
(
finder
!=
null
,
'
$runtimeType
target cannot be null'
);
throw
DriverError
(
'
$runtimeType
target cannot be null'
);
}
}
/// Deserializes this command from the value generated by [serialize].
/// Deserializes this command from the value generated by [serialize].
...
...
packages/flutter_driver/lib/src/extension/wait_conditions.dart
View file @
0d8d4f77
...
@@ -164,13 +164,7 @@ class _InternalCombinedCondition implements WaitCondition {
...
@@ -164,13 +164,7 @@ class _InternalCombinedCondition implements WaitCondition {
if
(
condition
.
conditionName
!=
'CombinedCondition'
)
if
(
condition
.
conditionName
!=
'CombinedCondition'
)
throw
SerializationException
(
'Error occurred during deserializing from the given condition:
${condition.serialize()}
'
);
throw
SerializationException
(
'Error occurred during deserializing from the given condition:
${condition.serialize()}
'
);
final
CombinedCondition
combinedCondition
=
condition
as
CombinedCondition
;
final
CombinedCondition
combinedCondition
=
condition
as
CombinedCondition
;
if
(
combinedCondition
.
conditions
==
null
)
{
final
List
<
WaitCondition
>
conditions
=
combinedCondition
.
conditions
.
map
(
deserializeCondition
).
toList
();
return
const
_InternalCombinedCondition
(<
WaitCondition
>[]);
}
final
List
<
WaitCondition
>
conditions
=
combinedCondition
.
conditions
.
map
(
(
SerializableWaitCondition
serializableCondition
)
=>
deserializeCondition
(
serializableCondition
)
).
toList
();
return
_InternalCombinedCondition
(
conditions
);
return
_InternalCombinedCondition
(
conditions
);
}
}
...
...
packages/flutter_test/lib/src/binding.dart
View file @
0d8d4f77
...
@@ -101,11 +101,11 @@ class TestDefaultBinaryMessenger extends BinaryMessenger {
...
@@ -101,11 +101,11 @@ class TestDefaultBinaryMessenger extends BinaryMessenger {
int
get
pendingMessageCount
=>
_pendingMessages
.
length
;
int
get
pendingMessageCount
=>
_pendingMessages
.
length
;
@override
@override
Future
<
ByteData
?>
send
(
String
channel
,
ByteData
?
message
)
{
Future
<
ByteData
?>?
send
(
String
channel
,
ByteData
?
message
)
{
final
Future
<
ByteData
?>
resultFuture
=
delegate
.
send
(
channel
,
message
);
final
Future
<
ByteData
?>?
resultFuture
=
delegate
.
send
(
channel
,
message
);
if
(
resultFuture
!=
null
)
{
// Removes the future itself from the [_pendingMessages] list when it
// Removes the future itself from the [_pendingMessages] list when it
// completes.
// completes.
if
(
resultFuture
!=
null
)
{
_pendingMessages
.
add
(
resultFuture
);
_pendingMessages
.
add
(
resultFuture
);
resultFuture
.
whenComplete
(()
=>
_pendingMessages
.
remove
(
resultFuture
));
resultFuture
.
whenComplete
(()
=>
_pendingMessages
.
remove
(
resultFuture
));
}
}
...
@@ -1780,7 +1780,6 @@ class _LiveTestRenderView extends RenderView {
...
@@ -1780,7 +1780,6 @@ class _LiveTestRenderView extends RenderView {
_label
??=
TextPainter
(
textAlign:
TextAlign
.
left
,
textDirection:
TextDirection
.
ltr
);
_label
??=
TextPainter
(
textAlign:
TextAlign
.
left
,
textDirection:
TextDirection
.
ltr
);
_label
!.
text
=
TextSpan
(
text:
value
,
style:
_labelStyle
);
_label
!.
text
=
TextSpan
(
text:
value
,
style:
_labelStyle
);
_label
!.
layout
();
_label
!.
layout
();
if
(
onNeedPaint
!=
null
)
onNeedPaint
();
onNeedPaint
();
}
}
...
...
packages/flutter_test/lib/src/widget_tester.dart
View file @
0d8d4f77
...
@@ -1072,7 +1072,6 @@ class _TestTicker extends Ticker {
...
@@ -1072,7 +1072,6 @@ class _TestTicker extends Ticker {
@override
@override
void
dispose
()
{
void
dispose
()
{
if
(
_onDispose
!=
null
)
_onDispose
(
this
);
_onDispose
(
this
);
super
.
dispose
();
super
.
dispose
();
}
}
...
...
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