pub struct TextSelectionThemeData {
pub cursor_color: Option<Color>,
pub selection_color: Option<Color>,
pub selection_handle_color: Option<Color>,
}Expand description
Defines the text selection visual properties for descendant TextField and
SelectableText widgets.
Descendant widgets obtain the current TextSelectionThemeData object using
TextSelectionTheme::of. Instances of TextSelectionThemeData can be customized
with TextSelectionThemeData::copy_with.
Typically a TextSelectionThemeData is specified as part of the overall Theme
with ThemeData::text_selection_theme.
See also:
TextSelectionTheme, anInheritedWidgetthat propagates the theme down its subtree.InputDecorationThemeData, which defines most other visual properties of text fields.
Fields§
§cursor_color: Option<Color>The color of the cursor in the text field.
The cursor indicates the current location of text insertion point in the field.
selection_color: Option<Color>The background color of selected text.
selection_handle_color: Option<Color>The color of the selection handles on the text field.
Selection handles are used to indicate the bounds of the selected text, or as a handle to drag the cursor to a new location in the text.
On iOS TextField and SelectableText cannot access
selection_handle_color.
To set the selection_handle_color on iOS, you can
change the CupertinoThemeData::selection_handle_color by wrapping the subtree
containing your TextField or SelectableText with a CupertinoTheme.
Implementations§
Source§impl TextSelectionThemeData
impl TextSelectionThemeData
Sourcepub fn new() -> TextSelectionThemeData
pub fn new() -> TextSelectionThemeData
Creates the set of properties used to configure TextFields; Dart’s optional named
arguments are the fluent setters.
Sourcepub fn cursor_color(self, cursor_color: Color) -> TextSelectionThemeData
pub fn cursor_color(self, cursor_color: Color) -> TextSelectionThemeData
Dart TextSelectionThemeData(cursorColor:).
Sourcepub fn selection_color(self, selection_color: Color) -> TextSelectionThemeData
pub fn selection_color(self, selection_color: Color) -> TextSelectionThemeData
Dart TextSelectionThemeData(selectionColor:).
Sourcepub fn selection_handle_color(
self,
selection_handle_color: Color,
) -> TextSelectionThemeData
pub fn selection_handle_color( self, selection_handle_color: Color, ) -> TextSelectionThemeData
Dart TextSelectionThemeData(selectionHandleColor:).
Sourcepub fn copy_with(&self) -> TextSelectionThemeData
pub fn copy_with(&self) -> TextSelectionThemeData
Creates a copy of this object with the given fields replaced with the specified values.
Dart’s named arguments are the fluent setters on the copy
(data.copy_with().cursor_color(color)).
Sourcepub fn lerp(
a: Option<&TextSelectionThemeData>,
b: Option<&TextSelectionThemeData>,
t: f64,
) -> Option<TextSelectionThemeData>
pub fn lerp( a: Option<&TextSelectionThemeData>, b: Option<&TextSelectionThemeData>, t: f64, ) -> Option<TextSelectionThemeData>
Linearly interpolate between two text field themes.
If both arguments are null, then null is returned.
{@macro dart.ui.shadow.lerp}
Trait Implementations§
Source§impl Clone for TextSelectionThemeData
impl Clone for TextSelectionThemeData
Source§impl Debug for TextSelectionThemeData
impl Debug for TextSelectionThemeData
Source§impl Default for TextSelectionThemeData
impl Default for TextSelectionThemeData
Source§impl Diagnosticable for TextSelectionThemeData
impl Diagnosticable for TextSelectionThemeData
Source§fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)
fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Object.runtimeType as diagnostics print it: the last segment of
the Rust type path, without generic arguments.Source§fn identity_hash(&self) -> u64
fn identity_hash(&self) -> u64
Object.hashCode as diagnostics print it: the object’s address.Source§fn to_string_short(&self) -> String
fn to_string_short(&self) -> String
Source§fn to_diagnostics_node(&self) -> DiagnosticableNode
fn to_diagnostics_node(&self) -> DiagnosticableNode
DiagnosticsNode::to_string_deep.Source§fn to_diagnostics_node_with(
&self,
name: Option<String>,
style: Option<DiagnosticsTreeStyle>,
) -> DiagnosticableNode
fn to_diagnostics_node_with( &self, name: Option<String>, style: Option<DiagnosticsTreeStyle>, ) -> DiagnosticableNode
toDiagnosticsNode(name:, style:).Source§fn to_string(&self) -> String
fn to_string(&self) -> String
toString: a single-line description with properties and no
children. Read moreSource§fn to_string_at(&self, min_level: DiagnosticLevel) -> String
fn to_string_at(&self, min_level: DiagnosticLevel) -> String
toString(minLevel:).