- .run and .vscode folder to the root of the project
- localization_gen.sh to the root of the project
- lib folder to the root of the project
- assets and fonts folder to the root of the project
- desired content from pubspec.yaml to the pubspec.yaml
This template is made to minimize the efforts of new project creation and configuration. It has pre-installed packages (which will be listed below), flavors and some base helper classes.
This project is also a clean architecture structure demo.
/features/sample_feature is an example of file structure and configuration of a real app feature.
This project has prod and dev flavors installed. They will be imported to the development environment via .run & .vscode folders. Configuration for each flavor can be customized in app_config.dart file.
IOS flavors need to be additionaly configured in XCode. This article can be used.
The core packages are:
- dio
- get_it (our service locator)
- flutter_bloc
- shared_preferences
- equatable
- internet_connection_checker (for internet error processing).
The helper packages:
- easy_localization & easy_localization_loader (used for localization)
- responsive_sizer (You can customize num extension in /core/util/pixel_sizer.dart. Here you can set the figma layout height/width and make widgets more responsive, e.g. SizedBox(height: 20.ph))
- bot_toast (used for showing snackbars etc without context)
- flutter_svg
- url_launcher
- mask_text_input_formatter
- flutter_native_splash
- flutter_launcher_icons
There is a bunch of classes for handling requests.
/core/errors & core/models - some models for error handling and RepositoryRequestHandler (example is in the sample_feature). In models folder general models for the whole project can be stored.
/core/interceptors - some request interceptors such as error processing tool ErrorLoggerInterceptor or a class for authorization token incerceptor which can be connected to the shared preferences local repository.
/core/network - a tool for internet connection checking.
/core/style - colors, paddings, borders, text styles etc. Example of text style usage: Text("My text", style: fontInstanse.s14.w600.black).
/core/helper - storage config, images and icons listing, extensions, text masks etc.
/core/util - tools for opening urls, pop ups, bottom sheets, showing notifications via bot_toast etc. There is also a PaginationScrollController class for infinite pagination on scroll, I have an article about it.
There is a tool in the root of the project called localization_gen.sh - it can be used to make translations generation process easier. Run it in the terminal after you've added a new key-value pair to a translation file.
/core/widgets is used to store general widgets, like base app bars, text fields, pop up templates etc. It already includes a CvgIcon and CIcon widgets, which seem to me pretty useful.