Flutter News App
- Theme support (light/dark)
- Nexted Infinite Scroll for a better UX
- Seperation of concerns ie UI, Services, Controller, Model
- I/O operation
- Design System
lib
├── constants
├────── app constants
├── controllers
├────── getx controller to manage the state of the app
├── models
├────── data model of the app
├── screens
├────── screens which consume controllers and models
├── services
├────── external services
├── theme
├────── themes data
├── views
├────── common UI components
├── views
├────── common UI components
└── main.dart
Create a model using https://app.quicktype.io/
Create Services to fetch data and map with model
-
Created different controllers to manage the state of various types of data such as top, new, best
-
Feed data to infinite scroll pagination to create infinite UX experience and also support refresh
-
Created like controller to manage the state of likes as well as read/write to disk
- Created light and dark theme
- Created Text components while keeping system theme color
top, new, best api sends 500 items at a time; loading 500 stories for all 3 types means loading 1500 stories which will slow down initial loadtime
- fetch ids of each stories ie 3 api calls
- for each page, load first 20 stories
- as user scrolls, keep fetching preceeding 20 stories
- on refresh fresh everything and start with 1
$ flutter pub get
$ flutter run