flutter_templater 0.0.3 flutter_templater: ^0.0.3 copied to clipboard
A package which simplifies the task of creating project folder structure and template files.
Flutter Templater #
A command-line tool which simplifies the process of creating folder and file structure of your project according to your needs. Your Template Config file can be saved locally or uploaded to your gist account.
📖 Guide #
1. Setup the config file
Add your Flutter Template configuration to your pubspec.yaml
or create a new config file called flutter_template_config.yaml
.
An example is shown below. More complex examples can be found in the example projects.
dev_dependencies:
flutter_templater:
git: https://github.com/meTowhid/flutter_templater.git
template_config:
generate:
- path: assets/fonts
- path: lib/constants/constants.dart
- path: lib/screens
files:
- file: splash.dart
template: scaffold
If you stored your configuration separately than you will need to specify the name of the file when running the package.
flutter pub get
flutter pub run flutter_templater:main -f <your config file name here>
2. Run the package
After setting up the configuration, all that is left to do is run the package. default file name is pubspec.yaml
flutter pub get
flutter pub run flutter_templater:main
If you encounter any issues please report them here.
🔍 Attributes #
Shown below is the full list of attributes which you can specify within your Flutter Templater configuration.
-
override
true
/false
: Override the existing files
-
gist
: This can pull any 'config.yaml' file from gist address -
generate
: This holds the list of generatable items-
path
: The location of the folder/file. In case of file you can define its template code.template
: 3 basic templates are included in the packagesingleton
,scaffold
andbasicMain
gist
: You can use your own gist to create templatefiles
: In case of generating multiple files in the same directory-
file
: file name with its extension must be heretemplate
: as mentioned earlier, any template can be used heregist
: Your gist link can be applied here
-
-