searchContainer method
Implementation
Container searchContainer() {
return Container(
height: 40,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12.dp),
border: Border.all(
color: ColorHelper.blueTint,
),
),
child: TextFormField(
controller: controller.searchSubscriberTextController,
cursorColor: Colors.black,
keyboardType: TextInputType.text,
onFieldSubmitted: (searchString) {
controller.currentPage.value = 1;
controller.rowsPerPage.value = 5;
controller.searchSubscriber(searchString);
},
onChanged: (searchString) {
if (searchString.isEmpty) {
controller.currentPage.value = 1;
controller.rowsPerPage.value = 5;
controller.fetchSubscribers();
}
},
style: TextStyle(
fontSize: 12.dp,
fontWeight: FontWeight.w400,
color: ColorHelper.black02,
),
decoration: InputDecoration(
contentPadding: EdgeInsets.fromLTRB(16.dp, 6.dp, 16.dp, 6.dp),
hintText: 'Search by Name or Email',
hintStyle: TextStyle(
fontSize: 10.dp,
fontWeight: FontWeight.w400,
color: ColorHelper.neutralText,
),
border: const UnderlineInputBorder(
borderSide: BorderSide.none,
),
// suffixIconConstraints: BoxConstraints(maxWidth: 25.dp),
suffixIcon: IconButton(
onPressed: () {
controller.currentPage.value = 1;
controller.rowsPerPage.value = 5;
controller.searchSubscriber(
controller.searchSubscriberTextController.text);
},
icon: Padding(
padding: const EdgeInsets.only(right: 10),
child: SvgPicture.asset(
'assets/requests/ic_search.svg',
width: 16.dp,
height: 16.dp,
),
),
),
),
),
);
}