pub struct DefaultTextHeightBehavior {
pub key: Option<KeyRef>,
pub text_height_behavior: TextHeightBehavior,
pub child: WidgetRef,
}Expand description
The TextHeightBehavior that will apply to descendant Text and EditableText
widgets which have not explicitly set Text.text_height_behavior.
If there is a DefaultTextStyle with a non-null DefaultTextStyle.text_height_behavior
below this widget, the DefaultTextStyle.text_height_behavior will be used over this
widget’s TextHeightBehavior.
See also:
DefaultTextStyle, which defines aTextStyleto apply to descendantTextwidgets.
Fields§
§key: Option<KeyRef>See InheritedWidget::key.
text_height_behavior: TextHeightBehaviorDefines how to apply TextStyle.height over and under text.
child: WidgetRefThe widget below this widget in the tree.
Implementations§
Source§impl DefaultTextHeightBehavior
impl DefaultTextHeightBehavior
Sourcepub fn new<K>(
text_height_behavior: TextHeightBehavior,
child: impl IntoWidget<K>,
) -> DefaultTextHeightBehavior
pub fn new<K>( text_height_behavior: TextHeightBehavior, child: impl IntoWidget<K>, ) -> DefaultTextHeightBehavior
Creates a default text height behavior for the given subtree.
Sourcepub fn key(self, key: KeyRef) -> DefaultTextHeightBehavior
pub fn key(self, key: KeyRef) -> DefaultTextHeightBehavior
Dart DefaultTextHeightBehavior(key:).
Sourcepub fn maybe_of(
app: &mut App,
context: BuildContext,
) -> Option<TextHeightBehavior>
pub fn maybe_of( app: &mut App, context: BuildContext, ) -> Option<TextHeightBehavior>
The closest instance of DefaultTextHeightBehavior that encloses the given
context, or None if none is found.
Calling this method will create a dependency on the closest
DefaultTextHeightBehavior in the context, if there is one.
See also:
of, which is similar to this method, but asserts if noDefaultTextHeightBehaviorancestor is found.
Sourcepub fn of(app: &mut App, context: BuildContext) -> TextHeightBehavior
pub fn of(app: &mut App, context: BuildContext) -> TextHeightBehavior
The closest instance of DefaultTextHeightBehavior that encloses the given
context.
If no such instance exists, this method panics.
Calling this method will create a dependency on the closest
DefaultTextHeightBehavior in the context.
See also:
maybe_of, which is similar to this method, but returnsNoneif noDefaultTextHeightBehaviorancestor is found.
Trait Implementations§
Source§impl Debug for DefaultTextHeightBehavior
impl Debug for DefaultTextHeightBehavior
Source§impl InheritedWidget for DefaultTextHeightBehavior
impl InheritedWidget for DefaultTextHeightBehavior
Source§fn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties a dump shows for this widget, in Dart’s
order. Dart’s Widget base only sets the dense tree style, which the framework does.Source§fn update_should_notify(&self, old_widget: &DefaultTextHeightBehavior) -> bool
fn update_should_notify(&self, old_widget: &DefaultTextHeightBehavior) -> bool
Source§fn as_inherited_theme(&self) -> Option<&dyn InheritedTheme>
fn as_inherited_theme(&self) -> Option<&dyn InheritedTheme>
this is InheritedTheme: an inherited widget that is an InheritedTheme
answers with itself, which is what InheritedTheme::capture collects.Auto Trait Implementations§
impl !RefUnwindSafe for DefaultTextHeightBehavior
impl !Send for DefaultTextHeightBehavior
impl !Sync for DefaultTextHeightBehavior
impl !UnwindSafe for DefaultTextHeightBehavior
impl Forget for DefaultTextHeightBehavior
impl Freeze for DefaultTextHeightBehavior
impl Move for DefaultTextHeightBehavior
impl Unpin for DefaultTextHeightBehavior
impl UnsafeUnpin for DefaultTextHeightBehaviorwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const RcInner<dyn Widget> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Widget>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<W> IntoWidget<InheritedKind> for Wwhere
W: InheritedWidget,
impl<W> IntoWidget<InheritedKind> for Wwhere
W: InheritedWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.