Test application to display flutter capacities
- Clone the repository
- Run
flutter pub getto install dependencies - Create a
dotenvfile on the root of the project withOPEN_WEATHER_APP_KEYkey and your open weather app key - Run
flutter run -d <desired_device>
The project follows a Domain based architecture, a less rigid form of Clean Architecture. On the domain, sets of features may share same widgets, repositories and logic to acomplish the desired tasks.
-
Core domain
- data
- TokenRepository
- logic
- SessionCubit
- presentation
- SplashScreen
- common widgets
- data
-
Auth domain
- data
- AuthProvider
- logic
- LoginCubic
- presentation
- LoginPage
- data
-
Weather domain
- data
- Interfaces
- WeatherProvider
- Models
- Weather
- Providers
- GeoLocalizationProvider
- OpenWeatherProvider
- Interfaces
- logic
- CurrentWeatherCubit
- presentation
- CurrentWeather
- data
This organization also aims to protect core models from change and make the view dependent on models and logic in a way that make the view reflect the desired business rules of the project.
- Common: should contain code to perform core actions and provide support to other domains
- Auth: shuold contain all auth related code, including operations such as login, signup, change of password, etc
- Weather: should contain all code related to weather actions, such as displaying current weather and forecasts
Presentation widgets are grouped by views, except for the core domain. Views might have minor widgets stored in widget folders. This helps improve maintainance, code readability and testing.
Whenever view or common widgets get bigger, consider spliting into smaller parts within widgets folder.
Data folder contains models and repositories that will dictate the domain main data types and how the application interacts with the source of data. So far, due to the simplicity of data, no repositories were used on Auth and Weather domains.
The logic folder contains the BLoC files to handle the logic and state of the application. Cubits were chosen to better define the desired states and the transition between them while keeping simplicity in comparison with BLoC. There are 3 cubits to handle state
- This project follows Conventional Commits guidelines