searchBank method
Future<List<NetbankingOptionsChoice> >
searchBank(
- List<
NetbankingOptionsChoice> ? banks, - String? query
Implementation
Future<List<NetbankingOptionsChoice>> searchBank(
List<NetbankingOptionsChoice>? banks, String? query) async {
List<NetbankingOptionsChoice> choices = {} as List<NetbankingOptionsChoice>;
if (query != null && query.isNotEmpty) {
for (int i = 0; i < banks!.length; i++) {
if (banks[i].name!.toLowerCase().contains(query.toLowerCase())) {
choices.add(banks[i]);
}
}
} else {
choices = banks!;
}
return choices;
}