The project is divided into two main folders:
- The UI contains all app screens.
- The Core contains the models and the data layer.
Flutter Bloc is used for state management, specifically, we use Cubit to manage the screen state.
Each app section is added in a project folder which contains three components, the Screen (a StatelessWidget
, the UI), the Cubit and the state.
The MainScreen
is the Widget that contains all screens. It defines the MaterialApp
and provides the app router.
The router has two subgraphs, the UnauthenticatedRouter
used for unauthenticated users and the AuthenticatedRouter
used for authenticated users.
The app router is provided by auto_route, and contains the previous sections with some nested screens.
The theme folder contains the theme definitions, for example colors, styles and dimensions. Another important plugin related to the UI is flutter_screenutil, used for adapting screen and font size.
The models are defined in the models folder. If you need to use different models for networking, you can create them in service
folder.
The repository pattern is used to manage the data layer. A repository uses different data sources (for example a local cache or the Supabase SDK). These components are injected in the Cubits using get_it.
The /assets/
folder contains the assets used by the application, such as images, fonts, and other files.
The environment variables are defined in the default.env
file located in /environments/
folder.
You can read more information about the environment variables in the README.md file.
In order to setup pre-push hook you need to go to the root of the project and run git config core.hooksPath .github/hooks