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
Hide 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
));
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
;
refreshResult
.
whenComplete
(()
{
if
(
mounted
&&
_mode
==
_RefreshIndicatorMode
.
refresh
)
{
...
...
packages/flutter/lib/src/material/scaffold.dart
View file @
0d8d4f77
...
...
@@ -3326,38 +3326,28 @@ class _StandardBottomSheetState extends State<_StandardBottomSheet> {
@override
Widget
build
(
BuildContext
context
)
{
if
(
widget
.
animationController
!=
null
)
{
return
AnimatedBuilder
(
animation:
widget
.
animationController
,
builder:
(
BuildContext
context
,
Widget
?
child
)
{
return
Align
(
alignment:
AlignmentDirectional
.
topStart
,
heightFactor:
animationCurve
.
transform
(
widget
.
animationController
.
value
),
child:
child
,
);
},
child:
_wrapBottomSheet
(
BottomSheet
(
animationController:
widget
.
animationController
,
enableDrag:
widget
.
enableDrag
,
onDragStart:
_handleDragStart
,
onDragEnd:
_handleDragEnd
,
onClosing:
widget
.
onClosing
!,
builder:
widget
.
builder
,
backgroundColor:
widget
.
backgroundColor
,
elevation:
widget
.
elevation
,
shape:
widget
.
shape
,
clipBehavior:
widget
.
clipBehavior
,
),
return
AnimatedBuilder
(
animation:
widget
.
animationController
,
builder:
(
BuildContext
context
,
Widget
?
child
)
{
return
Align
(
alignment:
AlignmentDirectional
.
topStart
,
heightFactor:
animationCurve
.
transform
(
widget
.
animationController
.
value
),
child:
child
,
);
},
child:
_wrapBottomSheet
(
BottomSheet
(
animationController:
widget
.
animationController
,
enableDrag:
widget
.
enableDrag
,
onDragStart:
_handleDragStart
,
onDragEnd:
_handleDragEnd
,
onClosing:
widget
.
onClosing
!,
builder:
widget
.
builder
,
backgroundColor:
widget
.
backgroundColor
,
elevation:
widget
.
elevation
,
shape:
widget
.
shape
,
clipBehavior:
widget
.
clipBehavior
,
),
);
}
return
_wrapBottomSheet
(
BottomSheet
(
onClosing:
widget
.
onClosing
!,
builder:
widget
.
builder
,
backgroundColor:
widget
.
backgroundColor
,
),
);
}
...
...
packages/flutter/lib/src/services/binary_messenger.dart
View file @
0d8d4f77
...
...
@@ -10,7 +10,7 @@ import 'package:flutter/foundation.dart';
import
'binding.dart'
;
/// 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.
///
...
...
@@ -31,7 +31,7 @@ abstract class BinaryMessenger {
///
/// Returns a [Future] which completes to the received response, undecoded,
/// 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
/// given channel, without decoding them.
...
...
packages/flutter/lib/src/services/binding.dart
View file @
0d8d4f77
...
...
@@ -300,7 +300,7 @@ class _DefaultBinaryMessenger extends BinaryMessenger {
}
@override
Future
<
ByteData
?>
send
(
String
channel
,
ByteData
?
message
)
{
Future
<
ByteData
?>
?
send
(
String
channel
,
ByteData
?
message
)
{
final
MessageHandler
?
handler
=
_mockHandlers
[
channel
];
if
(
handler
!=
null
)
return
handler
(
message
);
...
...
packages/flutter/lib/src/services/platform_messages.dart
View file @
0d8d4f77
...
...
@@ -65,7 +65,7 @@ class BinaryMessages {
'Use defaultBinaryMessenger.send instead. '
'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
);
}
...
...
packages/flutter/test/rendering/mock_canvas.dart
View file @
0d8d4f77
...
...
@@ -821,10 +821,6 @@ class _TestRecordingCanvasPatternMatcher extends _TestRecordingCanvasMatcher imp
final
Iterator
<
RecordedInvocation
>
call
=
calls
.
iterator
..
moveNext
();
try
{
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
);
}
assert
(
predicate
.
current
==
null
);
...
...
@@ -836,11 +832,7 @@ class _TestRecordingCanvasPatternMatcher extends _TestRecordingCanvasMatcher imp
return
false
;
}
on
String
catch
(
s
)
{
description
.
writeln
(
s
);
if
(
call
.
current
!=
null
)
{
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
'
);
}
description
.
write
(
'The stack of the offending call was:
\n
${call.current.stackToString(indent: " ")}
\n
'
);
return
false
;
}
return
true
;
...
...
@@ -1390,8 +1382,6 @@ class _SomethingPaintPredicate extends _PaintPredicate {
RecordedInvocation
currentCall
;
do
{
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
)
throw
'It called
$currentCall
, which was not a method, when the paint pattern expected a method call'
;
call
.
moveNext
();
...
...
packages/flutter_driver/lib/src/common/find.dart
View file @
0d8d4f77
...
...
@@ -42,8 +42,7 @@ DriverError _createInvalidKeyValueTypeError(String invalidType) {
abstract
class
CommandWithTarget
extends
Command
{
/// Constructs this command given a [finder].
CommandWithTarget
(
this
.
finder
,
{
Duration
timeout
})
:
super
(
timeout:
timeout
)
{
if
(
finder
==
null
)
throw
DriverError
(
'
$runtimeType
target cannot be null'
);
assert
(
finder
!=
null
,
'
$runtimeType
target cannot be null'
);
}
/// 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 {
if
(
condition
.
conditionName
!=
'CombinedCondition'
)
throw
SerializationException
(
'Error occurred during deserializing from the given condition:
${condition.serialize()}
'
);
final
CombinedCondition
combinedCondition
=
condition
as
CombinedCondition
;
if
(
combinedCondition
.
conditions
==
null
)
{
return
const
_InternalCombinedCondition
(<
WaitCondition
>[]);
}
final
List
<
WaitCondition
>
conditions
=
combinedCondition
.
conditions
.
map
(
(
SerializableWaitCondition
serializableCondition
)
=>
deserializeCondition
(
serializableCondition
)
).
toList
();
final
List
<
WaitCondition
>
conditions
=
combinedCondition
.
conditions
.
map
(
deserializeCondition
).
toList
();
return
_InternalCombinedCondition
(
conditions
);
}
...
...
packages/flutter_test/lib/src/binding.dart
View file @
0d8d4f77
...
...
@@ -101,11 +101,11 @@ class TestDefaultBinaryMessenger extends BinaryMessenger {
int
get
pendingMessageCount
=>
_pendingMessages
.
length
;
@override
Future
<
ByteData
?>
send
(
String
channel
,
ByteData
?
message
)
{
final
Future
<
ByteData
?>
resultFuture
=
delegate
.
send
(
channel
,
message
);
// Removes the future itself from the [_pendingMessages] list when it
// completes.
Future
<
ByteData
?>?
send
(
String
channel
,
ByteData
?
message
)
{
final
Future
<
ByteData
?>?
resultFuture
=
delegate
.
send
(
channel
,
message
);
if
(
resultFuture
!=
null
)
{
// Removes the future itself from the [_pendingMessages] list when it
// completes.
_pendingMessages
.
add
(
resultFuture
);
resultFuture
.
whenComplete
(()
=>
_pendingMessages
.
remove
(
resultFuture
));
}
...
...
@@ -1780,8 +1780,7 @@ class _LiveTestRenderView extends RenderView {
_label
??=
TextPainter
(
textAlign:
TextAlign
.
left
,
textDirection:
TextDirection
.
ltr
);
_label
!.
text
=
TextSpan
(
text:
value
,
style:
_labelStyle
);
_label
!.
layout
();
if
(
onNeedPaint
!=
null
)
onNeedPaint
();
onNeedPaint
();
}
@override
...
...
packages/flutter_test/lib/src/widget_tester.dart
View file @
0d8d4f77
...
...
@@ -1072,8 +1072,7 @@ class _TestTicker extends Ticker {
@override
void
dispose
()
{
if
(
_onDispose
!=
null
)
_onDispose
(
this
);
_onDispose
(
this
);
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