Skip to content

Commit d2a60f6

Browse files
Renzo-OlivaresRenzo Olivares
andauthored
Update Theme documentation with Cupertino details (#161980)
Updates `Theme` documentation to note how it interacts with descendant `Cupertino` widgets. Fixes #161573 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. --------- Co-authored-by: Renzo Olivares <[email protected]>
1 parent a7a4da9 commit d2a60f6

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

packages/flutter/lib/src/material/text_selection_theme.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ class TextSelectionThemeData with Diagnosticable {
5353
///
5454
/// On iOS [TextField] and [SelectableText] cannot access [selectionHandleColor].
5555
/// To set the [selectionHandleColor] on iOS, you can change the
56-
/// [CupertinoThemeData.primaryColor] in [ThemeData.cupertinoOverrideTheme].
56+
/// [CupertinoThemeData.primaryColor] by wrapping the subtree containing
57+
/// your [TextField] or [SelectableText] with a [CupertinoTheme].
5758
final Color? selectionHandleColor;
5859

5960
/// Creates a copy of this object with the given fields replaced with the

packages/flutter/lib/src/material/theme.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ const Duration kThemeAnimationDuration = Duration(milliseconds: 200);
3232
/// The [Theme] widget implies an [IconTheme] widget, set to the value of the
3333
/// [ThemeData.iconTheme] of the [data] for the [Theme].
3434
///
35+
/// To interact seamlessly with descendant Cupertino widgets, the [Theme] widget
36+
/// provides a [CupertinoTheme] for its descendants with a [CupertinoThemeData] inherited
37+
/// from the nearest ancestor [CupertinoTheme] or if none exists, derived from the
38+
/// Material [data] for the [Theme]. The values in the Material derived [CupertinoThemeData]
39+
/// are overridable through [ThemeData.cupertinoOverrideTheme]. The values from an
40+
/// inherited [CupertinoThemeData] can be overriden by wrapping the desired subtree
41+
/// with a [CupertinoTheme].
42+
///
3543
/// See also:
3644
///
3745
/// * [ThemeData], which describes the actual configuration of a theme.

0 commit comments

Comments
 (0)