Skip to content

Floating-Dartists/fd_template_creator

Repository files navigation

Template Creator

Floating Dartists

Pub Version Test workflow style: lint GitHub license

A Dart script to generate a template for a Flutter project from a boilerplate code repository.

This package will generate a template by using the flutter create command, then copying files from a code repo to replace the generated files.

Usage

  • Activate the package globally:
dart pub global activate fd_template_creator
  • Create a file fd_template_creator.yaml in the root of your project:
# Project name
name: my_app
# Project description (optional)
# description: My app description
# Project organization (optional)
# organization: com.example
template:
  # Template name (used to replace package import)
  name: fd_template
  # Git repository to clone
  git:
    url: https://github.com/Floating-Dartists/fd_template.git
    # If you want to depend on a specific commit, branch or tag, you
    # can use a ref key.
    # ref: main
  # Local path to the template
  # path: path/to/fd_template
  # List of the files or folders to copy from the template
  files:
    - .github/
    - lib/
    - assets/
    - test/
    - analysis_options.yaml
    - dart_test.yaml
    - pubspec.yaml
  • Run the package from the root of your project:
dart pub global run fd_template_creator

Note: If you want to use the package you will need to have Flutter installed on your machine.

TODO

  • Custom path argument for the configuration file
  • Better error management

Credits