Repository: flutter/flutter
File: packages/flutter/lib/src/cupertino/sliding_segmented_control.dart (Dart)

Code before:
  /// up to meet the min width requirement.
  ///
  /// Defaults to false.
  final bool proportionalWidth;

  /// The color used to paint the interior of the thumb that appears behind the
  /// currently selected item.
  ///
  /// The default value is a [CupertinoDynamicColor] that appears white in light
  /// mode and becomes a gray color in dark mode.
  final Color thumbColor;

  /// The amount of space by which to inset the [children].
  ///
  /// Defaults to `EdgeInsets.symmetric(vertical: 2, horizontal: 3)`.
  final EdgeInsetsGeometry padding;

  /// Determines whether segments in the segmented control show selected state.
  ///
  /// If true, segments in the control don’t show selected state and
  /// don’t update the value of selectedSegmentIndex after tracking ends.
  ///
  /// Defaults to false.
  ///
  /// {@tool dartpad}
  /// This example shows a [CupertinoSlidingSegmentedControl] with [isMomentary] set to true.
  ///
  /// ** See code in examples/api/lib/cupertino/segmented_control/cupertino_sliding_segmented_control.1.dart **
  /// {@end-tool}
  final bool isMomentary;

  @override
  State<CupertinoSlidingSegmentedControl<T>> createState() => _SegmentedControlState<T>();
}

class _SegmentedControlState<T extends Object> extends State<CupertinoSlidingSegmentedControl<T>>
    with TickerProviderStateMixin<CupertinoSlidingSegmentedControl<T>> {
  late final AnimationController thumbController = AnimationController(
    duration: _kSpringAnimationDuration,
    value: 0,
    vsync: this,
  );
  Animatable<Rect?>? thumbAnimatable;

  late final AnimationController thumbScaleController = AnimationController(
    duration: _kSpringAnimationDuration,
    value: 0,
    vsync: this,
  );
  late Animation<double> thumbScaleAnimation = thumbScaleController.drive(
    Tween<double>(begin: 1, end: _kMinThumbScale),

Review comment (suggestion):
```suggestion
  /// This example shows a [CupertinoSlidingSegmentedControl] with [isMomentary] set to true, providing feedback to the user when the segment is selected with a text scaling effect.
```

Code after:
  /// the min width of parent constraints is larger, the segment width will scales
  /// up to meet the min width requirement.
  ///
  /// Defaults to false.
  final bool proportionalWidth;

  /// The color used to paint the interior of the thumb that appears behind the
  /// currently selected item.
  ///
  /// The default value is a [CupertinoDynamicColor] that appears white in light
  /// mode and becomes a gray color in dark mode.
  final Color thumbColor;

  /// The amount of space by which to inset the [children].
  ///
  /// Defaults to `EdgeInsets.symmetric(vertical: 2, horizontal: 3)`.
  final EdgeInsetsGeometry padding;

  /// Determines whether segments provide only momentary feedback when pressed
  /// rather than maintaining a persistent selected state.
  ///
  /// When true, segments behave more like buttons that trigger actions rather
  /// than options that can be selected and remain in that state.
  ///
  /// Defaults to false.
  ///
  /// {@tool dartpad}
  /// This example shows a [CupertinoSlidingSegmentedControl] with [isMomentary] set
  /// to true, providing feedback to the user when the segment is selected with a
  /// text scaling effect.
  ///
  /// ** See code in examples/api/lib/cupertino/segmented_control/cupertino_sliding_segmented_control.0.dart **
  /// {@end-tool}
  final bool isMomentary;

  @override
  State<CupertinoSlidingSegmentedControl<T>> createState() => _SegmentedControlState<T>();
}

class _SegmentedControlState<T extends Object> extends State<CupertinoSlidingSegmentedControl<T>>
    with TickerProviderStateMixin<CupertinoSlidingSegmentedControl<T>> {
  late final AnimationController thumbController = AnimationController(
    duration: _kSpringAnimationDuration,
    value: 0,
    vsync: this,
  );
  Animatable<Rect?>? thumbAnimatable;

  late final AnimationController thumbScaleController = AnimationController(
    duration: _kSpringAnimationDuration,
    value: 0,