EmojiGifTextField constructor

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. ToolbarOptions? toolbarOptions,
  13. bool autofocus = false,
  14. String obscuringCharacter = '•',
  15. bool obscureText = false,
  16. bool autocorrect = true,
  17. SmartDashesType? smartDashesType,
  18. SmartQuotesType? smartQuotesType,
  19. bool enableSuggestions = true,
  20. int? maxLines = 1,
  21. int? minLines,
  22. bool expands = false,
  23. int? maxLength,
  24. MaxLengthEnforcement? maxLengthEnforcement,
  25. ValueChanged<String>? onChanged,
  26. VoidCallback? onEditingComplete,
  27. ValueChanged<String>? onSubmitted,
  28. AppPrivateCommandCallback? onAppPrivateCommand,
  29. List<TextInputFormatter>? inputFormatters,
  30. bool? enabled,
  31. double cursorWidth = 2.0,
  32. double? cursorHeight,
  33. Radius? cursorRadius,
  34. Color? cursorColor,
  35. BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight,
  36. BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight,
  37. Brightness? keyboardAppearance,
  38. EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
  39. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  40. bool? enableInteractiveSelection,
  41. TextSelectionControls? selectionControls,
  42. GestureTapCallback? onTap,
  43. MouseCursor? mouseCursor,
  44. InputCounterWidgetBuilder? buildCounter,
  45. ScrollController? scrollController,
  46. ScrollPhysics? scrollPhysics,
  47. Iterable<String>? autofillHints = const <String>[],
  48. Clip clipBehavior = Clip.hardEdge,
  49. String? restorationId,
  50. bool scribbleEnabled = true,
  51. bool enableIMEPersonalizedLearning = true,
})

Implementation

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.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(textAlign != null),
      assert(autofocus != null),
      assert(obscuringCharacter != null && obscuringCharacter.length == 1),
      assert(obscureText != null),
      assert(autocorrect != null),
      smartDashesType = smartDashesType ??
          (obscureText ? SmartDashesType.disabled : SmartDashesType.enabled),
      smartQuotesType = smartQuotesType ??
          (obscureText ? SmartQuotesType.disabled : SmartQuotesType.enabled),
      assert(enableSuggestions != null),
      assert(scrollPadding != null),
      assert(dragStartBehavior != null),
      assert(selectionHeightStyle != null),
      assert(selectionWidthStyle != null),
      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 != null),
      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.',
      ),
      assert(clipBehavior != null),
      assert(enableIMEPersonalizedLearning != null),
      keyboardType = keyboardType ??
          (maxLines == 1 ? TextInputType.text : TextInputType.multiline);