This is a POSTS APP example implementing asynchronous API calls from JSONPlaceholder.
To run the app, you just have to clone the project, set up your IOS or Android emulator and run.
This is a small app and we use the cubit pattern to separate the ui, bussiness logic and data layers as shown in the image.
The UI send functions to the cubit, then the cubit goes to the repository and ask for data, the repository implementation goes to the datasource (API Server for this example) and ask for the especific JSON data to convert it then into a Object. This data fetched is then passed back to the cubit to be processed and this cubits emit states to the UI to display the proper information to the user.
This is a feature driven design, so if you want to implement an autentication feature, you can work on it without touching the other folders.
I used some third-party libraries like flutter_bloc for sure to implement the cubits, http for networking, and shimmer wich i like to have nice UX while loading data.
Hive is a third-party library that allows us to have local persistency data with hi eficiency compared to other ways as shown in the next graph.
- ✅ Load the posts from the JSON API and populate the sidebar.
- ✅ Each Cell/Row height should fit according to the size of the content.
- ✅ The first 20 posts should have a blue dot indicator.
- ✅ Remove the blue dot indicator once the related post is read.
- ✅ Once a post is touched, its related content is shown in the main content area.
- ✅ The related content also displays user information.
- ✅ Add a button in the navigation. It adds the current post to favorites.
- ✅ Each cell should have the functionality to swipe and delete the post.
- ✅ Add a button to the footer that removes all posts.
- ✅ Add a button to navigation that reloads all posts.
- ✅ Add a segmented control to filter posts (All / Favorites)
- ✅ Favorite posts should have a star indicator.
- ✅ Cache all posts to handle persistency.
- ✅ Show a list of comments related to each post.
- Add unit testing as you consider it.