typedItems<T> method
Get items from API with strong typings.
ItemsConverter must be provided that will convert data to
and from json. If you don't care about types, use items,
that will return Map. converter
is a simple interface that converts value to
and from JSON so it can be consumed with this API.
Implementation
ItemsHandler<T> typedItems<T>(String collection,
{required ItemsConverter<T> converter}) {
if (collection.startsWith('directus')) {
throw DirectusError(
message: "You can't read $collection collection directly.");
}
return ItemsHandler<T>(collection, client: client, converter: converter);
}