Repository: flutter/flutter
File: packages/flutter/lib/src/material/carousel_theme.dart (Dart)

Code before:
/// Descendant widgets obtain the current [CarouselViewThemeData] object using
/// `CarouselTheme.of(context)`. Instances of [CarouselViewThemeData] can be
/// customized with [CarouselViewThemeData.copyWith].
///
/// Typically a [CarouselViewThemeData] is specified as part of the overall [Theme]
/// with [ThemeData.carouselViewTheme].
///
/// All [CarouselViewThemeData] properties are `null` by default. When null, the [CarouselView]
/// will provide its own defaults.
///
/// See also:
///
///  * [CarouselViewTheme], an [InheritedWidget] that propagates the theme to its descendants.
///  * [ThemeData], which describes the overall theme information for the application.
@immutable
class CarouselViewThemeData with Diagnosticable {
  /// Creates a theme that can be used for [ThemeData.carouselViewTheme].
  const CarouselViewThemeData({
    this.elevation,
    this.backgroundColor,
    this.overlayColor,
    this.shape,
    this.padding,
  });

  /// The padding between the carousel's edge and its children.
  final EdgeInsets? padding;

  /// The background color for each carousel item.
  ///
  /// Defaults to [ColorScheme.surface].
  final Color? backgroundColor;

  /// The z-coordinate at which to place this carousel relative to its parent.
  ///
  /// This controls the size of the shadow below the carousel.
  final double? elevation;

  /// The shape of the carousel item's [Material].
  ///
  /// Defines each item's [Material.shape].
  ///
  /// Defaults to a [RoundedRectangleBorder] with a circular corner radius
  /// of 28.0.
  final OutlinedBorder? shape;

  /// The highlight color to indicate the carousel items are in pressed, hovered
  /// or focused states.
  ///
  /// The default values are:
  ///   * [WidgetState.pressed] - [ColorScheme.onSurface] with an opacity of 0.1

Review comment (suggestion):
This doc looks a bit misleading. I think padding is the amount of space to surround each carousel item with. We might also want to mention (like other component theme doc), "Overrides the default value for [CarouselView.padding]". Here and the properties below.

Code after:
/// `CarouselViewTheme.of(context)`. Instances of [CarouselViewThemeData] can be
/// customized with [CarouselViewThemeData.copyWith].
///
/// Typically a [CarouselViewThemeData] is specified as part of the overall [Theme]
/// with [ThemeData.carouselViewTheme].
///
/// All [CarouselViewThemeData] properties are `null` by default. When null, the [CarouselView]
/// will provide its own defaults.
///
/// See also:
///
///  * [CarouselViewTheme], an [InheritedWidget] that propagates the theme to its descendants.
///  * [ThemeData], which describes the overall theme information for the application.
@immutable
class CarouselViewThemeData with Diagnosticable {
  /// Creates a theme that can be used for [ThemeData.carouselViewTheme].
  const CarouselViewThemeData({
    this.elevation,
    this.backgroundColor,
    this.overlayColor,
    this.shape,
    this.padding,
  });

  /// The amount of space to surround each carousel item with.
  ///
  /// Overrides the default value for [CarouselView.padding].
  final EdgeInsets? padding;

  /// The background color for each carousel item.
  ///
  /// Overrides the default value for [CarouselView.backgroundColor].
  final Color? backgroundColor;

  /// The z-coordinate of each carousel item.
  ///
  /// This controls the size of the shadow below the carousel.
  ///
  /// Overrides the default value for [CarouselView.elevation].
  final double? elevation;

  /// The shape of the carousel item's [Material].
  ///
  /// Overrides the default value for [CarouselView.shape].
  final OutlinedBorder? shape;

  /// The highlight color to indicate the carousel items are in pressed, hovered
  /// or focused states.
  ///
  /// Overrides the default value for [CarouselView.overlayColor].
  final WidgetStateProperty<Color?>? overlayColor;