FieldWidgets<T> constructor
FieldWidgets<T> ({
- Object? key,
- T? object,
- String? label,
- dynamic value,
- dynamic type,
- TextEditingController? controller,
- String? initialValue,
- FocusNode? focusNode,
- InputDecoration? inputDecoration,
- TextInputType? keyboardType,
- TextCapitalization? textCapitalization,
- TextInputAction? textInputAction,
- TextSpan? textSpan,
- TextStyle? style,
- TextAlign? textAlign,
- bool? autofocus,
- bool? obscureText,
- bool? autocorrect,
- MaxLengthEnforcement? maxLengthEnforcement,
- int? maxLines,
- int? maxLength,
- ValueChanged<
String> ? changed, - VoidCallback? editingComplete,
- ValueChanged<
String> ? fieldSubmitted, - FormFieldSetter<
String> ? saved, - FormFieldValidator<
String> ? validator, - List<
TextInputFormatter> ? inputFormatters, - bool? enabled,
- Brightness? keyboardAppearance,
- EdgeInsets? scrollPadding,
- InputCounterWidgetBuilder? buildCounter,
- ScrollPhysics? scrollPhysics,
- Iterable<
String> ? autofillHints, - AutovalidateMode? autovalidateMode,
- TextDirection? textDirection,
- Locale? locale,
- bool? softWrap,
- TextOverflow? overflow,
- double? textScaleFactor,
- String? semanticsLabel,
- TextWidthBasis? textWidthBasis,
- TextHeightBehavior? textHeightBehavior,
- Widget? leading,
- Widget? title,
- Widget? subtitle,
- Widget? trailing,
- bool? isThreeLine,
- bool? dense,
- VisualDensity? visualDensity,
- ShapeBorder? shape,
- Color? selectedColor,
- Color? iconColor,
- Color? textColor,
- EdgeInsetsGeometry? contentPadding,
- GestureTapCallback? tap,
- GestureLongPressCallback? longPress,
- MouseCursor? mouseCursor,
- bool? selected,
- Color? focusColor,
- Color? hoverColor,
- Color? tileColor,
- Color? selectedTileColor,
- Widget? secondary,
- ListTileControlAffinity? controlAffinity,
- Color? backgroundColor,
- ImageProvider<
Object> ? backgroundImage, - ImageProvider<
Object> ? foregroundImage, - ImageErrorListener? onBackgroundImageError,
- ImageErrorListener? onForegroundImageError,
- Color? foregroundColor,
- double? radius,
- double? minRadius,
- double? maxRadius,
- Widget? child,
- Widget? background,
- Widget? secondaryBackground,
- VoidCallback? resize,
- DismissDirectionCallback? dismissed,
- DismissDirection? direction,
- Duration? resizeDuration,
- Map<
DismissDirection, double> ? dismissThresholds, - Duration? movementDuration,
- double? crossAxisEndOffset,
- ValueChanged<
bool> ? toggle, - Color? activeColor,
- bool? tristate,
- MaterialTapTargetSize? materialTapTargetSize,
Constructor supplies all the options depending on the field Widget.
Implementation
FieldWidgets({
Object? key,
this.object,
String? label,
dynamic value,
dynamic type,
// TextFormField
this.controller,
this.initialValue,
this.focusNode,
this.inputDecoration,
this.keyboardType,
this.textCapitalization,
this.textInputAction,
this.textSpan,
this.style,
this.textAlign,
this.autofocus,
this.obscureText,
this.autocorrect,
// this.autovalidate,
// this.maxLengthEnforced,
this.maxLengthEnforcement,
this.maxLines,
this.maxLength,
this.changed,
this.editingComplete,
this.fieldSubmitted,
this.saved,
this.validator,
this.inputFormatters,
this.enabled,
this.keyboardAppearance,
this.scrollPadding,
this.buildCounter,
this.scrollPhysics,
this.autofillHints,
this.autovalidateMode,
// Text
this.textDirection,
this.locale,
this.softWrap,
this.overflow,
this.textScaleFactor,
this.semanticsLabel,
this.textWidthBasis,
this.textHeightBehavior,
// ListTile
this.leading,
this.title,
this.subtitle,
this.trailing,
this.isThreeLine,
this.dense,
this.visualDensity,
this.shape,
this.selectedColor,
this.iconColor,
this.textColor,
this.contentPadding,
this.tap,
this.longPress,
this.mouseCursor,
this.selected,
this.focusColor,
this.hoverColor,
this.tileColor,
this.selectedTileColor,
// CheckboxListTile
this.secondary,
this.controlAffinity,
// CircleAvatar
this.backgroundColor,
this.backgroundImage,
this.foregroundImage,
this.onBackgroundImageError,
this.onForegroundImageError,
this.foregroundColor,
this.radius,
this.minRadius,
this.maxRadius,
// Dismissible
this.child,
this.background,
this.secondaryBackground,
this.resize,
this.dismissed,
this.direction,
this.resizeDuration,
this.dismissThresholds,
this.movementDuration,
this.crossAxisEndOffset,
// CheckBox
this.toggle,
this.activeColor,
this.tristate,
this.materialTapTargetSize,
}) : super(label: label, value: value, type: type) {
_key = ObjectKey(key ?? this).toString();
// ignore: avoid_bool_literals_in_conditional_expressions
_checkValue = value == null
? false
: value is String
? value.isNotEmpty
: value is bool
? value
// ignore: avoid_bool_literals_in_conditional_expressions
: value is int
// ignore: avoid_bool_literals_in_conditional_expressions
? value > 0
? true
// ignore: avoid_bool_literals_in_conditional_expressions
: value is double
? value > 0
: false
: false;
// Record the initial value.
if (value is! Iterable) {
_initValue = value ?? initialValue;
}
// Default values
textCapitalization ??= TextCapitalization.none;
textInputAction ??= TextInputAction.done;
textAlign ??= TextAlign.start;
autofocus ??= false;
obscureText ??= false;
autocorrect ??= true;
// autovalidate ??= false;
// maxLengthEnforced ??= true;
maxLengthEnforcement ??= MaxLengthEnforcement.enforced;
maxLines ??= 1;
scrollPadding ??= const EdgeInsets.all(20);
isThreeLine ??= false;
enabled ??= true;
selected ??= false;
direction ??= DismissDirection.endToStart;
resizeDuration ??= const Duration(milliseconds: 300);
dismissThresholds ??= const <DismissDirection, double>{};
movementDuration ??= const Duration(milliseconds: 200);
crossAxisEndOffset ??= 0.0;
}