Skip to main content

TooltipThemeData

Struct TooltipThemeData 

Source
pub struct TooltipThemeData {
Show 16 fields pub height: Option<f64>, pub constraints: Option<BoxConstraints>, pub padding: Option<EdgeInsetsGeometry>, pub margin: Option<EdgeInsetsGeometry>, pub vertical_offset: Option<f64>, pub prefer_below: Option<bool>, pub exclude_from_semantics: Option<bool>, pub decoration: Option<DecorationRef>, pub text_style: Option<TextStyle>, pub text_align: Option<TextAlign>, pub wait_duration: Option<Duration>, pub show_duration: Option<Duration>, pub exit_duration: Option<Duration>, pub trigger_mode: Option<TooltipTriggerMode>, pub enable_feedback: Option<bool>, pub ignore_pointer: Option<bool>,
}
Expand description

Defines default property values for descendant Tooltip widgets.

Descendant widgets obtain the current TooltipThemeData object using TooltipTheme::of. Instances of TooltipThemeData can be customized with TooltipThemeData::copy_with.

Typically a TooltipThemeData is specified as part of the overall Theme with ThemeData::tooltip_theme.

See also:

  • TooltipTheme, a widget which overrides the tooltip theme for a subtree.
  • ThemeData::tooltip_theme, which specifies a tooltip theme as part of an overall theme.
  • MaterialApp::theme, which specifies a theme for the whole application.

Fields§

§height: Option<f64>
👎Deprecated:

Use TooltipThemeData.constraints instead. This feature was deprecated after v3.30.0-0.1.pre.

The minimum height of the Tooltip’s message.

§constraints: Option<BoxConstraints>

Constrains the size of the Tooltip’s message.

§padding: Option<EdgeInsetsGeometry>

If provided, the amount of space by which to inset the Tooltip’s message.

§margin: Option<EdgeInsetsGeometry>

If provided, the amount of empty space to surround the Tooltip.

§vertical_offset: Option<f64>

The vertical gap between the widget and the displayed tooltip.

When prefer_below is set to true and tooltips have sufficient space to display themselves, this property defines how much vertical space tooltips will position themselves under their corresponding widgets. Otherwise, tooltips will position themselves above their corresponding widgets with the given offset.

§prefer_below: Option<bool>

Whether the tooltip is displayed below its widget by default.

If there is insufficient space to display the tooltip in the preferred direction, the tooltip will be displayed in the opposite direction.

Applying false for the entire app is recommended to avoid having a finger or cursor hide a tooltip.

§exclude_from_semantics: Option<bool>

Whether the Tooltip::message should be excluded from the semantics tree.

By default, Tooltips will add a Semantics label that is set to Tooltip::message. Set this property to true if the app is going to provide its own custom semantics label.

§decoration: Option<DecorationRef>

The Tooltip’s shape and background color.

§text_style: Option<TextStyle>

The style to use for the message of Tooltips.

§text_align: Option<TextAlign>

The TextAlign to use for the message of Tooltips.

§wait_duration: Option<Duration>

The length of time that a pointer must hover over a tooltip’s widget before the tooltip will be shown.

§show_duration: Option<Duration>

The length of time that the tooltip will be shown once it has appeared.

§exit_duration: Option<Duration>

The length of time that a pointer must have stopped hovering over a tooltip’s widget before the tooltip will be hidden.

§trigger_mode: Option<TooltipTriggerMode>

The TooltipTriggerMode that will show the tooltip.

§enable_feedback: Option<bool>

Whether the tooltip should provide acoustic and/or haptic feedback.

For example, on Android a tap will produce a clicking sound and a long-press will produce a short vibration, when feedback is enabled.

This value is used if Tooltip::enable_feedback is null. If this value is null, the default is true.

See also:

  • Feedback, for providing platform-specific feedback to certain actions.
§ignore_pointer: Option<bool>

Whether the tooltip overlay should be invisible to hit testing.

If false, moving the mouse pointer onto the tooltip overlay keeps the tooltip visible (satisfying WCAG 1.4.13 Hoverable).

This value is used if Tooltip::ignore_pointer is null.

Implementations§

Source§

impl TooltipThemeData

Source

pub fn new() -> TooltipThemeData

Creates the set of properties used to configure Tooltips; Dart’s optional named arguments are the fluent setters.

Source

pub fn height(self, height: f64) -> TooltipThemeData

👎Deprecated:

Use TooltipThemeData.constraints instead. This feature was deprecated after v3.30.0-0.1.pre.

Dart TooltipThemeData(height:).

Source

pub fn constraints(self, constraints: BoxConstraints) -> TooltipThemeData

Dart TooltipThemeData(constraints:).

Source

pub fn padding(self, padding: impl Into<EdgeInsetsGeometry>) -> TooltipThemeData

Dart TooltipThemeData(padding:).

Source

pub fn margin(self, margin: impl Into<EdgeInsetsGeometry>) -> TooltipThemeData

Dart TooltipThemeData(margin:).

Source

pub fn vertical_offset(self, vertical_offset: f64) -> TooltipThemeData

Dart TooltipThemeData(verticalOffset:).

Source

pub fn prefer_below(self, prefer_below: bool) -> TooltipThemeData

Dart TooltipThemeData(preferBelow:).

Source

pub fn exclude_from_semantics( self, exclude_from_semantics: bool, ) -> TooltipThemeData

Dart TooltipThemeData(excludeFromSemantics:).

Source

pub fn decoration( self, decoration: impl Into<DecorationRef>, ) -> TooltipThemeData

Dart TooltipThemeData(decoration:).

Source

pub fn text_style(self, text_style: TextStyle) -> TooltipThemeData

Dart TooltipThemeData(textStyle:).

Source

pub fn text_align(self, text_align: TextAlign) -> TooltipThemeData

Dart TooltipThemeData(textAlign:).

Source

pub fn wait_duration(self, wait_duration: Duration) -> TooltipThemeData

Dart TooltipThemeData(waitDuration:).

Source

pub fn show_duration(self, show_duration: Duration) -> TooltipThemeData

Dart TooltipThemeData(showDuration:).

Source

pub fn exit_duration(self, exit_duration: Duration) -> TooltipThemeData

Dart TooltipThemeData(exitDuration:).

Source

pub fn trigger_mode(self, trigger_mode: TooltipTriggerMode) -> TooltipThemeData

Dart TooltipThemeData(triggerMode:).

Source

pub fn enable_feedback(self, enable_feedback: bool) -> TooltipThemeData

Dart TooltipThemeData(enableFeedback:).

Source

pub fn ignore_pointer(self, ignore_pointer: bool) -> TooltipThemeData

Dart TooltipThemeData(ignorePointer:).

Source

pub fn copy_with(&self) -> TooltipThemeData

Creates a copy of this object but with the given fields replaced with the new values.

Dart’s named arguments are the fluent setters on the copy (data.copy_with().prefer_below(false)).

Source

pub fn lerp( a: Option<&TooltipThemeData>, b: Option<&TooltipThemeData>, t: f64, ) -> Option<TooltipThemeData>

Linearly interpolate between two tooltip themes.

If both arguments are null, then null is returned.

{@macro dart.ui.shadow.lerp}

Trait Implementations§

Source§

impl Clone for TooltipThemeData

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TooltipThemeData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TooltipThemeData

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Diagnosticable for TooltipThemeData

Source§

fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)

Add additional properties associated with the node.
Source§

fn type_name(&self) -> &'static str

Dart’s Object.runtimeType as diagnostics print it: the last segment of the Rust type path, without generic arguments.
Source§

fn identity_hash(&self) -> u64

Dart’s Object.hashCode as diagnostics print it: the object’s address.
Source§

fn to_string_short(&self) -> String

A brief description of this object, usually just the type and the hash.
Source§

fn to_diagnostics_node(&self) -> DiagnosticableNode

Returns a debug representation of the object used by debugging tools and by DiagnosticsNode::to_string_deep.
Source§

fn to_diagnostics_node_with( &self, name: Option<String>, style: Option<DiagnosticsTreeStyle>, ) -> DiagnosticableNode

Dart toDiagnosticsNode(name:, style:).
Source§

fn to_string(&self) -> String

Dart’s toString: a single-line description with properties and no children. Read more
Source§

fn to_string_at(&self, min_level: DiagnosticLevel) -> String

Dart’s toString(minLevel:).
Source§

impl Display for TooltipThemeData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for TooltipThemeData

Source§

fn eq(&self, other: &TooltipThemeData) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for TooltipThemeData

§

impl !Send for TooltipThemeData

§

impl !Sync for TooltipThemeData

§

impl !UnwindSafe for TooltipThemeData

§

impl Forget for TooltipThemeData

§

impl Freeze for TooltipThemeData

§

impl Move for TooltipThemeData

§

impl Unpin for TooltipThemeData
where Rc<dyn Decoration>: Unpin, &'static dyn ColorExtension: Unpin, Rc<dyn ColorExtension>: Unpin, *const u8 is !null: Unpin, Rc<Paint>: Unpin,

§

impl UnsafeUnpin for TooltipThemeData

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>