SearchTextField constructor

const SearchTextField({
  1. Key? key,
  2. TextEditingController? controller,
  3. ValueChanged<String>? onChanged,
  4. ValueChanged<String>? onSubmitted,
  5. TextStyle? style,
  6. String? placeholder,
  7. TextStyle? placeholderStyle,
  8. BoxDecoration? decoration,
  9. Color? backgroundColor,
  10. BorderRadius? borderRadius,
  11. EdgeInsetsGeometry padding = const EdgeInsetsDirectional.fromSTEB(3.8, 8, 5, 8),
  12. Color itemColor = CupertinoColors.secondaryLabel,
  13. double itemSize = 20.0,
  14. EdgeInsetsGeometry prefixInsets = const EdgeInsetsDirectional.fromSTEB(6, 0, 0, 4),
  15. Widget prefixIcon = const Icon(CupertinoIcons.search),
  16. EdgeInsetsGeometry suffixInsets = const EdgeInsetsDirectional.fromSTEB(0, 0, 5, 2),
  17. Icon suffixIcon = const Icon(CupertinoIcons.xmark_circle_fill),
  18. OverlayVisibilityMode suffixMode = OverlayVisibilityMode.editing,
  19. VoidCallback? onSuffixTap,
  20. String? restorationId,
  21. FocusNode? focusNode,
  22. bool autofocus = false,
  23. VoidCallback? onTap,
  24. bool autocorrect = true,
  25. bool? enabled,
  26. bool enableInteractiveSelection = true,
})

Implementation

const SearchTextField({
  Key? key,
  this.controller,
  this.onChanged,
  this.onSubmitted,
  this.style,
  this.placeholder,
  this.placeholderStyle,
  this.decoration,
  this.backgroundColor,
  this.borderRadius,
  this.padding = const EdgeInsetsDirectional.fromSTEB(3.8, 8, 5, 8),
  this.itemColor = CupertinoColors.secondaryLabel,
  this.itemSize = 20.0,
  this.prefixInsets = const EdgeInsetsDirectional.fromSTEB(6, 0, 0, 4),
  this.prefixIcon = const Icon(CupertinoIcons.search),
  this.suffixInsets = const EdgeInsetsDirectional.fromSTEB(0, 0, 5, 2),
  this.suffixIcon = const Icon(CupertinoIcons.xmark_circle_fill),
  this.suffixMode = OverlayVisibilityMode.editing,
  this.onSuffixTap,
  this.restorationId,
  this.focusNode,
  this.autofocus = false,
  this.onTap,
  this.autocorrect = true,
  this.enabled,
  this.enableInteractiveSelection = true,
})  : assert(
        !((decoration != null) && (backgroundColor != null)),
        'Cannot provide both a background color and a decoration\n'
        'To provide both, use "decoration: BoxDecoration(color: '
        'backgroundColor)"',
      ),
      assert(
        !((decoration != null) && (borderRadius != null)),
        'Cannot provide both a border radius and a decoration\n'
        'To provide both, use "decoration: BoxDecoration(borderRadius: '
        'borderRadius)"',
      ),
      super(key: key);