-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add search by space name method * feat: add search space screen --------- Co-authored-by: Gbogboade Ayomide <ay4allcrown@gmail.com> Co-authored-by: Madhur Gupta <madhur@push.org>
- Loading branch information
1 parent
a8bc43f
commit 234a17c
Showing
8 changed files
with
128 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
example/demo_app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import 'package:push_restapi_dart/push_restapi_dart.dart'; | ||
|
||
Future<List<SpaceDTO>> searchSpaces({ | ||
required String searchTerm, | ||
int pageNumber = 1, | ||
int pageSize = 20, | ||
}) async { | ||
try { | ||
final body = { | ||
'searchTerm': searchTerm, | ||
'pageNumber': pageNumber, | ||
'pageSize': pageSize, | ||
}; | ||
|
||
final result = await http.post(path: '/v1/spaces/search', data: body); | ||
|
||
if (result == null || result is String) { | ||
throw Exception(result ?? 'Cannot find spaces that match $searchTerm'); | ||
} | ||
|
||
return (result as List).map((e) => SpaceDTO.fromJson(e)).toList(); | ||
} catch (e) { | ||
log('[Push SDK] - API - Error - API searchSpaces -: $e'); | ||
rethrow; | ||
} | ||
} |