EmojiGifTextField constructor

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

Creates a Material Design text field. Id is required to connect with emoji icon When you click the connected emoji icon, this textfield will be focused directly You can change the autofocus as you like

Implementation

const EmojiGifTextField({
  super.key,
  required this.id,
  this.decoration = const InputDecoration(),
  TextInputType? keyboardType,
  this.textInputAction,
  this.textCapitalization = TextCapitalization.none,
  this.style,
  this.strutStyle,
  this.textAlign = TextAlign.start,
  this.textAlignVertical,
  this.textDirection,
  //ToolbarOptions? toolbarOptions,
  this.autofocus = false,
  this.obscuringCharacter = '•',
  this.obscureText = false,
  this.autocorrect = true,
  SmartDashesType? smartDashesType,
  SmartQuotesType? smartQuotesType,
  this.enableSuggestions = true,
  this.maxLines = 1,
  this.minLines,
  this.expands = false,
  this.maxLength,
  this.maxLengthEnforcement,
  this.onChanged,
  this.onEditingComplete,
  this.onSubmitted,
  this.onAppPrivateCommand,
  this.inputFormatters,
  this.enabled,
  this.cursorWidth = 2.0,
  this.cursorHeight,
  this.cursorRadius,
  this.cursorColor,
  this.contextMenuBuilder,
  this.spellCheckConfiguration,
  this.magnifierConfiguration,
  this.onTapOutside,
  this.selectionHeightStyle = ui.BoxHeightStyle.tight,
  this.selectionWidthStyle = ui.BoxWidthStyle.tight,
  this.keyboardAppearance,
  this.scrollPadding = const EdgeInsets.all(20.0),
  this.dragStartBehavior = DragStartBehavior.start,
  bool? enableInteractiveSelection,
  this.selectionControls,
  this.onTap,
  this.mouseCursor,
  this.buildCounter,
  this.scrollController,
  this.scrollPhysics,
  this.autofillHints = const <String>[],
  this.clipBehavior = Clip.hardEdge,
  this.restorationId,
  this.scribbleEnabled = true,
  this.enableIMEPersonalizedLearning = true,
})  : assert(obscuringCharacter.length == 1),
      smartDashesType = smartDashesType ??
          (obscureText ? SmartDashesType.disabled : SmartDashesType.enabled),
      smartQuotesType = smartQuotesType ??
          (obscureText ? SmartQuotesType.disabled : SmartQuotesType.enabled),
      assert(maxLines == null || maxLines > 0),
      assert(minLines == null || minLines > 0),
      assert(
        (maxLines == null) || (minLines == null) || (maxLines >= minLines),
        "minLines can't be greater than maxLines",
      ),
      assert(
        !expands || (maxLines == null && minLines == null),
        'minLines and maxLines must be null when expands is true.',
      ),
      assert(!obscureText || maxLines == 1,
          'Obscured fields cannot be multiline.'),
      assert(maxLength == null ||
          maxLength == TextField.noMaxLength ||
          maxLength > 0),
      // Assert the following instead of setting it directly to avoid surprising the user by silently changing the value they set.
      assert(
        !identical(textInputAction, TextInputAction.newline) ||
            maxLines == 1 ||
            !identical(keyboardType, TextInputType.text),
        'Use keyboardType TextInputType.multiline when using TextInputAction.newline on a multiline TextField.',
      ),
      keyboardType = keyboardType ??
          (maxLines == 1 ? TextInputType.text : TextInputType.multiline);