Commit d8c52527 authored by Adam Barth's avatar Adam Barth Committed by GitHub

Two minor improvements (#4554)

Add `@required` for some required parameters in `RRect`. Use elvis
operator to simplify a function.
parent 2b2d7825
......@@ -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
......
......@@ -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.
///
......
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