SmartField class
A static factory class for creating various SmartForm fields with a clean API.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
checkbox(
{required String name, required String label, IconData? onIcon, IconData? offIcon, SmartStyle? style, ValueChanged< bool> ? onChanged}) → Widget - Creates a checkbox field.
-
choice<
T extends Object> ({required String name, required List< ChoiceOption< options, String? label, ChoiceLayout layout = ChoiceLayout.row, SmartStyle? style, ValueChanged<T> >T?> ? onChanged}) → Widget - Creates a field for selecting from a predefined list of options.
-
custom(
{required String name, required Widget builder(BuildContext context, SmartFormController controller)}) → Widget - Creates a completely custom field with direct access to SmartFormController.
-
email(
{required String name, String? label, String? hint, double? height, double? width, FieldDecoration? decoration, SmartStyle? style, bool useFormField = true, ValueChanged< String> ? onChanged}) → Widget - Creates an email input field with appropriate keyboard type.
-
multiline(
{required String name, String? label, String? hint, int minLines = 3, int maxLines = 5, double? height, double? width, FieldDecoration? decoration, SmartStyle? style, bool useFormField = true, ValueChanged< String> ? onChanged}) → Widget - Creates a multi-line text input field.
-
number(
{required String name, String? label, String? hint, double? height, double? width, FieldDecoration? decoration, SmartStyle? style, bool useFormField = true, bool enabled = true, ValueChanged< String> ? onChanged, List<TextInputFormatter> ? inputFormatters}) → Widget - Creates a numeric input field with decimal support.
-
password(
{required String name, String? label, String? hint, double? height, double? width, FieldDecoration? decoration, SmartStyle? style, bool useFormField = true, bool autofocus = false, bool enabled = true, TextAlign textAlign = TextAlign.start, TextStyle? textStyle, TextInputAction? textInputAction, ValueChanged< String> ? onChanged, ValueChanged<String> ? onSubmitted, FocusNode? focusNode}) → Widget -
Creates a password input field with
obscureTextset totrue. -
radio(
{required String name, required String label, IconData? onIcon, IconData? offIcon, SmartStyle? style, ValueChanged< bool> ? onChanged}) → Widget - Creates a radio button toggle field.
-
searchableDropdown<
T extends Object> ({required String name, required Future< List< search(String query), required Widget itemBuilder(BuildContext, T, bool), String? label, Duration debounce = const Duration(milliseconds: 300), SmartStyle? style, FieldDecoration? decoration, double? height, double? width, String itemLabel(T)?, ValueChanged<T> >T?> ? onChanged}) → Widget - Creates a searchable dropdown with asynchronous data fetching.
-
text(
{required String name, String? label, String? hint, int? maxLines = 1, int? minLines, double? height, double? width, FieldDecoration? decoration, SmartStyle? style, bool useFormField = true, bool autofocus = false, bool readOnly = false, bool enabled = true, List< TextInputFormatter> ? inputFormatters, TextAlign textAlign = TextAlign.start, TextStyle? textStyle, TextInputAction? textInputAction, ValueChanged<String> ? onChanged, ValueChanged<String> ? onSubmitted, VoidCallback? onEditingComplete, FocusNode? focusNode, TextEditingController? controller}) → Widget - Creates a basic text input field.
-
toggle(
{required String name, required String label, IconData? onIcon, IconData? offIcon, SmartStyle? style, ValueChanged< bool> ? onChanged}) → Widget - Creates a platform-adaptive toggle/switch field.