Two minor improvements (#4554)

Add `@required` for some required parameters in `RRect`. Use elvis
operator to simplify a function.
This commit is contained in:
Adam Barth
2016-06-14 09:33:41 -07:00
committed by GitHub
parent 2b2d782503
commit d8c52527cc
2 changed files with 7 additions and 4 deletions

View File

@@ -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

View File

@@ -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.
///