CupertinoSearchBarData constructor
CupertinoSearchBarData({
- Key? widgetKey,
- TextEditingController? controller,
- FocusNode? focusNode,
- void onTap()?,
- ValueChanged<
String> ? onChanged, - ValueChanged<
String> ? onSubmitted, - BoxDecoration? decoration,
- BorderRadius? borderRadius,
- TextInputType? keyboardType,
- Color itemColor = CupertinoColors.secondaryLabel,
- double itemSize = 20.0,
- EdgeInsetsGeometry prefixInsets = const EdgeInsetsDirectional.fromSTEB(6, 0, 0, 3),
- 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,
- SmartQuotesType? smartQuotesType,
- SmartDashesType? smartDashesType,
- bool enableIMEPersonalizedLearning = true,
- bool autofocus = false,
- bool autocorrect = true,
- bool? enabled,
- EdgeInsetsGeometry? padding,
- Color? backgroundColor,
- TextStyle? placeholderStyle,
- TextStyle? style,
- String? placeholder,
Implementation
CupertinoSearchBarData({
//Common
super.widgetKey,
super.controller,
super.focusNode,
super.onTap,
super.onChanged,
//Cupertino
this.onSubmitted,
this.decoration,
this.borderRadius,
this.keyboardType,
this.itemColor = CupertinoColors.secondaryLabel,
this.itemSize = 20.0,
this.prefixInsets = const EdgeInsetsDirectional.fromSTEB(6, 0, 0, 3),
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.smartQuotesType,
this.smartDashesType,
this.enableIMEPersonalizedLearning = true,
this.autofocus = false,
this.autocorrect = true,
this.enabled,
this.padding,
this.backgroundColor,
this.placeholderStyle,
this.style,
this.placeholder,
}) : 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)"',
);