Closed Sabatin closed 3 years ago
Yes, the package will soon be migrated provided all dependencies have been migrated.
The project has now been migrated to null safety from v0.3.0+
Wow super fast! Ty so much! But i don't see the featured media... There is a way to provide the image of the post?
As of now, you can only retrieve the image ID, then call the api.getMedia(id: ID)
endpoint. The Media
response contains the sourceUrl
. Embedded data will be included in the stable v1
Ty so much, this is helpful. But i think that there is an error in
factory Media.fromMap(Map<String, dynamic> map) {
return Media(
date: map['date'],
dateGmt: map['date_gmt'],
guid: map['guid']['rendered'],
id: map['id'],
link: map['link'],
modified: map['modified'],
modifiedGmt: map['modified_gmt'],
slug: map['slug'],
status: map['status'],
type: map['type'],
permalinkTemplate: map['permalink_template'],
generatedSlug: map['generated_slug'],
title: Utils.renderHtml(map['title']['rendered']),
author: map['author'],
commentStatus: map['comment_status'],
pingStatus: map['ping_status'],
meta: map['meta'],
template: map['template'],
altText: map['altText'],
caption: map['caption'],
description: map['description'],
mediaType: map['media_type'],
mimeType: map['mime_type'],
mediaDetails: Map<String, dynamic>.from(map['media_details']),
post: map['post'],
sourceUrl: map['source_url'],
);
}
[ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'String?'
The terminal error point me on the line caption: map['caption'],
Thank you for reporting this. I Will have this fixed in the next minor update.
I really love this package. Will this package ever be migrated to flutter null safety?