TNumberFieldTheme class

Theme configuration for TNumberField.

TNumberFieldTheme extends TTextFieldTheme with numeric specific properties like:

  • Increment/Decrement values
  • Decimal precision
  • Stepper buttons (plus/minus) builders
  • Custom numeric formatting/parsing
Inheritance

Constructors

TNumberFieldTheme({required WidgetStateProperty<Color> color, required WidgetStateProperty<Color> backgroundColor, required WidgetStateProperty<Color> borderColor, required WidgetStateProperty<TextStyle> labelStyle, required WidgetStateProperty<TextStyle> helperTextStyle, required WidgetStateProperty<TextStyle> errorTextStyle, required WidgetStateProperty<TextStyle> tagStyle, required WidgetStateProperty<BoxDecoration> decoration, required WidgetStateProperty<double> borderRadius, required WidgetStateProperty<double> borderWidth, required WidgetStateProperty<LabelBuilder> labelBuilder, required WidgetStateProperty<HelperTextBuilder> helperTextBuilder, required WidgetStateProperty<ErrorsBuilder> errorsBuilder, required WidgetStateProperty<TextStyle> textStyle, required WidgetStateProperty<TextStyle> hintStyle, TInputSize size = TInputSize.md, TInputDecorationType decorationType = TInputDecorationType.box, Widget? preWidget, Widget? postWidget, double? height, EdgeInsets? padding, double? fontSize, List<TextInputFormatter>? inputFormatters, TextInputType? keyboardType, TextCapitalization textCapitalization = TextCapitalization.none, bool autocorrect = false, bool enableSuggestions = false, int? maxLength, MaxLengthEnforcement? maxLengthEnforcement, TextInputAction? textInputAction, bool obscureText = false, required num increment, required num decrement, required int? decimals, StepperButtonBuilder? increaseButtonBuilder, StepperButtonBuilder? decreaseButtonBuilder, StepperBuilder? stepperBuilder})
Creates a number field theme.
const
TNumberFieldTheme.defaultTheme(ColorScheme colors)
Creates a default theme derived from the context colors.
factory

Properties

autocorrect bool
Whether to enable autocorrect.
finalinherited
backgroundColor WidgetStateProperty<Color>
finalinherited
borderColor WidgetStateProperty<Color>
finalinherited
borderRadius WidgetStateProperty<double>
finalinherited
borderWidth WidgetStateProperty<double>
finalinherited
color WidgetStateProperty<Color>
finalinherited
decimals int?
The number of decimal places to allow (null for infinite).
final
decoration WidgetStateProperty<BoxDecoration>
finalinherited
decorationType TInputDecorationType
finalinherited
decreaseButtonBuilder StepperButtonBuilder?
Builder for the decrease (-) button.
final
decrement num
The amount to decrease the value by.
final
enableSuggestions bool
Whether to show suggestions.
finalinherited
errorsBuilder WidgetStateProperty<ErrorsBuilder>
finalinherited
errorTextStyle WidgetStateProperty<TextStyle>
finalinherited
fieldFontSize double
no setterinherited
fieldHeight double
no setterinherited
fieldPadding EdgeInsets
no setterinherited
fontSize double?
finalinherited
hashCode int
The hash code for this object.
no setterinherited
height double?
finalinherited
helperTextBuilder WidgetStateProperty<HelperTextBuilder>
finalinherited
helperTextStyle WidgetStateProperty<TextStyle>
finalinherited
hintStyle WidgetStateProperty<TextStyle>
Style for the hint text.
finalinherited
increaseButtonBuilder StepperButtonBuilder?
Builder for the increase (+) button.
final
increment num
The amount to increase the value by.
final
inputFormatters List<TextInputFormatter>?
Input formatters to apply.
finalinherited
keyboardType TextInputType?
The keyboard type to use.
finalinherited
labelBuilder WidgetStateProperty<LabelBuilder>
finalinherited
labelStyle WidgetStateProperty<TextStyle>
finalinherited
maxLength int?
Maximum character length.
finalinherited
maxLengthEnforcement MaxLengthEnforcement?
Policy for enforcing max length.
finalinherited
obscureText bool
Whether to obscure the text (for passwords).
finalinherited
padding EdgeInsets?
finalinherited
postWidget Widget?
finalinherited
preWidget Widget?
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size TInputSize
finalinherited
stepperBuilder StepperBuilder?
Builder for the entire stepper widget (grouping buttons).
final
tagStyle WidgetStateProperty<TextStyle>
finalinherited
textCapitalization TextCapitalization
Text capitalization behavior.
finalinherited
textInputAction TextInputAction?
The text input action (e.g., done, next).
finalinherited
textStyle WidgetStateProperty<TextStyle>
Style for the input text.
finalinherited

Methods

buildContainer(Set<WidgetState> states, {required Widget? child, Widget? additionalPostWidget, Widget? additionalPreWidget, String? label, String? tag, String? helperText, List<String>? errors, bool isRequired = false, bool isMultiline = false, bool block = true}) Widget
inherited
buildTextField(Set<WidgetState> states, {String? label, String? placeholder, bool autoFocus = false, bool readOnly = false, int maxLines = 1, FocusNode? focusNode, TextInputType? keyboardType, TextInputAction? textInputAction, List<TextInputFormatter>? inputFormatters, TextEditingController? controller, ValueChanged<String>? onValueChanged}) TextField
Builds a raw TextField with the theme applied.
inherited
copyWith({TInputSize? size, TInputDecorationType? decorationType, WidgetStateProperty<Color>? color, WidgetStateProperty<Color>? backgroundColor, WidgetStateProperty<Color>? borderColor, WidgetStateProperty<TextStyle>? labelStyle, WidgetStateProperty<TextStyle>? helperTextStyle, WidgetStateProperty<TextStyle>? errorTextStyle, WidgetStateProperty<TextStyle>? tagStyle, WidgetStateProperty<BoxDecoration>? decoration, WidgetStateProperty<double>? borderRadius, WidgetStateProperty<double>? borderWidth, WidgetStateProperty<LabelBuilder>? labelBuilder, WidgetStateProperty<HelperTextBuilder>? helperTextBuilder, WidgetStateProperty<ErrorsBuilder>? errorsBuilder, WidgetStateProperty<TextStyle>? textStyle, WidgetStateProperty<TextStyle>? hintStyle, Widget? preWidget, Widget? postWidget, double? height, EdgeInsets? padding, double? fontSize, List<TextInputFormatter>? inputFormatters, TextInputType? keyboardType, TextCapitalization? textCapitalization, bool? autocorrect, bool? enableSuggestions, int? maxLength, MaxLengthEnforcement? maxLengthEnforcement, TextInputAction? textInputAction, bool? obscureText, num? increment, num? decrement, int? decimals, StepperButtonBuilder? decreaseButtonBuilder, StepperButtonBuilder? increaseButtonBuilder, StepperBuilder? stepperBuilder}) TNumberFieldTheme
override
formatValue<T extends num>(T? value) String
Formats a number to a string based on the theme properties.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parseValue<T extends num>(String text) → T?
Parses a string to a number.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited