A Flutter starter kit for beginner with Bloc, SQFlite, Fluro and Chopper to architect.
- BLoC pattern by bloc and Extensions
- Navigate pages by Fluro
- RESTFUL API by chopper
- JSON to object by built_value and generate class from json
- RxDart
- Meaning logging message by logging
- Cached image by cached_network_image
- Databases by SQFlite
- Localization by intl_translation
- Adapting screen and font size by flutter_screenutil
- Permission handler by permission_handler
- Equatable
- event_bus
- badges ...
Here is the core folder structure which flutter provides.
flutter-app/
|- android
|- build
|- ios
|- lib
|- test
Here is the folder structure we have been using in this project
lib/
|- base/
|- constants/
|- data/
|- l10n/
|- models/
|- routes/
|- screens/
|- utility/
|- widgets/
|- main.dart
Now, lets dive into the lib folder which has the main code for the application.
1- base - Contains all the base class
2- constants - All the application level constants are defined in this directory with-in their respective files. This directory contains the config for `color`, `font`, `localization` and others.
3- data - Contains the data layer of your project, includes directories for local, network and shared pref/cache.
4- l10n - Contains all translation language file.
5- models - Contains all generated model.
6- routes - Contains all the routes for your application.
7- screens - Contains all the ui of your project, contains sub directory for each screen.
8- utility — Contains the utilities/common functions of your application.
9- widgets — Contains the common widgets for your applications. For example, Button, TextField etc.
10- main.dart - This is the starting point of the application. All the application level configurations are defined in this file i.e, theme, routes, title, orientation etc.
Step 1:
Download or clone this repo by using the link below:
https://github.com/rinlv/flutter-starter.git
Step 2:
Go to project root and execute the following command in console to get the required dependencies:
flutter pub get
Step 3:
This project uses inject
library that works with code generation, execute the following command to generate files:
flutter packages pub run build_runner build --delete-conflicting-outputs
or watch command in order to keep the source code synced automatically:
flutter packages pub run build_runner watch
In-order to hide generated files, navigate to Android Studio
-> Preferences
-> Editor
-> File Types
and past the below lines under ignore files and folders
section:
*.inject.summary;*.inject.dart;*.g.dart;
In Visual Studio Code, navigate to Preferences
-> Settings
and search for Files:Exclude
. Add the following patterns:
**/*.inject.summary
**/*.inject.dart
**/*.g.dart
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.