Unverified Commit b2cf1a24 authored by Natalie Sampsell's avatar Natalie Sampsell Committed by GitHub

SegmentedControl -> CupertinoSegmentedControl (#20267)

parent a49bffa5
...@@ -63,7 +63,7 @@ const Duration _kFadeDuration = Duration(milliseconds: 165); ...@@ -63,7 +63,7 @@ const Duration _kFadeDuration = Duration(milliseconds: 165);
/// See also: /// See also:
/// ///
/// * <https://developer.apple.com/design/human-interface-guidelines/ios/controls/segmented-controls/> /// * <https://developer.apple.com/design/human-interface-guidelines/ios/controls/segmented-controls/>
class SegmentedControl<T> extends StatefulWidget { class CupertinoSegmentedControl<T> extends StatefulWidget {
/// Creates an iOS-style segmented control bar. /// Creates an iOS-style segmented control bar.
/// ///
/// The [children], [onValueChanged], [unselectedColor], [selectedColor], /// The [children], [onValueChanged], [unselectedColor], [selectedColor],
...@@ -80,7 +80,7 @@ class SegmentedControl<T> extends StatefulWidget { ...@@ -80,7 +80,7 @@ class SegmentedControl<T> extends StatefulWidget {
/// If no [groupValue] is provided, or the [groupValue] is null, no widget will /// If no [groupValue] is provided, or the [groupValue] is null, no widget will
/// appear as selected. The [groupValue] must be either null or one of the keys /// appear as selected. The [groupValue] must be either null or one of the keys
/// in the [children] map. /// in the [children] map.
SegmentedControl({ CupertinoSegmentedControl({
Key key, Key key,
@required this.children, @required this.children,
@required this.onValueChanged, @required this.onValueChanged,
...@@ -144,7 +144,7 @@ class SegmentedControl<T> extends StatefulWidget { ...@@ -144,7 +144,7 @@ class SegmentedControl<T> extends StatefulWidget {
/// @override /// @override
/// Widget build(BuildContext context) { /// Widget build(BuildContext context) {
/// return new Container( /// return new Container(
/// child: new SegmentedControl<int>( /// child: new CupertinoSegmentedControl<int>(
/// children: children, /// children: children,
/// onValueChanged: (int newValue) { /// onValueChanged: (int newValue) {
/// setState(() { /// setState(() {
...@@ -198,8 +198,8 @@ class SegmentedControl<T> extends StatefulWidget { ...@@ -198,8 +198,8 @@ class SegmentedControl<T> extends StatefulWidget {
_SegmentedControlState<T> createState() => _SegmentedControlState<T>(); _SegmentedControlState<T> createState() => _SegmentedControlState<T>();
} }
class _SegmentedControlState<T> extends State<SegmentedControl<T>> class _SegmentedControlState<T> extends State<CupertinoSegmentedControl<T>>
with TickerProviderStateMixin<SegmentedControl<T>> { with TickerProviderStateMixin<CupertinoSegmentedControl<T>> {
T _pressedKey; T _pressedKey;
final List<AnimationController> _selectionControllers = <AnimationController>[]; final List<AnimationController> _selectionControllers = <AnimationController>[];
...@@ -308,7 +308,7 @@ class _SegmentedControlState<T> extends State<SegmentedControl<T>> ...@@ -308,7 +308,7 @@ class _SegmentedControlState<T> extends State<SegmentedControl<T>>
} }
@override @override
void didUpdateWidget(SegmentedControl<T> oldWidget) { void didUpdateWidget(CupertinoSegmentedControl<T> oldWidget) {
super.didUpdateWidget(oldWidget); super.didUpdateWidget(oldWidget);
if (oldWidget.children.length != widget.children.length) { if (oldWidget.children.length != widget.children.length) {
......
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