Two minor improvements (#4554)
Add `@required` for some required parameters in `RRect`. Use elvis operator to simplify a function.
This commit is contained in:
@@ -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.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user