categoryQuery static method
Returns Category samples for the provided type
and the time interval predicate predicate
.
Implementation
static Future<List<Category>> categoryQuery(
CategoryType type, Predicate predicate) async {
final arguments = <String, dynamic>{
'identifier': type.identifier,
};
arguments.addAll(predicate.map);
final result =
await _methodChannel.invokeMethod('categoryQuery', arguments);
final List<dynamic> list = jsonDecode(result);
final categories = <Category>[];
for (final Map<String, dynamic> map in list) {
final category = Category.fromJson(map);
categories.add(category);
}
return categories;
}