Flutter Posts App: Fetch, Store & Display
The goal of this task is to create a Flutter application that fetches posts from a public API, stores them locally using SQLite, and displays them in a user-friendly list format.
- API Integration: Fetch data from the JSONPlaceholder API.
- Local Storage: Save the fetched posts in an SQLite database using the sqflite package.
- State Management: Use flutter_riverpod for managing state and riverpod_annotation for structured MVVM architecture.
- User Interface: Display posts in a ListView, ensuring that: • Each item shows the title and body of the post. • Proper handling of null or empty values for id, title, and body. • The UI is clean and responsive.
- Error Handling: Handle API failures, database errors, and empty data cases gracefully.
- Flutter: For building the UI.
- flutter_riverpod & riverpod_annotation: For state management in MVVM architecture.
- http: For making API requests.
- sqflite: For local database storage.
- fpdart: For functional error handling and better state flow.