file_scaffold 1.0.0+1

  • Readme
  • Changelog
  • Example
  • Installing
  • 50

file_scaffold #

Takes any directory structure, and creates modified copies of that structure using tokens for replacement. This allows you to easily create components for your projects, be it similar skeletons or completely different types.

Command-line usage #

You can install this package either globally or locally in your package and use the command line tools for configs.

pub global activate file_scaffold

You can access the command-line usage args using pub global run file_scaffold -h:

-n, --name                                     Name of this scaffold, to be used in folder name (if
                                              --create-subfolder is used) and file templates.

-o, --output-dir                               Directory to output the template files to. They will
                                               maintain their original directory structure.

-C, --[no-]create-subfolder                    Create subfolder at the output directory, using the
                                               scaffold's name.

-t, --templates=<path/to/templates/**.json>    List of templates to get files from. You may supply a
                                               glob string to include only files using that pattern.

-l, --locals=<key="value" [, ...]>             List of key-value mappings of locals to pass to the

-h, --help                                     Display this help message.

v1.0.0+1 #

  • Documentation
  • Dart analysis fixes

v1.0.0 #

  • Initial release


import 'package:file_scaffold/file_scaffold.dart';

void main(List<String> args) async {
  /// Create the configuration for your scaffold.
  /// If you only need to directly parse aruments from
  /// command line, you can use the `fromArgs` method,
  /// which will create a scaffold from the  regular arguments.
  var parsed = FileScaffoldConfig.fromArgs(args); // ignore: unused_local_variable

  /// Otherwise, you can supply the needed arguments yourself,
  /// in case you need to manipulate them in any way:
  var config = FileScaffoldConfig(
    name: 'Test',
    outputDirectory: 'sample_files/output',
    templates: ['sample_files/**'],
    locals: {'version': '1.0.0'},

  /// Then, create the scaffold object:
  var scaffold = FileScaffold(config);

  /// And then run it:

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  file_scaffold: ^1.0.0+1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:file_scaffold/file_scaffold.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Mar 26, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Health suggestions

Format lib/config.dart.

Run dartfmt to format lib/config.dart.

Format lib/file_scaffold.dart.

Run dartfmt to format lib/file_scaffold.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.0 <3.0.0
args ^1.5.2 1.6.0
glob ^1.2.0 1.2.0
meta ^1.1.8 1.1.8
path ^1.6.4 1.6.4
pedantic ^1.9.0 1.9.0
Transitive dependencies
async 2.4.1
charcode 1.1.3
collection 1.14.12
js 0.6.1+1
node_interop 1.0.3
node_io 1.0.1+2
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0