Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/material/search_bar_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import 'theme.dart';
/// Defines default property values for descendant [SearchBar] widgets.
///
/// Descendant widgets obtain the current [SearchBarThemeData] object using
/// `SearchBarTheme.of(context)`. Instances of [SearchBarThemeData] can be customized
/// [SearchBarTheme.of]. Instances of [SearchBarThemeData] can be customized
/// with [SearchBarThemeData.copyWith].
///
/// Typically a [SearchBarThemeData] is specified as part of the overall [Theme]
Expand Down
4 changes: 2 additions & 2 deletions packages/flutter/lib/src/material/segmented_button_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import 'theme.dart';
/// [SegmentedButton] widgets.
///
/// Descendant widgets obtain the current [SegmentedButtonThemeData] object with
/// [SegmentedButtonTheme.of]. Instances of [SegmentedButtonTheme] can
/// [SegmentedButtonTheme.of]. Instances of [SegmentedButtonThemeData] can
/// be customized with [SegmentedButtonThemeData.copyWith].
///
/// Typically a [SegmentedButtonTheme] is specified as part of the overall
/// Typically a [SegmentedButtonThemeData] is specified as part of the overall
/// [Theme] with [ThemeData.segmentedButtonTheme].
///
/// All [SegmentedButtonThemeData] properties are null by default. When null,
Expand Down
12 changes: 7 additions & 5 deletions packages/flutter/lib/src/material/slider_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,15 @@ enum Thumb {
end,
}

/// Holds the color, shape, and typography values for a Material Design slider
/// theme.
/// Overrides the default values of visual properties for descendant
/// [Slider] widgets.
///
/// Use this class to configure a [SliderTheme] widget, or to set the
/// [ThemeData.sliderTheme] for a [Theme] widget.
/// Descendant widgets obtain the current [SliderThemeData] object with
/// [SliderTheme.of]. Instances of [SliderThemeData] can
/// be customized with [SliderThemeData.copyWith].
///
/// To obtain the current ambient slider theme, use [SliderTheme.of].
/// Typically a [SliderThemeData] is specified as part of the overall
/// [Theme] with [ThemeData.sliderTheme].
///
/// This theme is for both the [Slider] and the [RangeSlider]. The properties
/// that are only for the [Slider] are: [tickMarkShape], [thumbShape],
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/material/switch_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import 'theme.dart';
/// Defines default property values for descendant [Switch] widgets.
///
/// Descendant widgets obtain the current [SwitchThemeData] object using
/// `SwitchTheme.of(context)`. Instances of [SwitchThemeData] can be customized
/// [SwitchTheme.of]. Instances of [SwitchThemeData] can be customized
/// with [SwitchThemeData.copyWith].
///
/// Typically a [SwitchThemeData] is specified as part of the overall [Theme]
Expand Down
20 changes: 17 additions & 3 deletions packages/flutter/lib/src/material/tab_bar_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@ import 'ink_well.dart';
import 'tabs.dart';
import 'theme.dart';

/// Defines a theme for [TabBar] widgets.
// Examples can assume:
// late BuildContext context;

/// Defines default property values for descendant [TabBar] widgets.
///
/// Descendant widgets obtain the current [TabBarThemeData] object using
/// [TabBarTheme.of].
/// [TabBarTheme.of]. Instances of [TabBarThemeData] can be customized
/// with [TabBarThemeData.copyWith].
///
/// Typically a [TabBarThemeData] is specified as part of the overall [Theme]
/// with [ThemeData.tabBarTheme].
///
/// See also:
///
Expand Down Expand Up @@ -265,7 +272,14 @@ class TabBarTheme extends InheritedTheme with Diagnosticable {
);
}

/// Returns the closest [TabBarThemeData] instance given the build context.
/// Returns the configuration [data] from the closest [TabBarTheme] ancestor.
/// If there is no ancestor, it returns [ThemeData.tabBarTheme].
///
/// Typical usage is as follows:
///
/// ```dart
/// TabBarThemeData theme = TabBarTheme.of(context);
/// ```
static TabBarThemeData of(BuildContext context) {
final TabBarTheme? tabBarTheme = context.dependOnInheritedWidgetOfExactType<TabBarTheme>();
return tabBarTheme?.data ?? Theme.of(context).tabBarTheme;
Expand Down
11 changes: 6 additions & 5 deletions packages/flutter/lib/src/material/text_selection_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ import 'theme.dart';
// Examples can assume:
// late BuildContext context;

/// Defines the visual properties needed for text selection in [TextField] and
/// Defines the text selection visual properties for descendant [TextField] and
/// [SelectableText] widgets.
///
/// Used by [TextSelectionTheme] to control the visual properties of text
/// selection in a widget subtree.
/// Descendant widgets obtain the current [TextSelectionThemeData] object using
/// [TextSelectionTheme.of]. Instances of [TextSelectionThemeData] can be customized
/// with [TextSelectionThemeData.copyWith].
///
/// Use [TextSelectionTheme.of] to access the closest ancestor
/// [TextSelectionTheme] of the current [BuildContext].
/// Typically a [TextSelectionThemeData] is specified as part of the overall [Theme]
/// with [ThemeData.textSelectionTheme].
///
/// See also:
///
Expand Down
13 changes: 5 additions & 8 deletions packages/flutter/lib/src/material/theme_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1427,9 +1427,7 @@ class ThemeData with Diagnosticable {
/// A theme for customizing the appearance and layout of [SegmentedButton] widgets.
final SegmentedButtonThemeData segmentedButtonTheme;

/// The colors and shapes used to render [Slider].
///
/// This is the value returned from [SliderTheme.of].
/// A theme for customizing the appearance and layout of [Slider] widgets.
final SliderThemeData sliderTheme;

/// A theme for customizing colors, shape, elevation, and behavior of a [SnackBar].
Expand All @@ -1445,18 +1443,17 @@ class ThemeData with Diagnosticable {
/// [TextButton]s.
final TextButtonThemeData textButtonTheme;

/// A theme for customizing the appearance and layout of [TextField] widgets.
/// A theme for customizing the appearance for text selection in [TextField] and
/// [SelectableText] widgets.
final TextSelectionThemeData textSelectionTheme;

/// A theme for customizing the appearance and layout of time picker widgets.
final TimePickerThemeData timePickerTheme;

/// Defines the default configuration of [ToggleButtons] widgets.
/// A theme for customizing the appearance and layout of [ToggleButtons] widgets.
final ToggleButtonsThemeData toggleButtonsTheme;

/// A theme for customizing the visual properties of [Tooltip]s.
///
/// This is the value returned from [TooltipTheme.of].
/// A theme for customizing the appearance and layout of [Tooltip] widgets.
final TooltipThemeData tooltipTheme;

/// A theme for customizing the appearance and layout of [ButtonBar] widgets.
Expand Down
13 changes: 6 additions & 7 deletions packages/flutter/lib/src/material/toggle_buttons_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@ import 'theme.dart';
// Examples can assume:
// late BuildContext context;

/// Defines the color and border properties of [ToggleButtons] widgets.
/// Defines default property values for descendant [ToggleButtons] widgets.
///
/// Used by [ToggleButtonsTheme] to control the color and border properties
/// of toggle buttons in a widget subtree.
/// Descendant widgets obtain the current [ToggleButtonsThemeData] object using
/// [ToggleButtonsTheme.of]. Instances of [ToggleButtonsThemeData] can be customized
/// with [ToggleButtonsThemeData.copyWith].
///
/// To obtain the current [ToggleButtonsTheme], use [ToggleButtonsTheme.of].
///
/// Values specified here are used for [ToggleButtons] properties that are not
/// given an explicit non-null value.
/// Typically a [ToggleButtonsThemeData] is specified as part of the overall [Theme]
/// with [ThemeData.toggleButtonsTheme].
///
/// See also:
///
Expand Down
14 changes: 6 additions & 8 deletions packages/flutter/lib/src/material/tooltip_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@ import 'theme.dart';
// Examples can assume:
// late BuildContext context;

/// Defines the visual properties of [Tooltip] widgets, a tooltip theme.
/// Defines default property values for descendant [Tooltip] widgets.
///
/// Each property of [TooltipThemeData] corresponds to a property of [Tooltip],
/// and describes the value to use when the [Tooltip] property is
/// not given an explicit non-null value.
/// Descendant widgets obtain the current [TooltipThemeData] object using
/// [TooltipTheme.of]. Instances of [TooltipThemeData] can be customized
/// with [TooltipThemeData.copyWith].
///
/// Use this class to configure a [TooltipTheme] widget, or to set the
/// [ThemeData.tooltipTheme] for a [Theme] widget or [MaterialApp.theme].
///
/// To obtain the current ambient tooltip theme, use [TooltipTheme.of].
/// Typically a [TooltipThemeData] is specified as part of the overall [Theme]
/// with [ThemeData.tooltipTheme].
///
/// See also:
///
Expand Down