You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Future<List<Account>> search(String search) async {
// replace space by "+" plus sign
final query = search.replaceAll(new RegExp(r"\s\b|\b\s"), "+");
// fetch your data using your http call pass the query to the method
final listAccount = await http.fetchAccount(query);
// then return your search result
return listAccount;
}
m getting this error when I use spaces in search
it works fine for single word
E/flutter (13594): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: type '_Exception' is not a subtype of type 'Error' E/flutter (13594): #0 SearchBarController._search (package:flappy_search_bar/flappy_search_bar.dart:55:36) E/flutter (13594): <asynchronous suspension> E/flutter (13594): #1 _SearchBarState._onTextChanged.<anonymous closure> (package:flappy_search_bar/flappy_search_bar.dart:271:29) E/flutter (13594): #2 _rootRun (dart:async/zone.dart:1122:38) E/flutter (13594): #3 _CustomZone.run (dart:async/zone.dart:1023:19) E/flutter (13594): #4 _CustomZone.runGuarded (dart:async/zone.dart:925:7) E/flutter (13594): #5 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23) E/flutter (13594): #6 _rootRun (dart:async/zone.dart:1126:13) E/flutter (13594): #7 _CustomZone.run (dart:async/zone.dart:1023:19) E/flutter (13594): #8 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:949:23) E/flutter (13594): #9 Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:23:15) E/flutter (13594): #10 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:384:19) E/flutter (13594): #11 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:418:5) E/flutter (13594): #12 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12) E/flutter (13594):
can you please help me fix it?
The text was updated successfully, but these errors were encountered: