compare to null with == (#21944)
* compare to null with == * address review comments
This commit is contained in:
parent
224f91e386
commit
48fb726b01
@ -83,11 +83,10 @@ class BoxDecoration extends Decoration {
|
|||||||
this.backgroundBlendMode,
|
this.backgroundBlendMode,
|
||||||
this.shape = BoxShape.rectangle,
|
this.shape = BoxShape.rectangle,
|
||||||
}) : assert(shape != null),
|
}) : assert(shape != null),
|
||||||
// TODO(mattcarroll): Use "backgroundBlendMode == null" when https://github.com/dart-lang/sdk/issues/34180 is in.
|
|
||||||
assert(
|
assert(
|
||||||
identical(backgroundBlendMode, null) || color != null || gradient != null,
|
backgroundBlendMode == null || color != null || gradient != null,
|
||||||
'backgroundBlendMode applies to BoxDecoration\'s background color or '
|
'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
|
@override
|
||||||
|
@ -246,9 +246,7 @@ class TextStyle extends Diagnosticable {
|
|||||||
String package,
|
String package,
|
||||||
}) : fontFamily = package == null ? fontFamily : 'packages/$package/$fontFamily',
|
}) : fontFamily = package == null ? fontFamily : 'packages/$package/$fontFamily',
|
||||||
assert(inherit != null),
|
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(color == null || foreground == null, _kColorForegroundWarning);
|
|
||||||
assert(identical(color, null) || identical(foreground, null), _kColorForegroundWarning);
|
|
||||||
|
|
||||||
|
|
||||||
/// Whether null values are replaced with their value in an ancestor text
|
/// Whether null values are replaced with their value in an ancestor text
|
||||||
|
Loading…
x
Reference in New Issue
Block a user