diff --git a/packages/flutter/lib/src/rendering/layer.dart b/packages/flutter/lib/src/rendering/layer.dart index 02d87bd7ff..7e8be48e5c 100644 --- a/packages/flutter/lib/src/rendering/layer.dart +++ b/packages/flutter/lib/src/rendering/layer.dart @@ -33,8 +33,7 @@ abstract class Layer { /// Removes this layer from its parent layer's child list @mustCallSuper void detach() { - if (_parent != null) - _parent._remove(this); + _parent?._remove(this); } /// Replaces this layer with the given layer in the parent layer's child list diff --git a/packages/flutter/lib/src/widgets/basic.dart b/packages/flutter/lib/src/widgets/basic.dart index 57b644926a..1460d11fe6 100644 --- a/packages/flutter/lib/src/widgets/basic.dart +++ b/packages/flutter/lib/src/widgets/basic.dart @@ -310,8 +310,12 @@ class ClipRect extends SingleChildRenderObjectWidget { /// rectangle. class ClipRRect extends SingleChildRenderObjectWidget { /// Creates a rounded-rectangular clip. - ClipRRect({ Key key, this.xRadius, this.yRadius, Widget child }) - : super(key: key, child: child); + ClipRRect({ + Key key, + @required this.xRadius, + @required this.yRadius, + Widget child + }) : super(key: key, child: child); /// The radius of the rounded corners in the horizontal direction in logical pixels. ///