Skip to content
Snippets Groups Projects
Commit 86e4abc7 authored by vjrj's avatar vjrj
Browse files

Search in contacts too

parent 0d5fdad7
No related branches found
No related tags found
No related merge requests found
......@@ -46,13 +46,17 @@ class _PayContactSearchPageState extends State<PayContactSearchPage> {
setState(() {
_isLoading = true;
});
final Response cPlusResponse = await searchCPlusUser(_searchTerm);
final ContactsCubit contactsCubit = context.read<ContactsCubit>();
setState(() {
_results = <Contact>[];
_results = contactsCubit.search(_searchTerm);
if (inDevelopment) {
logger('Found: ${_results.length} in contacts');
}
});
final Response cPlusResponse = await searchCPlusUser(_searchTerm);
if (cPlusResponse.statusCode != 404) {
setState(() {
// Add cplus users
......@@ -185,7 +189,7 @@ class _PayContactSearchPageState extends State<PayContactSearchPage> {
},
),
if (_isLoading)
const LoadingBox()
const LoadingBox(simple: false)
else if (_searchTerm.isNotEmpty && _results.isEmpty && _isLoading)
const NoElements(text: 'nothing_found')
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment