filter method
Implementation
Future<List<XData>> filter([field, value]) async {
if (field == null && value == null) {
return await _getAllDocs();
} else if (fields.where((element) => element.field == field).isEmpty) {
throw Exception('Field $field not found');
}
var dataSet = await _getAllDocs();
return dataSet.where((element) => element.data[field] == value).toList();
}