Unverified Commit 48fb726b authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by GitHub

compare to null with == (#21944)

* compare to null with ==

* address review comments
parent 224f91e3
......@@ -83,11 +83,10 @@ class BoxDecoration extends Decoration {
this.backgroundBlendMode,
this.shape = BoxShape.rectangle,
}) : assert(shape != null),
// TODO(mattcarroll): Use "backgroundBlendMode == null" when https://github.com/dart-lang/sdk/issues/34180 is in.
assert(
identical(backgroundBlendMode, null) || color != null || gradient != null,
backgroundBlendMode == null || color != null || gradient != null,
'backgroundBlendMode applies to BoxDecoration\'s background color or '
'gradient, but no color or gradient were provided.'
'gradient, but no color or gradient was provided.'
);
@override
......
......@@ -246,9 +246,7 @@ class TextStyle extends Diagnosticable {
String package,
}) : fontFamily = package == null ? fontFamily : 'packages/$package/$fontFamily',
assert(inherit != null),
// TODO(dnfield): once https://github.com/dart-lang/sdk/issues/33408 is finished, this can be replaced with
// assert(color == null || foreground == null, _kColorForegroundWarning);
assert(identical(color, null) || identical(foreground, null), _kColorForegroundWarning);
assert(color == null || foreground == null, _kColorForegroundWarning);
/// Whether null values are replaced with their value in an ancestor text
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment