Boilerplate means:
boilerplate means a piece of code that can be used over and over again in a specifc part of an app, or to do the same operation, maybe with slight modifications.
In short word - you can understand boilerplate by reusable code that is used many places in to project.
Purpose of using Boilerplate in flutter :
- Using global and centrelize code base
- Avoiding unnecessary code from project
- Centralized place to manage your application’s colors/branding
- Centralized place to manage your application’s constants/url/keys
- Logically & Naturally organized files & folders:
- api – hold all your common api concerns (ApiBaseHelper, ApiResponse, AppException)
- blocs – hold all your blocs (Streams – provide data to the views. relate to controllers)
- models – hold all your models (relate to models )
- repositories – hold all your repositories (CRUD operations)
- responses – hold all your responses
- utils – hold all your utility files
- views – hold all your views/ui (relate to views )
- partials – hold all your commonly used widgets (ApiError, Loading)
Features of this Boilerplate Repository:
- Form validation
- Multiple language support localisation
- Global theme with persistence in storage
- Exported modules
- Bottom navigation with persistence in storage
- Service classes (Connectivity Service , Storage Service and http service)
- Logger Utility
- Dependency Injector
- Modal sheet
- App Data Source
- App data repository
- Response handling
- Navigation handling with auto route
- Form validation
- Dynamic theming