FieldWidgets<T> constructor

FieldWidgets<T>({
  1. Object? key,
  2. T? object,
  3. String? label,
  4. dynamic value,
  5. dynamic type,
  6. TextEditingController? controller,
  7. String? initialValue,
  8. FocusNode? focusNode,
  9. InputDecoration? inputDecoration,
  10. TextInputType? keyboardType,
  11. TextCapitalization? textCapitalization,
  12. TextInputAction? textInputAction,
  13. TextSpan? textSpan,
  14. TextStyle? style,
  15. TextAlign? textAlign,
  16. bool? autofocus,
  17. bool? obscureText,
  18. bool? autocorrect,
  19. MaxLengthEnforcement? maxLengthEnforcement,
  20. int? maxLines,
  21. int? maxLength,
  22. ValueChanged<String>? changed,
  23. VoidCallback? editingComplete,
  24. ValueChanged<String>? fieldSubmitted,
  25. FormFieldSetter<String>? saved,
  26. FormFieldValidator<String>? validator,
  27. List<TextInputFormatter>? inputFormatters,
  28. bool? enabled,
  29. Brightness? keyboardAppearance,
  30. EdgeInsets? scrollPadding,
  31. InputCounterWidgetBuilder? buildCounter,
  32. ScrollPhysics? scrollPhysics,
  33. Iterable<String>? autofillHints,
  34. AutovalidateMode? autovalidateMode,
  35. TextDirection? textDirection,
  36. Locale? locale,
  37. bool? softWrap,
  38. TextOverflow? overflow,
  39. double? textScaleFactor,
  40. String? semanticsLabel,
  41. TextWidthBasis? textWidthBasis,
  42. TextHeightBehavior? textHeightBehavior,
  43. Widget? leading,
  44. Widget? title,
  45. Widget? subtitle,
  46. Widget? trailing,
  47. bool? isThreeLine,
  48. bool? dense,
  49. VisualDensity? visualDensity,
  50. ShapeBorder? shape,
  51. Color? selectedColor,
  52. Color? iconColor,
  53. Color? textColor,
  54. EdgeInsetsGeometry? contentPadding,
  55. GestureTapCallback? tap,
  56. GestureLongPressCallback? longPress,
  57. MouseCursor? mouseCursor,
  58. bool? selected,
  59. Color? focusColor,
  60. Color? hoverColor,
  61. Color? tileColor,
  62. Color? selectedTileColor,
  63. Widget? secondary,
  64. ListTileControlAffinity? controlAffinity,
  65. Color? backgroundColor,
  66. ImageProvider<Object>? backgroundImage,
  67. ImageProvider<Object>? foregroundImage,
  68. ImageErrorListener? onBackgroundImageError,
  69. ImageErrorListener? onForegroundImageError,
  70. Color? foregroundColor,
  71. double? radius,
  72. double? minRadius,
  73. double? maxRadius,
  74. Widget? child,
  75. Widget? background,
  76. Widget? secondaryBackground,
  77. VoidCallback? resize,
  78. DismissDirectionCallback? dismissed,
  79. DismissDirection? direction,
  80. Duration? resizeDuration,
  81. Map<DismissDirection, double>? dismissThresholds,
  82. Duration? movementDuration,
  83. double? crossAxisEndOffset,
  84. ValueChanged<bool>? toggle,
  85. Color? activeColor,
  86. bool? tristate,
  87. 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;
}