SearchTextField constructor
const
SearchTextField({
- Key? key,
- TextEditingController? controller,
- ValueChanged<
String> ? onChanged, - ValueChanged<
String> ? onSubmitted, - TextStyle? style,
- String? placeholder,
- TextStyle? placeholderStyle,
- BoxDecoration? decoration,
- Color? backgroundColor,
- BorderRadius? borderRadius,
- EdgeInsetsGeometry padding = const EdgeInsetsDirectional.fromSTEB(3.8, 8, 5, 8),
- Color itemColor = CupertinoColors.secondaryLabel,
- double itemSize = 20.0,
- EdgeInsetsGeometry prefixInsets = const EdgeInsetsDirectional.fromSTEB(6, 0, 0, 4),
- Widget prefixIcon = const Icon(CupertinoIcons.search),
- EdgeInsetsGeometry suffixInsets = const EdgeInsetsDirectional.fromSTEB(0, 0, 5, 2),
- Icon suffixIcon = const Icon(CupertinoIcons.xmark_circle_fill),
- OverlayVisibilityMode suffixMode = OverlayVisibilityMode.editing,
- VoidCallback? onSuffixTap,
- String? restorationId,
- FocusNode? focusNode,
- bool autofocus = false,
- VoidCallback? onTap,
- bool autocorrect = true,
- bool? enabled,
- 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);