getCustomAppBarWithSearch method
dynamic
getCustomAppBarWithSearch(
- BuildContext context, {
- required String appBarTitle,
- required Function onBackButtonPress,
- required dynamic onSearchValueChanged(),
- TextEditingController? controller,
- String? hintText,
- Color? backgroundColor,
- double? elevation,
- bool? centerTitle,
- List<
Widget> ? actions, - Widget? icon,
- Widget? titleWidget,
- bool? isIconVisible,
Implementation
getCustomAppBarWithSearch(BuildContext context,
{required String appBarTitle,
required Function onBackButtonPress,
required Function(String) onSearchValueChanged,
TextEditingController? controller,
String? hintText,
Color? backgroundColor,
double? elevation,
bool? centerTitle,
List<Widget>? actions,
Widget? icon,
Widget? titleWidget,
bool? isIconVisible}) {
return CustomPrefferedSizedWidget(
height: 120,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
AppBar(
iconTheme: IconThemeData(
color: AppColors.appColorBlack85, //change your color here
),
title: titleWidget ??
Text(
appBarTitle,
style: TextStyleElements.headline6
.copyWith(fontWeight: FontWeight.w600),
),
backgroundColor: backgroundColor ??= AppColors.appColorTransparent,
elevation: elevation ??= 0.0,
leading: Visibility(
visible: isIconVisible ??= true,
child: IconButton(
icon: icon ??= const Icon(
Icons.keyboard_backspace_rounded,
// add custom icons also
),
onPressed: onBackButtonPress as void Function()?,
)),
actions: actions,
centerTitle: centerTitle ??= true,
),
SearchBox(
controller: controller,
onvalueChanged: onSearchValueChanged,
hintText: hintText ??= "Search",
)
],
),
);
}