inputDecorationForSearch function
Implementation
InputDecoration inputDecorationForSearch(BuildContext context, {Widget? label, Widget? suffix, Widget? prefix, String? hint, IconData? prefixIcon, double? fontSize, Color? selectedBorderColor}) {
return InputDecoration(
hintText: hint,
prefix: prefix,
suffix: suffix,
constraints: BoxConstraints(maxHeight: 40, minHeight: 30),
contentPadding: EdgeInsets.zero,
label: label,
filled: true,
fillColor: Colors.grey.shade200,
hintStyle: TextStyle(fontSize: fontSize, color: Colors.grey),
prefixIcon: prefixIcon != null ? Icon(prefixIcon, color: Colors.grey) : null,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.transparent),
borderRadius: BorderRadius.circular(commonRadius),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.transparent),
borderRadius: BorderRadius.circular(commonRadius),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: selectedBorderColor ?? Theme.of(context).primaryColor), // Use selectedBorderColor if provided, otherwise default to primaryColor
borderRadius: BorderRadius.circular(commonRadius),
),
);
}