Unverified Commit 6055c56e authored by Greg Spencer's avatar Greg Spencer Committed by GitHub

Rename chip's border attribute to shape for consistency. (#16276)

This renames the chip's border attribute to 'shape' so that it is consistent with the other places where we supply a ShapeBorder.

This is a breaking change, but a very small one: the border attribute was introduced only a few months ago, and is not widely used.
parent af9e15f3
...@@ -80,10 +80,10 @@ abstract class ChipAttributes { ...@@ -80,10 +80,10 @@ abstract class ChipAttributes {
/// such as [Text]. /// such as [Text].
TextStyle get labelStyle; TextStyle get labelStyle;
/// The border to draw around the chip. /// The [ShapeBorder] to draw around the chip.
/// ///
/// Defaults to a [StadiumBorder]. Must not be null. /// Defaults to a [StadiumBorder]. Must not be null.
ShapeBorder get border; ShapeBorder get shape;
/// Color to be used for the unselected, enabled chip's background. /// Color to be used for the unselected, enabled chip's background.
/// ///
...@@ -415,11 +415,11 @@ class Chip extends StatelessWidget implements ChipAttributes, DeletableChipAttri ...@@ -415,11 +415,11 @@ class Chip extends StatelessWidget implements ChipAttributes, DeletableChipAttri
this.onDeleted, this.onDeleted,
this.deleteIconColor, this.deleteIconColor,
this.deleteButtonTooltipMessage, this.deleteButtonTooltipMessage,
this.border: const StadiumBorder(), this.shape: const StadiumBorder(),
this.backgroundColor, this.backgroundColor,
this.padding, this.padding,
}) : assert(label != null), }) : assert(label != null),
assert(border != null), assert(shape != null),
super(key: key); super(key: key);
@override @override
...@@ -433,7 +433,7 @@ class Chip extends StatelessWidget implements ChipAttributes, DeletableChipAttri ...@@ -433,7 +433,7 @@ class Chip extends StatelessWidget implements ChipAttributes, DeletableChipAttri
@override @override
final EdgeInsetsGeometry avatarPadding; final EdgeInsetsGeometry avatarPadding;
@override @override
final ShapeBorder border; final ShapeBorder shape;
@override @override
final Color backgroundColor; final Color backgroundColor;
@override @override
...@@ -464,7 +464,7 @@ class Chip extends StatelessWidget implements ChipAttributes, DeletableChipAttri ...@@ -464,7 +464,7 @@ class Chip extends StatelessWidget implements ChipAttributes, DeletableChipAttri
deleteIconColor: deleteIconColor, deleteIconColor: deleteIconColor,
deleteButtonTooltipMessage: deleteButtonTooltipMessage, deleteButtonTooltipMessage: deleteButtonTooltipMessage,
tapEnabled: false, tapEnabled: false,
border: border, shape: shape,
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
padding: padding, padding: padding,
isEnabled: true, isEnabled: true,
...@@ -549,13 +549,13 @@ class InputChip extends StatelessWidget ...@@ -549,13 +549,13 @@ class InputChip extends StatelessWidget
this.disabledColor, this.disabledColor,
this.selectedColor, this.selectedColor,
this.tooltip, this.tooltip,
this.border: const StadiumBorder(), this.shape: const StadiumBorder(),
this.backgroundColor, this.backgroundColor,
this.padding, this.padding,
}) : assert(selected != null), }) : assert(selected != null),
assert(isEnabled != null), assert(isEnabled != null),
assert(label != null), assert(label != null),
assert(border != null), assert(shape != null),
super(key: key); super(key: key);
@override @override
...@@ -593,7 +593,7 @@ class InputChip extends StatelessWidget ...@@ -593,7 +593,7 @@ class InputChip extends StatelessWidget
@override @override
final String tooltip; final String tooltip;
@override @override
final ShapeBorder border; final ShapeBorder shape;
@override @override
final Color backgroundColor; final Color backgroundColor;
@override @override
...@@ -620,7 +620,7 @@ class InputChip extends StatelessWidget ...@@ -620,7 +620,7 @@ class InputChip extends StatelessWidget
disabledColor: disabledColor, disabledColor: disabledColor,
selectedColor: selectedColor, selectedColor: selectedColor,
tooltip: tooltip, tooltip: tooltip,
border: border, shape: shape,
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
padding: padding, padding: padding,
isEnabled: isEnabled && (onSelected != null || onDeleted != null || onPressed != null), isEnabled: isEnabled && (onSelected != null || onDeleted != null || onPressed != null),
...@@ -696,12 +696,12 @@ class ChoiceChip extends StatelessWidget ...@@ -696,12 +696,12 @@ class ChoiceChip extends StatelessWidget
this.selectedColor, this.selectedColor,
this.disabledColor, this.disabledColor,
this.tooltip, this.tooltip,
this.border: const StadiumBorder(), this.shape: const StadiumBorder(),
this.backgroundColor, this.backgroundColor,
this.padding, this.padding,
}) : assert(selected != null), }) : assert(selected != null),
assert(label != null), assert(label != null),
assert(border != null), assert(shape != null),
super(key: key); super(key: key);
@override @override
...@@ -725,7 +725,7 @@ class ChoiceChip extends StatelessWidget ...@@ -725,7 +725,7 @@ class ChoiceChip extends StatelessWidget
@override @override
final String tooltip; final String tooltip;
@override @override
final ShapeBorder border; final ShapeBorder shape;
@override @override
final Color backgroundColor; final Color backgroundColor;
@override @override
...@@ -748,7 +748,7 @@ class ChoiceChip extends StatelessWidget ...@@ -748,7 +748,7 @@ class ChoiceChip extends StatelessWidget
showCheckmark: false, showCheckmark: false,
onDeleted: null, onDeleted: null,
tooltip: tooltip, tooltip: tooltip,
border: border, shape: shape,
disabledColor: disabledColor, disabledColor: disabledColor,
selectedColor: selectedColor, selectedColor: selectedColor,
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
...@@ -861,12 +861,12 @@ class FilterChip extends StatelessWidget ...@@ -861,12 +861,12 @@ class FilterChip extends StatelessWidget
this.disabledColor, this.disabledColor,
this.selectedColor, this.selectedColor,
this.tooltip, this.tooltip,
this.border: const StadiumBorder(), this.shape: const StadiumBorder(),
this.backgroundColor, this.backgroundColor,
this.padding, this.padding,
}) : assert(selected != null), }) : assert(selected != null),
assert(label != null), assert(label != null),
assert(border != null), assert(shape != null),
super(key: key); super(key: key);
@override @override
...@@ -890,7 +890,7 @@ class FilterChip extends StatelessWidget ...@@ -890,7 +890,7 @@ class FilterChip extends StatelessWidget
@override @override
final String tooltip; final String tooltip;
@override @override
final ShapeBorder border; final ShapeBorder shape;
@override @override
final Color backgroundColor; final Color backgroundColor;
@override @override
...@@ -911,7 +911,7 @@ class FilterChip extends StatelessWidget ...@@ -911,7 +911,7 @@ class FilterChip extends StatelessWidget
onSelected: onSelected, onSelected: onSelected,
selected: selected, selected: selected,
tooltip: tooltip, tooltip: tooltip,
border: border, shape: shape,
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
disabledColor: disabledColor, disabledColor: disabledColor,
selectedColor: selectedColor, selectedColor: selectedColor,
...@@ -976,11 +976,11 @@ class ActionChip extends StatelessWidget implements ChipAttributes, TappableChip ...@@ -976,11 +976,11 @@ class ActionChip extends StatelessWidget implements ChipAttributes, TappableChip
this.avatarPadding, this.avatarPadding,
@required this.onPressed, @required this.onPressed,
this.tooltip, this.tooltip,
this.border: const StadiumBorder(), this.shape: const StadiumBorder(),
this.backgroundColor, this.backgroundColor,
this.padding, this.padding,
}) : assert(label != null), }) : assert(label != null),
assert(border != null), assert(shape != null),
assert(onPressed != null), assert(onPressed != null),
super(key: key); super(key: key);
...@@ -999,7 +999,7 @@ class ActionChip extends StatelessWidget implements ChipAttributes, TappableChip ...@@ -999,7 +999,7 @@ class ActionChip extends StatelessWidget implements ChipAttributes, TappableChip
@override @override
final String tooltip; final String tooltip;
@override @override
final ShapeBorder border; final ShapeBorder shape;
@override @override
final Color backgroundColor; final Color backgroundColor;
@override @override
...@@ -1015,7 +1015,7 @@ class ActionChip extends StatelessWidget implements ChipAttributes, TappableChip ...@@ -1015,7 +1015,7 @@ class ActionChip extends StatelessWidget implements ChipAttributes, TappableChip
tooltip: tooltip, tooltip: tooltip,
labelStyle: labelStyle, labelStyle: labelStyle,
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
border: border, shape: shape,
padding: padding, padding: padding,
labelPadding: labelPadding, labelPadding: labelPadding,
avatarPadding: avatarPadding, avatarPadding: avatarPadding,
...@@ -1089,10 +1089,10 @@ class RawChip extends StatefulWidget ...@@ -1089,10 +1089,10 @@ class RawChip extends StatefulWidget
Color disabledColor, Color disabledColor,
Color selectedColor, Color selectedColor,
this.tooltip, this.tooltip,
@required this.border, @required this.shape,
Color backgroundColor, Color backgroundColor,
}) : assert(label != null), }) : assert(label != null),
assert(border != null), assert(shape != null),
assert(isEnabled != null), assert(isEnabled != null),
padding = padding ?? _kDefaultPadding, padding = padding ?? _kDefaultPadding,
labelPadding = labelPadding ?? _kDefaultLabelPadding, labelPadding = labelPadding ?? _kDefaultLabelPadding,
...@@ -1139,7 +1139,7 @@ class RawChip extends StatefulWidget ...@@ -1139,7 +1139,7 @@ class RawChip extends StatefulWidget
@override @override
final String tooltip; final String tooltip;
@override @override
final ShapeBorder border; final ShapeBorder shape;
@override @override
final Color backgroundColor; final Color backgroundColor;
@override @override
...@@ -1393,7 +1393,7 @@ class _RawChipState extends State<RawChip> with TickerProviderStateMixin<RawChip ...@@ -1393,7 +1393,7 @@ class _RawChipState extends State<RawChip> with TickerProviderStateMixin<RawChip
return new Material( return new Material(
elevation: isTapping ? _kPressElevation : 0.0, elevation: isTapping ? _kPressElevation : 0.0,
animationDuration: pressedAnimationDuration, animationDuration: pressedAnimationDuration,
shape: widget.border, shape: widget.shape,
child: new InkResponse( child: new InkResponse(
onTap: canTap ? _handleTap : null, onTap: canTap ? _handleTap : null,
onTapDown: canTap ? _handleTapDown : null, onTapDown: canTap ? _handleTapDown : null,
...@@ -1403,7 +1403,7 @@ class _RawChipState extends State<RawChip> with TickerProviderStateMixin<RawChip ...@@ -1403,7 +1403,7 @@ class _RawChipState extends State<RawChip> with TickerProviderStateMixin<RawChip
builder: (BuildContext context, Widget child) { builder: (BuildContext context, Widget child) {
return new Container( return new Container(
decoration: new ShapeDecoration( decoration: new ShapeDecoration(
shape: widget.border, shape: widget.shape,
color: backgroundColor, color: backgroundColor,
), ),
child: child, child: child,
......
...@@ -550,7 +550,7 @@ void main() { ...@@ -550,7 +550,7 @@ void main() {
new RawChip( new RawChip(
avatar: avatar, avatar: avatar,
label: new Text('Chip', key: labelKey), label: new Text('Chip', key: labelKey),
border: const StadiumBorder(), shape: const StadiumBorder(),
), ),
], ],
), ),
...@@ -674,7 +674,7 @@ void main() { ...@@ -674,7 +674,7 @@ void main() {
: null, : null,
deleteIcon: new Container(width: 40.0, height: 40.0, key: deleteButtonKey), deleteIcon: new Container(width: 40.0, height: 40.0, key: deleteButtonKey),
label: new Text('Chip', key: labelKey), label: new Text('Chip', key: labelKey),
border: const StadiumBorder(), shape: const StadiumBorder(),
); );
}), }),
], ],
...@@ -792,7 +792,7 @@ void main() { ...@@ -792,7 +792,7 @@ void main() {
: null, : null,
selected: selected, selected: selected,
label: new Text('Chip', key: labelKey), label: new Text('Chip', key: labelKey),
border: const StadiumBorder(), shape: const StadiumBorder(),
showCheckmark: true, showCheckmark: true,
tapEnabled: true, tapEnabled: true,
isEnabled: true, isEnabled: true,
...@@ -876,7 +876,7 @@ void main() { ...@@ -876,7 +876,7 @@ void main() {
: null, : null,
selected: selected, selected: selected,
label: new Text('Chip', key: labelKey), label: new Text('Chip', key: labelKey),
border: const StadiumBorder(), shape: const StadiumBorder(),
showCheckmark: true, showCheckmark: true,
tapEnabled: true, tapEnabled: true,
isEnabled: true, isEnabled: true,
...@@ -955,7 +955,7 @@ void main() { ...@@ -955,7 +955,7 @@ void main() {
: null, : null,
selected: selected, selected: selected,
label: new Text('Chip', key: labelKey), label: new Text('Chip', key: labelKey),
border: const StadiumBorder(), shape: const StadiumBorder(),
showCheckmark: false, showCheckmark: false,
tapEnabled: true, tapEnabled: true,
isEnabled: true, isEnabled: true,
......
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