BsInput class
A Bootstrap-style text input component.
Implements .form-control from Bootstrap 5.
Integrates natively with Flutter's Form system via FormField.
- Inheritance
- Available extensions
Constructors
-
BsInput({Key? key, TextEditingController? controller, String? initialValue, BsInputSize size = BsInputSize.md, bool disabled = false, bool readonly = false, bool plainText = false, String? placeholder, TextInputType? keyboardType, bool obscureText = false, int? maxLines = 1, int? minLines, FocusNode? focusNode, ValueChanged<
String> ? onChanged, ValueChanged<String> ? onFieldSubmitted, BsValidationState? validationState, BorderRadius? customBorderRadius, FormFieldValidator<String> ? validator, FormFieldSetter<String> ? onSaved, AutovalidateMode? autovalidateMode}) - Creates a BsInput.
Properties
- autovalidateMode → AutovalidateMode
-
Used to enable/disable this form field auto validation and update its
error text.
finalinherited
-
builder
→ FormFieldBuilder<
String> -
Function that returns the widget representing this form field.
finalinherited
- controller → TextEditingController?
-
Controls the text being edited.
final
- customBorderRadius → BorderRadius?
-
Custom border radius. Useful when composing inside an input group.
final
- disabled → bool
-
Whether the input is disabled (grayed out, unclickable).
final
- enabled → bool
-
Whether the form is able to receive user input.
finalinherited
- errorBuilder → FormFieldErrorBuilder?
-
Function that returns the widget representing the error to display.
finalinherited
- focusNode → FocusNode?
-
Defines the keyboard focus for this widget.
final
- forceErrorText → String?
-
An optional property that forces the FormFieldState into an error state
by directly setting the FormFieldState.errorText property without
running the validator function.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialValue → String?
-
An optional value to initialize the form field to, or null otherwise.
finalinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- keyboardType → TextInputType?
-
The type of keyboard to use for editing the text.
final
- maxLines → int?
-
The maximum number of lines to show at one time, wrapping if necessary.
final
- minLines → int?
-
The minimum number of lines to occupy when the content spans fewer lines.
final
- obscureText → bool
-
Whether to hide the text being edited (e.g., for passwords).
final
-
onChanged
→ ValueChanged<
String> ? -
Called when the user initiates a change to the TextField's value: when they have inserted or deleted text.
final
-
onFieldSubmitted
→ ValueChanged<
String> ? -
Called when the user indicates that they are done editing the text in the field.
final
- onReset → VoidCallback?
-
An optional method to call when the form field is reset via
FormFieldState.reset.
finalinherited
-
onSaved
→ FormFieldSetter<
String> ? -
An optional method to call with the final value when the form is saved via
FormState.save.
finalinherited
- placeholder → String?
-
The hint text to display when the input is empty.
final
- plainText → bool
-
Whether to render the input as plain text (
.form-control-plaintext).final - readonly → bool
-
Whether the input is readonly (cannot be modified, but can be focused/selected).
final
- restorationId → String?
-
Restoration ID to save and restore the state of the form field.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → BsInputSize
-
The size of the input.
final
- validationState → BsValidationState?
-
Explicit validation state. Overrides standard
FormFieldvalidation if provided.final -
validator
→ FormFieldValidator<
String> ? -
An optional method that validates an input. Returns an error string to
display if the input is invalid, or null otherwise.
finalinherited
Methods
-
align(
AlignmentGeometry alignment) → Widget -
Available on Widget, provided by the BsAlignmentExtension extension
Aligns the widget within its parent using the givenalignment. -
alignBottom(
) → Widget -
Available on Widget, provided by the BsAlignmentExtension extension
Aligns the widget to the bottom center of its parent. -
alignEnd(
) → Widget -
Available on Widget, provided by the BsAlignmentExtension extension
Aligns the widget to the end (right) of its parent. -
alignStart(
) → Widget -
Available on Widget, provided by the BsAlignmentExtension extension
Aligns the widget to the start (left) of its parent. -
alignTop(
) → Widget -
Available on Widget, provided by the BsAlignmentExtension extension
Aligns the widget to the top center of its parent. -
center(
) → Widget -
Available on Widget, provided by the BsAlignmentExtension extension
Centers the widget within its parent. -
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → FormFieldState< String> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
dNone(
) → Widget -
Available on Widget, provided by the BsDisplayExtension extension
Convenient alias forgone(true). Maps to Bootstrap's.d-none. -
expanded(
[int flex = 1]) → Widget -
Available on Widget, provided by the BsSizeExtension extension
Wraps the widget in an Expanded widget. -
gone(
bool gone) → Widget -
Available on Widget, provided by the BsDisplayExtension extension
Hides the widget and removes it from the layout ifgoneis true. -
h(
double height) → Widget -
Available on Widget, provided by the BsSizeExtension extension
Sets a fixed height for the widget. -
h100(
) → Widget -
Available on Widget, provided by the BsSizeExtension extension
Sets the height to 100% (double.infinity). -
h25(
) → Widget -
Available on Widget, provided by the BsSizeExtension extension
Sets the height to 25% of parent (FractionallySizedBox). -
h50(
) → Widget -
Available on Widget, provided by the BsSizeExtension extension
Sets the height to 50% of parent (FractionallySizedBox). -
h75(
) → Widget -
Available on Widget, provided by the BsSizeExtension extension
Sets the height to 75% of parent (FractionallySizedBox). -
m(
double value) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies uniform margin on all sides. -
m1(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies uniform margin of BsSpacing.s1 on all sides. -
m2(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies uniform margin of BsSpacing.s2 on all sides. -
m3(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies uniform margin of BsSpacing.s3 on all sides. -
m4(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies uniform margin of BsSpacing.s4 on all sides. -
m5(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies uniform margin of BsSpacing.s5 on all sides. -
mb(
double value) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies margin only to the bottom side. -
mb1(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies bottom margin of BsSpacing.s1. -
mb2(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies bottom margin of BsSpacing.s2. -
mb3(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies bottom margin of BsSpacing.s3. -
mb4(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies bottom margin of BsSpacing.s4. -
mb5(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies bottom margin of BsSpacing.s5. -
me(
double value) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies margin only to the end (right) side. -
me1(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies end (right) margin of BsSpacing.s1. -
me2(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies end (right) margin of BsSpacing.s2. -
me3(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies end (right) margin of BsSpacing.s3. -
me4(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies end (right) margin of BsSpacing.s4. -
me5(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies end (right) margin of BsSpacing.s5. -
ms(
double value) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies margin only to the start (left) side. -
ms1(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies start (left) margin of BsSpacing.s1. -
ms2(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies start (left) margin of BsSpacing.s2. -
ms3(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies start (left) margin of BsSpacing.s3. -
ms4(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies start (left) margin of BsSpacing.s4. -
ms5(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies start (left) margin of BsSpacing.s5. -
mt(
double value) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies margin only to the top side. -
mt1(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies top margin of BsSpacing.s1. -
mt2(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies top margin of BsSpacing.s2. -
mt3(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies top margin of BsSpacing.s3. -
mt4(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies top margin of BsSpacing.s4. -
mt5(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies top margin of BsSpacing.s5. -
mx(
double value) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies horizontal margin (left and right). -
mx1(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies horizontal margin (left and right) of BsSpacing.s1. -
mx2(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies horizontal margin (left and right) of BsSpacing.s2. -
mx3(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies horizontal margin (left and right) of BsSpacing.s3. -
mx4(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies horizontal margin (left and right) of BsSpacing.s4. -
mx5(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies horizontal margin (left and right) of BsSpacing.s5. -
my(
double value) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies vertical margin (top and bottom). -
my1(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies vertical margin (top and bottom) of BsSpacing.s1. -
my2(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies vertical margin (top and bottom) of BsSpacing.s2. -
my3(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies vertical margin (top and bottom) of BsSpacing.s3. -
my4(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies vertical margin (top and bottom) of BsSpacing.s4. -
my5(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies vertical margin (top and bottom) of BsSpacing.s5. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
opacity(
double value) → Widget -
Available on Widget, provided by the BsDisplayExtension extension
Sets the opacity of the widget. -
p(
double value) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies uniform padding on all sides. -
p1(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies uniform padding of BsSpacing.s1 on all sides. -
p2(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies uniform padding of BsSpacing.s2 on all sides. -
p3(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies uniform padding of BsSpacing.s3 on all sides. -
p4(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies uniform padding of BsSpacing.s4 on all sides. -
p5(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies uniform padding of BsSpacing.s5 on all sides. -
padding(
EdgeInsets value) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies custom EdgeInsets as padding. -
pb(
double value) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies padding only to the bottom side. -
pb1(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies bottom padding of BsSpacing.s1. -
pb2(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies bottom padding of BsSpacing.s2. -
pb3(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies bottom padding of BsSpacing.s3. -
pb4(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies bottom padding of BsSpacing.s4. -
pb5(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies bottom padding of BsSpacing.s5. -
pe(
double value) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies padding only to the end (right) side. -
pe1(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies end (right) padding of BsSpacing.s1. -
pe2(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies end (right) padding of BsSpacing.s2. -
pe3(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies end (right) padding of BsSpacing.s3. -
pe4(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies end (right) padding of BsSpacing.s4. -
pe5(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies end (right) padding of BsSpacing.s5. -
ps(
double value) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies padding only to the start (left) side. -
ps1(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies start (left) padding of BsSpacing.s1. -
ps2(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies start (left) padding of BsSpacing.s2. -
ps3(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies start (left) padding of BsSpacing.s3. -
ps4(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies start (left) padding of BsSpacing.s4. -
ps5(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies start (left) padding of BsSpacing.s5. -
pt(
double value) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies padding only to the top side. -
pt1(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies top padding of BsSpacing.s1. -
pt2(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies top padding of BsSpacing.s2. -
pt3(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies top padding of BsSpacing.s3. -
pt4(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies top padding of BsSpacing.s4. -
pt5(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies top padding of BsSpacing.s5. -
px(
double value) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies horizontal padding (left and right). -
px1(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies horizontal padding (left and right) of BsSpacing.s1. -
px2(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies horizontal padding (left and right) of BsSpacing.s2. -
px3(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies horizontal padding (left and right) of BsSpacing.s3. -
px4(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies horizontal padding (left and right) of BsSpacing.s4. -
px5(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies horizontal padding (left and right) of BsSpacing.s5. -
py(
double value) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies vertical padding (top and bottom). -
py1(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies vertical padding (top and bottom) of BsSpacing.s1. -
py2(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies vertical padding (top and bottom) of BsSpacing.s2. -
py3(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies vertical padding (top and bottom) of BsSpacing.s3. -
py4(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies vertical padding (top and bottom) of BsSpacing.s4. -
py5(
) → Widget -
Available on Widget, provided by the BsSpacingExtension extension
Applies vertical padding (top and bottom) of BsSpacing.s5. -
size100(
) → Widget -
Available on Widget, provided by the BsSizeExtension extension
Sets both width and height to 100% (double.infinity). Maps to Bootstrap's.w-100and.h-100. -
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
-
visible(
bool visible) → Widget -
Available on Widget, provided by the BsDisplayExtension extension
Shows or hides the widget based onvisible. -
w(
double width) → Widget -
Available on Widget, provided by the BsSizeExtension extension
Sets a fixed width for the widget. -
w100(
) → Widget -
Available on Widget, provided by the BsSizeExtension extension
Sets the width to 100% (double.infinity). -
w25(
) → Widget -
Available on Widget, provided by the BsSizeExtension extension
Sets the width to 25% of parent (FractionallySizedBox). -
w50(
) → Widget -
Available on Widget, provided by the BsSizeExtension extension
Sets the width to 50% of parent (FractionallySizedBox). -
w75(
) → Widget -
Available on Widget, provided by the BsSizeExtension extension
Sets the width to 75% of parent (FractionallySizedBox).
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited