addLibraryFile method

void addLibraryFile(
  1. String fileName,
  2. String contents, {
  3. bool export = true,
})

Creates a new $name.dart file in lib/

Imports the library file for this terminal.

Implementation

void addLibraryFile(String fileName, String contents, {bool export = true}) {
  addOrReplaceFile('lib/$fileName.dart', """
import 'package:$name/$name.dart';

$contents
""");

  addLibraryExport('$fileName.dart');
}