DetectableTextField constructor

DetectableTextField({
  1. Key? key,
  2. RegExp? regExp,
  3. DetectableTextEditingController? controller,
  4. TextStyle? detectedStyle,
  5. FocusNode? focusNode,
  6. UndoHistoryController? undoController,
  7. InputDecoration? decoration = const InputDecoration(),
  8. TextInputType? keyboardType,
  9. TextInputAction? textInputAction,
  10. TextCapitalization textCapitalization = TextCapitalization.none,
  11. TextStyle? style,
  12. StrutStyle? strutStyle,
  13. TextAlign textAlign = TextAlign.start,
  14. TextAlignVertical? textAlignVertical,
  15. TextDirection? textDirection,
  16. bool readOnly = false,
  17. bool? showCursor,
  18. bool autofocus = false,
  19. String obscuringCharacter = '•',
  20. bool obscureText = false,
  21. bool autocorrect = true,
  22. SmartDashesType? smartDashesType,
  23. SmartQuotesType? smartQuotesType,
  24. bool enableSuggestions = true,
  25. int? maxLines = 1,
  26. int? minLines,
  27. bool expands = false,
  28. int? maxLength,
  29. MaxLengthEnforcement? maxLengthEnforcement,
  30. ValueChanged<String>? onChanged,
  31. VoidCallback? onEditingComplete,
  32. ValueChanged<String>? onSubmitted,
  33. AppPrivateCommandCallback? onAppPrivateCommand,
  34. List<TextInputFormatter>? inputFormatters,
  35. bool? enabled,
  36. double cursorWidth = 2.0,
  37. double? cursorHeight,
  38. Radius? cursorRadius,
  39. bool? cursorOpacityAnimates,
  40. Color? cursorColor,
  41. BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight,
  42. BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight,
  43. Brightness? keyboardAppearance,
  44. EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
  45. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  46. bool? enableInteractiveSelection,
  47. TextSelectionControls? selectionControls,
  48. GestureTapCallback? onTap,
  49. TapRegionCallback? onTapOutside,
  50. MouseCursor? mouseCursor,
  51. InputCounterWidgetBuilder? buildCounter,
  52. ScrollController? scrollController,
  53. ScrollPhysics? scrollPhysics,
  54. Iterable<String>? autofillHints = const <String>[],
  55. ContentInsertionConfiguration? contentInsertionConfiguration,
  56. Clip clipBehavior = Clip.hardEdge,
  57. String? restorationId,
  58. bool scribbleEnabled = true,
  59. bool enableIMEPersonalizedLearning = true,
  60. EditableTextContextMenuBuilder? contextMenuBuilder = _defaultContextMenuBuilder,
  61. bool canRequestFocus = true,
  62. SpellCheckConfiguration? spellCheckConfiguration,
  63. TextMagnifierConfiguration? magnifierConfiguration,
})

Implementation

DetectableTextField({
  super.key,
  RegExp? regExp,
  DetectableTextEditingController? controller,
  TextStyle? detectedStyle,
  super.focusNode,
  super.undoController,
  super.decoration,
  super.keyboardType,
  super.textInputAction,
  super.textCapitalization,
  super.style,
  super.strutStyle,
  super.textAlign,
  super.textAlignVertical,
  super.textDirection,
  super.readOnly,
  super.showCursor,
  super.autofocus,
  super.obscuringCharacter,
  super.obscureText,
  super.autocorrect,
  super.smartDashesType,
  super.smartQuotesType,
  super.enableSuggestions,
  super.maxLines,
  super.minLines,
  super.expands,
  super.maxLength,
  super.maxLengthEnforcement,
  super.onChanged,
  super.onEditingComplete,
  super.onSubmitted,
  super.onAppPrivateCommand,
  super.inputFormatters,
  super.enabled,
  super.cursorWidth,
  super.cursorHeight,
  super.cursorRadius,
  super.cursorOpacityAnimates,
  super.cursorColor,
  super.selectionHeightStyle,
  super.selectionWidthStyle,
  super.keyboardAppearance,
  super.scrollPadding,
  super.dragStartBehavior,
  super.enableInteractiveSelection,
  super.selectionControls,
  super.onTap,
  super.onTapOutside,
  super.mouseCursor,
  super.buildCounter,
  super.scrollController,
  super.scrollPhysics,
  super.autofillHints,
  super.contentInsertionConfiguration,
  super.clipBehavior,
  super.restorationId,
  super.scribbleEnabled,
  super.enableIMEPersonalizedLearning,
  super.contextMenuBuilder,
  super.canRequestFocus,
  super.spellCheckConfiguration,
  super.magnifierConfiguration,
})  : assert(
        !(regExp != null && controller != null),
        'Cannot provide both a regExp and a controller. Use a controller to define regExp.\n Example: DetectableTextEditingController(regExp: yourRexExp)',
      ),
      assert(
        !(detectedStyle != null && controller != null),
        'Cannot provide both a detectedStyle and a controller. Use a controller to define detectedStyle.\n Example: DetectableTextEditingController(detectedStyle : yourDetectedStyle)',
      ),
      super(
        controller: controller ??
            DetectableTextEditingController(
              regExp: regExp ?? detectionRegExp(),
              detectedStyle: detectedStyle,
            ),
      );