Skip to main content

InputDecorationTheme

Struct InputDecorationTheme 

Source
pub struct InputDecorationTheme {
    pub key: Option<KeyRef>,
    /* private fields */
}
Expand description

Defines the default appearance of InputDecorators.

Descendant widgets obtain the current theme’s InputDecorationThemeData using InputDecorationTheme::of. When a widget uses InputDecorationTheme::of, it is automatically rebuilt if the theme later changes.

See also:

  • InputDecorationThemeData, which describes the actual configuration of an input decoration theme.
  • ThemeData::input_decoration_theme, which specifies an input decoration theme as part of the overall Material theme.

Dart’s constructor takes either the properties or a data; here the properties are the with_* setters and with_data the other, and each setter that breaks Dart’s constructor assert (a data together with any property) fails in a debug build. The getters are methods, as Dart’s, hence the with_ prefix.

Fields§

§key: Option<KeyRef>

Implementations§

Source§

impl InputDecorationTheme

Source

pub fn new() -> InputDecorationTheme

Creates a InputDecorationTheme that controls visual parameters for descendant InputDecorators.

Source

pub fn key(self, key: KeyRef) -> InputDecorationTheme

Dart InputDecorationTheme(key:).

Source

pub fn child<K>(self, child: impl IntoWidget<K>) -> InputDecorationTheme

Dart InputDecorationTheme(child:); the default is SizedBox::shrink().

Source

pub fn with_data(self, data: InputDecorationThemeData) -> InputDecorationTheme

Dart InputDecorationTheme(data:).

Source

pub fn with_label_style( self, label_style: impl Into<AnyTextStyle>, ) -> InputDecorationTheme

Dart InputDecorationTheme(labelStyle:).

Source

pub fn with_floating_label_style( self, floating_label_style: impl Into<AnyTextStyle>, ) -> InputDecorationTheme

Dart InputDecorationTheme(floatingLabelStyle:).

Source

pub fn with_helper_style( self, helper_style: impl Into<AnyTextStyle>, ) -> InputDecorationTheme

Dart InputDecorationTheme(helperStyle:).

Source

pub fn with_helper_max_lines( self, helper_max_lines: i32, ) -> InputDecorationTheme

Dart InputDecorationTheme(helperMaxLines:).

Source

pub fn with_hint_style( self, hint_style: impl Into<AnyTextStyle>, ) -> InputDecorationTheme

Dart InputDecorationTheme(hintStyle:).

Source

pub fn with_hint_fade_duration( self, hint_fade_duration: Duration, ) -> InputDecorationTheme

Dart InputDecorationTheme(hintFadeDuration:).

Source

pub fn with_hint_max_lines(self, hint_max_lines: i32) -> InputDecorationTheme

Dart InputDecorationTheme(hintMaxLines:).

Source

pub fn with_error_style( self, error_style: impl Into<AnyTextStyle>, ) -> InputDecorationTheme

Dart InputDecorationTheme(errorStyle:).

Source

pub fn with_error_max_lines(self, error_max_lines: i32) -> InputDecorationTheme

Dart InputDecorationTheme(errorMaxLines:).

Source

pub fn with_floating_label_behavior( self, floating_label_behavior: FloatingLabelBehavior, ) -> InputDecorationTheme

Dart InputDecorationTheme(floatingLabelBehavior:).

Source

pub fn with_floating_label_alignment( self, floating_label_alignment: FloatingLabelAlignment, ) -> InputDecorationTheme

Dart InputDecorationTheme(floatingLabelAlignment:).

Source

pub fn with_is_dense(self, is_dense: bool) -> InputDecorationTheme

Dart InputDecorationTheme(isDense:).

Source

pub fn with_content_padding( self, content_padding: impl Into<EdgeInsetsGeometry>, ) -> InputDecorationTheme

Dart InputDecorationTheme(contentPadding:).

Source

pub fn with_is_collapsed(self, is_collapsed: bool) -> InputDecorationTheme

Dart InputDecorationTheme(isCollapsed:).

Source

pub fn with_icon_color( self, icon_color: impl Into<AnyColor>, ) -> InputDecorationTheme

Dart InputDecorationTheme(iconColor:).

Source

pub fn with_prefix_style( self, prefix_style: impl Into<AnyTextStyle>, ) -> InputDecorationTheme

Dart InputDecorationTheme(prefixStyle:).

Source

pub fn with_prefix_icon_color( self, prefix_icon_color: impl Into<AnyColor>, ) -> InputDecorationTheme

Dart InputDecorationTheme(prefixIconColor:).

Source

pub fn with_prefix_icon_constraints( self, prefix_icon_constraints: BoxConstraints, ) -> InputDecorationTheme

Dart InputDecorationTheme(prefixIconConstraints:).

Source

pub fn with_suffix_style( self, suffix_style: impl Into<AnyTextStyle>, ) -> InputDecorationTheme

Dart InputDecorationTheme(suffixStyle:).

Source

pub fn with_suffix_icon_color( self, suffix_icon_color: impl Into<AnyColor>, ) -> InputDecorationTheme

Dart InputDecorationTheme(suffixIconColor:).

Source

pub fn with_suffix_icon_constraints( self, suffix_icon_constraints: BoxConstraints, ) -> InputDecorationTheme

Dart InputDecorationTheme(suffixIconConstraints:).

Source

pub fn with_counter_style( self, counter_style: impl Into<AnyTextStyle>, ) -> InputDecorationTheme

Dart InputDecorationTheme(counterStyle:).

Source

pub fn with_filled(self, filled: bool) -> InputDecorationTheme

Dart InputDecorationTheme(filled:).

Source

pub fn with_fill_color( self, fill_color: impl Into<AnyColor>, ) -> InputDecorationTheme

Dart InputDecorationTheme(fillColor:).

Source

pub fn with_active_indicator_border( self, active_indicator_border: impl Into<AnyBorderSide>, ) -> InputDecorationTheme

Dart InputDecorationTheme(activeIndicatorBorder:).

Source

pub fn with_outline_border( self, outline_border: impl Into<AnyBorderSide>, ) -> InputDecorationTheme

Dart InputDecorationTheme(outlineBorder:).

Source

pub fn with_focus_color(self, focus_color: Color) -> InputDecorationTheme

Dart InputDecorationTheme(focusColor:).

Source

pub fn with_hover_color(self, hover_color: Color) -> InputDecorationTheme

Dart InputDecorationTheme(hoverColor:).

Source

pub fn with_error_border( self, error_border: impl Into<InputBorderRef>, ) -> InputDecorationTheme

Dart InputDecorationTheme(errorBorder:).

Source

pub fn with_focused_border( self, focused_border: impl Into<InputBorderRef>, ) -> InputDecorationTheme

Dart InputDecorationTheme(focusedBorder:).

Source

pub fn with_focused_error_border( self, focused_error_border: impl Into<InputBorderRef>, ) -> InputDecorationTheme

Dart InputDecorationTheme(focusedErrorBorder:).

Source

pub fn with_disabled_border( self, disabled_border: impl Into<InputBorderRef>, ) -> InputDecorationTheme

Dart InputDecorationTheme(disabledBorder:).

Source

pub fn with_enabled_border( self, enabled_border: impl Into<InputBorderRef>, ) -> InputDecorationTheme

Dart InputDecorationTheme(enabledBorder:).

Source

pub fn with_border( self, border: impl Into<InputBorderRef>, ) -> InputDecorationTheme

Dart InputDecorationTheme(border:).

Source

pub fn with_align_label_with_hint( self, align_label_with_hint: bool, ) -> InputDecorationTheme

Dart InputDecorationTheme(alignLabelWithHint:).

Source

pub fn with_constraints( self, constraints: BoxConstraints, ) -> InputDecorationTheme

Dart InputDecorationTheme(constraints:).

Source

pub fn with_visual_density( self, visual_density: VisualDensity, ) -> InputDecorationTheme

Dart InputDecorationTheme(visualDensity:).

Source

pub fn label_style(&self) -> Option<AnyTextStyle>

Overrides the default value for InputDecoration::label_style.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::label_style property in data instead.

Source

pub fn floating_label_style(&self) -> Option<AnyTextStyle>

Overrides the default value for InputDecoration::floating_label_style.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::floating_label_style property in data instead.

Source

pub fn helper_style(&self) -> Option<AnyTextStyle>

Overrides the default value for InputDecoration::floating_label_style.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::helper_style property in data instead.

Source

pub fn helper_max_lines(&self) -> Option<i32>

Overrides the default value for InputDecoration::helper_max_lines.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::helper_max_lines property in data instead.

Source

pub fn hint_style(&self) -> Option<AnyTextStyle>

Overrides the default value for InputDecoration::hint_style.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::hint_style property in data instead.

Source

pub fn hint_fade_duration(&self) -> Option<Duration>

Overrides the default value for InputDecoration::hint_fade_duration.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::hint_fade_duration property in data instead.

Source

pub fn hint_max_lines(&self) -> Option<i32>

Overrides the default value for InputDecoration::hint_max_lines.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::hint_max_lines property in data instead.

Source

pub fn error_style(&self) -> Option<AnyTextStyle>

Overrides the default value for InputDecoration::error_style.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::error_style property in data instead.

Source

pub fn error_max_lines(&self) -> Option<i32>

Overrides the default value for InputDecoration::error_max_lines.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::error_max_lines property in data instead.

Source

pub fn floating_label_behavior(&self) -> FloatingLabelBehavior

Overrides the default value for InputDecoration::floating_label_behavior.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::floating_label_behavior property in data instead.

Source

pub fn floating_label_alignment(&self) -> FloatingLabelAlignment

Overrides the default value for InputDecoration::floating_label_alignment.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::floating_label_alignment property in data instead.

Source

pub fn is_dense(&self) -> bool

Overrides the default value for InputDecoration::is_dense.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::is_dense property in data instead.

Source

pub fn content_padding(&self) -> Option<EdgeInsetsGeometry>

Overrides the default value for InputDecoration::content_padding.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::content_padding property in data instead.

Source

pub fn is_collapsed(&self) -> bool

Overrides the default value for InputDecoration::is_collapsed.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::is_collapsed property in data instead.

Source

pub fn icon_color(&self) -> Option<AnyColor>

Overrides the default value for InputDecoration::icon_color.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::icon_color property in data instead.

Source

pub fn prefix_style(&self) -> Option<AnyTextStyle>

Overrides the default value for InputDecoration::prefix_style.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::prefix_style property in data instead.

Source

pub fn prefix_icon_color(&self) -> Option<AnyColor>

Overrides the default value for InputDecoration::prefix_icon_color.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::prefix_icon_color property in data instead.

Source

pub fn prefix_icon_constraints(&self) -> Option<BoxConstraints>

Overrides the default value for InputDecoration::prefix_icon_constraints.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::prefix_icon_constraints property in data instead.

Source

pub fn suffix_style(&self) -> Option<AnyTextStyle>

Overrides the default value for InputDecoration::suffix_style.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::suffix_style property in data instead.

Source

pub fn suffix_icon_color(&self) -> Option<AnyColor>

Overrides the default value for InputDecoration::suffix_icon_color.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::suffix_icon_color property in data instead.

Source

pub fn suffix_icon_constraints(&self) -> Option<BoxConstraints>

Overrides the default value for InputDecoration::suffix_icon_constraints.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::suffix_icon_constraints property in data instead.

Source

pub fn counter_style(&self) -> Option<AnyTextStyle>

Overrides the default value for InputDecoration::counter_style.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::counter_style property in data instead.

Source

pub fn filled(&self) -> bool

Overrides the default value for InputDecoration::filled.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::filled property in data instead.

Source

pub fn fill_color(&self) -> Option<AnyColor>

Overrides the default value for InputDecoration::fill_color.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::fill_color property in data instead.

Source

pub fn active_indicator_border(&self) -> Option<AnyBorderSide>

The borderSide of the UnderlineInputBorder with color and weight.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::active_indicator_border property in data instead.

Source

pub fn outline_border(&self) -> Option<AnyBorderSide>

The borderSide of the OutlineInputBorder with color and weight.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::outline_border property in data instead.

Source

pub fn focus_color(&self) -> Option<Color>

Overrides the default value for InputDecoration::focus_color.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::focus_color property in data instead.

Source

pub fn hover_color(&self) -> Option<Color>

Overrides the default value for InputDecoration::hover_color.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::hover_color property in data instead.

Source

pub fn error_border(&self) -> Option<&InputBorderRef>

Overrides the default value for InputDecoration::error_border.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::error_border property in data instead.

Source

pub fn focused_border(&self) -> Option<&InputBorderRef>

Overrides the default value for InputDecoration::focused_border.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::focused_border property in data instead.

Source

pub fn focused_error_border(&self) -> Option<&InputBorderRef>

Overrides the default value for InputDecoration::focused_error_border.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::focused_error_border property in data instead.

Source

pub fn disabled_border(&self) -> Option<&InputBorderRef>

Overrides the default value for InputDecoration::disabled_border.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::disabled_border property in data instead.

Source

pub fn enabled_border(&self) -> Option<&InputBorderRef>

Overrides the default value for InputDecoration::enabled_border.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::enabled_border property in data instead.

Source

pub fn border(&self) -> Option<&InputBorderRef>

Overrides the default value for InputDecoration::border.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::border property in data instead.

Source

pub fn align_label_with_hint(&self) -> bool

Overrides the default value for InputDecoration::align_label_with_hint.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::align_label_with_hint property in data instead.

Source

pub fn constraints(&self) -> Option<BoxConstraints>

Overrides the default value for InputDecoration::constraints.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::constraints property in data instead.

Source

pub fn visual_density(&self) -> Option<VisualDensity>

Overrides the default value for InputDecoration::visual_density.

This property is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::visual_density property in data instead.

Source

pub fn data(&self) -> InputDecorationThemeData

The properties used for all descendant TabBar widgets.

Source

pub fn of(app: &mut App, context: BuildContext) -> InputDecorationThemeData

Returns the closest InputDecorationThemeData instance given the build context.

If there is no enclosing InputDecorationTheme widget, then ThemeData::input_decoration_theme is used.

Typical usage is as follows:

InputDecorationThemeData theme = InputDecorationTheme.of(context);
Source

pub fn copy_with(&self) -> InputDecorationTheme

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

This method is obsolete and will be deprecated in a future release: please use the InputDecorationThemeData::copy_with instead.

Dart’s named arguments are the with_* setters on the copy (theme.copy_with().with_is_dense(true)). As in Dart, the copy carries neither the key nor the child, and holds the properties, never a data.

Source

pub fn merge( &self, other: Option<&InputDecorationTheme>, ) -> InputDecorationTheme

Returns a copy of this InputDecorationTheme where the non-null fields in the given InputDecorationTheme override the corresponding nullable fields in this InputDecorationTheme.

The non-nullable fields of InputDecorationTheme, such as floating_label_behavior, is_dense, is_collapsed, filled, and align_label_with_hint cannot be overridden.

In other words, the fields of the provided InputDecorationTheme are used to fill in the unspecified and nullable fields of this InputDecorationTheme.

Trait Implementations§

Source§

impl Clone for InputDecorationTheme

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 InputDecorationTheme

Source§

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

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

impl Default for InputDecorationTheme

Source§

fn default() -> InputDecorationTheme

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

impl From<InputDecorationTheme> for InputDecorationThemeData

Source§

fn from(theme: InputDecorationTheme) -> InputDecorationThemeData

Dart’s inputDecorationTheme.data, where an API takes either type.

Source§

impl InheritedTheme for InputDecorationTheme

Source§

fn wrap( &self, _app: &mut App, _context: BuildContext, child: WidgetRef, ) -> WidgetRef

Return a copy of this inherited theme with the specified child. Read more
Source§

impl InheritedWidget for InputDecorationTheme

Source§

fn key(&self) -> Option<&KeyRef>

Source§

fn child(&self) -> &WidgetRef

The widget below this widget in the tree.
Source§

fn update_should_notify(&self, old_widget: &InputDecorationTheme) -> bool

Whether the framework should notify widgets that inherit from this widget. Read more
Source§

fn as_inherited_theme(&self) -> Option<&dyn InheritedTheme>

Dart’s this is InheritedTheme: an inherited widget that is an InheritedTheme answers with itself, which is what InheritedTheme::capture collects.
Source§

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

Dart’s 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 debug_check_constructor(&self)

Auto Trait Implementations§

§

impl !RefUnwindSafe for InputDecorationTheme

§

impl !Send for InputDecorationTheme

§

impl !Sync for InputDecorationTheme

§

impl !UnwindSafe for InputDecorationTheme

§

impl Forget for InputDecorationTheme

§

impl Freeze for InputDecorationTheme
where *const RcInner<dyn Key> is !null: Freeze, PhantomData<RcInner<dyn Key>>: Freeze, &'static dyn ColorExtension: Freeze, *const RcInner<dyn ColorExtension> is !null: Freeze, PhantomData<RcInner<dyn ColorExtension>>: Freeze, *const u8 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<String>: Freeze, *const RcInner<Paint> is !null: Freeze, PhantomData<RcInner<Paint>>: Freeze, PhantomData<Shadow>: Freeze, PhantomData<FontFeature>: Freeze, PhantomData<FontVariation>: Freeze, *const RcInner<dyn TextStyleExtension> is !null: Freeze, PhantomData<RcInner<dyn TextStyleExtension>>: Freeze, *const RcInner<dyn BorderSideExtension> is !null: Freeze, PhantomData<RcInner<dyn BorderSideExtension>>: Freeze, *const RcInner<dyn InputBorder> is !null: Freeze, PhantomData<RcInner<dyn InputBorder>>: Freeze, *const RcInner<dyn Widget> is !null: Freeze, PhantomData<RcInner<dyn Widget>>: Freeze,

§

impl Move for InputDecorationTheme

§

impl Unpin for InputDecorationTheme

§

impl UnsafeUnpin for InputDecorationTheme

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<W> IntoWidget<InheritedKind> for W
where W: InheritedWidget,

Source§

fn into_widget(self) -> Rc<dyn Widget>

The widget as a tree node, made where this is called: its creation_location.
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, 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>