getResources method
Implementation
Future<Result> getResources(ResourceType type,
{String? departmentId,
String? parentCategoryId,
String? searchKey,
int page = 1,
int limit = 99}) async {
int rawValue = type.index;
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent("type", () => rawValue);
if (departmentId != null) {
args.putIfAbsent("departmentId", () => departmentId);
}
if (parentCategoryId != null) {
args.putIfAbsent("parentCategoryId", () => parentCategoryId);
}
if (searchKey != null) {
args.putIfAbsent("searchKey", () => searchKey);
}
args.putIfAbsent("page", () => page);
args.putIfAbsent("limit", () => limit);
return _getResourceResult(
await _channel.invokeMethod('getResources', args));
}