getApiSearchData method
Future<ResponseModel?>
getApiSearchData({
- required IAuthHelper authHelper,
- required DropDownApiConfig dropDownConfig,
- required int pageNumber,
- bool isPagination = true,
- String? searchString,
Implementation
Future<ResponseModel?> getApiSearchData(
{required IAuthHelper authHelper,
required DropDownApiConfig dropDownConfig,
required int pageNumber,
bool isPagination = true,
String? searchString}) async {
ResponseModel? responseModel;
try {
Response? response = await ApiHelper().getMethodPagination(
authHelper: authHelper,
dropDownConfig: dropDownConfig,
pageNumber: pageNumber,
isPagination: isPagination,
searchString: searchString);
if (response != null &&
(response.statusCode == 200 || response.statusCode == 201)) {
responseModel = ResponseModel.fromJson(json.decode(response.body),
idFindKey: dropDownConfig.getIdKey(),
valueFindKey: dropDownConfig.getValueKey());
return responseModel;
}
} catch (e) {
return null;
}
return null;
}