stefanhk31 / personal_blog_flutter

https://stefanhodgeskluck.com
2 stars 0 forks source link

ButterCMS Client #1

Closed stefanhk31 closed 9 months ago

stefanhk31 commented 9 months ago

https://buttercms.com/blog/flutter-blog-app-tutorial/

ButterCMS client should make calls to get blogs and deserialize. Everything else should be handed to blog repository.

stefanhk31 commented 9 months ago

Use local (added to .gitignore) secret file before #4 is completed.

stefanhk31 commented 9 months ago

Need to experiment with what the json response is for v2/posts api endpoint.

stefanhk31 commented 9 months ago

Sample response here.

{
  "meta": {
    "count": 1,
    "next_page": null,
    "previous_page": null
  },
  "data": [
    {
      "url": "http://www.example.com/blog/this-is-a-blog-post",
      "created": "2020-10-08T18:29:19.987936Z",
      "updated": "2020-10-09T15:49:54.580309Z",
      "published": "2020-10-08T18:08:00Z",
      "author": {
        "first_name": "API",
        "last_name": "Test",
        "email": "apitest@buttercms.com",
        "slug": "api-test",
        "bio": "This is my bio.",
        "title": "API",
        "linkedin_url": "https://www.linkedin.com/in/API",
        "facebook_url": "https://www.facebook.com/API",
        "twitter_handle": "buttercmsapi",
        "profile_image": "https://buttercms.com/api.png"
      },
      "categories": [
        {
          "name": "test category",
          "slug": "test-category"
        }
      ],
      "tags": [
        {
          "name": "test tag",
          "slug": "test-tag"
        }
      ],
      "featured_image": null,
      "featured_image_alt": "",
      "slug": "this-is-a-blog-post",
      "title": "This is a blog post",
      "body": "<p class=\"\">This is a blog post to test the API.</p>",
      "summary": "This is a blog post to test the API.",
      "seo_title": "This is a blog post",
      "meta_description": "This is a blog post to test the API.",
      "status": "published"
    }
  ]
}

Will need to update the models accordingly.