Я пытаюсь получить список записей на основе category_type, но получаю следующее исключение:
I/flutter ( 8486): Cannot get list of entries. Finished with error: {
I/flutter ( 8486): "sys": {
I/flutter ( 8486): "type": "Error",
I/flutter ( 8486): "id": "NotFound"
I/flutter ( 8486): },
I/flutter ( 8486): "message": "The resource could not be found.",
I/flutter ( 8486): "requestId": "883045ce-dcc2-4187-ab1d-28c57ad18756"
I/flutter ( 8486): }
I/flutter ( 8486): null
Это вызывающий код:
Future<List<Category>> getCategories() async {
try {
final entries = await _contentfulClient.getEntries<Category>(
params: {
'content_type': 'category',
'skip': '0',
'limit': '100',
'order': 'sys.createdAt',
},
);
return entries.items.asList();
} catch(exception){
print(exception.message);
}
}
Content_type имя правильное, и в написании нет ошибки.
Я пробовал другой код, чтобы получить информацию о пространстве, к которому я пытаюсь получить доступ, и он отлично работает:
Future<Space> getCurrentSpaceDetails() async {
try {
return await _contentfulClient.getSpaceDetails(
spaceid: Secrets.CONTENTFUL_SPACE_ID);
} on ContentfulError catch (error) {
throw ContentfulError(message: error.message);
}
}
с выводом:
I/flutter ( 8486): Space {
I/flutter ( 8486): sys=SystemFields {
I/flutter ( 8486): id=5k4zwxslsof9,
I/flutter ( 8486): type=Space,
I/flutter ( 8486): },
I/flutter ( 8486): locales=[Locale {
I/flutter ( 8486): code=en-US,
I/flutter ( 8486): name=English (United States),
I/flutter ( 8486): isDefault=true,
I/flutter ( 8486): }],
I/flutter ( 8486): name=afro-quiz,
I/flutter ( 8486): }
Так что я не думаю, что это имеет какое-либо отношение к установке.
Я использую contentful_dart 0.0.5
зависимость