Field.checkbox constructor

Field.checkbox(
  1. String key, {
  2. String? label,
  3. dynamic value,
  4. FormValidator? validate,
  5. bool autofocus = false,
  6. String? dummyData,
  7. Widget? header,
  8. Widget? footer,
  9. TextStyle? titleStyle,
  10. dynamic style,
  11. Map<String, NyTextField Function(NyTextField nyTextField)>? metaData = const {},
  12. bool? hidden = false,
  13. bool? readOnly,
  14. MouseCursor? mouseCursor,
  15. Color? activeColor,
  16. Color? fillColor,
  17. Color? checkColor,
  18. Color? hoverColor,
  19. Color? overlayColor,
  20. double? splashRadius,
  21. MaterialTapTargetSize? materialTapTargetSize,
  22. VisualDensity? visualDensity,
  23. FocusNode? focusNode,
  24. ShapeBorder? shape,
  25. BorderSide? side,
  26. bool isError = false,
  27. bool? enabled,
  28. Color? tileColor,
  29. Widget? title,
  30. Widget? subtitle,
  31. bool isThreeLine = false,
  32. bool? dense,
  33. Widget? secondary,
  34. bool selected = false,
  35. ListTileControlAffinity controlAffinity = ListTileControlAffinity.platform,
  36. EdgeInsetsGeometry? contentPadding,
  37. bool tristate = false,
  38. ShapeBorder? checkboxShape,
  39. Color? selectedTileColor,
  40. ValueChanged<bool?>? onFocusChange,
  41. bool? enableFeedback,
  42. String? checkboxSemanticLabel,
})

Field.checkbox is a constructor that helps in managing textArea fields

Implementation

Field.checkbox(
  this.key, {
  this.label,
  this.value,
  this.validate,
  this.autofocus = false,
  this.dummyData,
  this.header,
  this.footer,
  this.titleStyle,
  this.style,
  this.metaData = const {},
  this.hidden = false,
  this.readOnly,
  MouseCursor? mouseCursor,
  Color? activeColor,
  Color? fillColor,
  Color? checkColor,
  Color? hoverColor,
  Color? overlayColor,
  double? splashRadius,
  MaterialTapTargetSize? materialTapTargetSize,
  VisualDensity? visualDensity,
  FocusNode? focusNode,
  ShapeBorder? shape,
  BorderSide? side,
  bool isError = false,
  bool? enabled,
  Color? tileColor,
  Widget? title,
  Widget? subtitle,
  bool isThreeLine = false,
  bool? dense,
  Widget? secondary,
  bool selected = false,
  ListTileControlAffinity controlAffinity = ListTileControlAffinity.platform,
  EdgeInsetsGeometry? contentPadding,
  bool tristate = false,
  ShapeBorder? checkboxShape,
  Color? selectedTileColor,
  ValueChanged<bool?>? onFocusChange,
  bool? enableFeedback,
  String? checkboxSemanticLabel,
}) : cast = FormCast.checkbox(
          mouseCursor: mouseCursor,
          activeColor: activeColor,
          fillColor: fillColor,
          checkColor: checkColor,
          hoverColor: hoverColor,
          overlayColor: overlayColor,
          splashRadius: splashRadius,
          materialTapTargetSize: materialTapTargetSize,
          visualDensity: visualDensity,
          focusNode: focusNode,
          autofocus: autofocus,
          shape: shape,
          side: side,
          isError: isError,
          enabled: enabled,
          tileColor: tileColor,
          title: title,
          subtitle: subtitle,
          isThreeLine: isThreeLine,
          dense: dense,
          secondary: secondary,
          selected: selected,
          controlAffinity: controlAffinity,
          contentPadding: contentPadding,
          tristate: tristate,
          checkboxShape: checkboxShape,
          selectedTileColor: selectedTileColor,
          onFocusChange: onFocusChange,
          enableFeedback: enableFeedback,
          checkboxSemanticLabel: checkboxSemanticLabel) {
  if (style == null) return;

  metaData = {};
  if (style is String) {
    style = style;
    return;
  }
  if (style is Map) {
    style as Map<String, dynamic>;
    metaData!["decoration_style"] =
        (style as Map<String, dynamic>).entries.first.value;
    style = (style as Map<String, dynamic>).entries.first.key;
  }
}