In this article I’m gonna continue the tutorial of reading the WP JSON API to how you how to read the WordPress Posts and display them in Flutter Web Application. The Information is located on the URL:
https://<wp>/wp-json/wp/v2/posts. It has the following JSON Data Model:
The important fields of this complex WordPress Posts array/object – Data Model Object are:
- id – the ID/Identifier/ of the Article
- “title” Object containing “rendered” String – that is the title [plain text] of the Article
- “slug” – the URL friendly version of the title
- “content” Object containing “rendered” String – that is the HTML of the Article
- date/date_gmt – the date of creation
- modified/modified_gmt – the date of last modification
- link – the URL of the Article
- author – the ID of the Author
- “categories” – Array of Integers that are the IDs of the WordPress Categories
- “tags” – Array Of Integers that are the IDs of the WordPress Tags
- excerpt Object containing a rendered String – a short introduction of the blog post
- comment_status: String – are comments on the article allowed.
- featured_media – the WordPress Media/most probably Image/ that is displayed as logo/picture/ of the blog post.
- status – the status of the post – draft, published, private or protected with password.
These are the Data Models of a Post/Article. But, they do not stop you to package whatever your imagination can create. The User Interface Labels around the Data Models may different. If User Profile creation is open for – content and product creators – the possible ideas to wrap up are endless. Yes, WordPress (& PHP) may not be the best, fastest in execution nor the most scalable, but it will be fast to bootstrap. Here you have a Flutter Web App Demonstration that loads the articles: https://programtom.com/dev_examples/wp_posts/. Code loading the full WordPress Data may be demonstrated in the future, but it will require the unification of all JSON APIs and Services. Enough for today.