Commit f20a3c25 authored by Terje Lønøy's avatar Terje Lønøy Committed by xster

Add key support to cupertino button (#28900)

parent 34a85b39
...@@ -28,6 +28,7 @@ const EdgeInsets _kBackgroundButtonPadding = EdgeInsets.symmetric( ...@@ -28,6 +28,7 @@ const EdgeInsets _kBackgroundButtonPadding = EdgeInsets.symmetric(
class CupertinoButton extends StatefulWidget { class CupertinoButton extends StatefulWidget {
/// Creates an iOS-style button. /// Creates an iOS-style button.
const CupertinoButton({ const CupertinoButton({
Key key,
@required this.child, @required this.child,
this.padding, this.padding,
this.color, this.color,
...@@ -37,7 +38,8 @@ class CupertinoButton extends StatefulWidget { ...@@ -37,7 +38,8 @@ class CupertinoButton extends StatefulWidget {
this.borderRadius = const BorderRadius.all(Radius.circular(8.0)), this.borderRadius = const BorderRadius.all(Radius.circular(8.0)),
@required this.onPressed, @required this.onPressed,
}) : assert(pressedOpacity == null || (pressedOpacity >= 0.0 && pressedOpacity <= 1.0)), }) : assert(pressedOpacity == null || (pressedOpacity >= 0.0 && pressedOpacity <= 1.0)),
_filled = false; _filled = false,
super(key: key);
/// Creates an iOS-style button with a filled background. /// Creates an iOS-style button with a filled background.
/// ///
...@@ -46,6 +48,7 @@ class CupertinoButton extends StatefulWidget { ...@@ -46,6 +48,7 @@ class CupertinoButton extends StatefulWidget {
/// To specify a custom background color, use the [color] argument of the /// To specify a custom background color, use the [color] argument of the
/// default constructor. /// default constructor.
const CupertinoButton.filled({ const CupertinoButton.filled({
Key key,
@required this.child, @required this.child,
this.padding, this.padding,
this.disabledColor, this.disabledColor,
...@@ -55,7 +58,8 @@ class CupertinoButton extends StatefulWidget { ...@@ -55,7 +58,8 @@ class CupertinoButton extends StatefulWidget {
@required this.onPressed, @required this.onPressed,
}) : assert(pressedOpacity == null || (pressedOpacity >= 0.0 && pressedOpacity <= 1.0)), }) : assert(pressedOpacity == null || (pressedOpacity >= 0.0 && pressedOpacity <= 1.0)),
color = null, color = null,
_filled = true; _filled = true,
super(key: key);
/// The widget below this widget in the tree. /// The widget below this widget in the tree.
/// ///
......
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