Line data Source code
1 : import 'package:mason/mason.dart'; 2 : import 'package:universal_io/io.dart'; 3 : 4 : /// {@template template} 5 : /// Dart class that represents a VeryGoodCLI supported template. 6 : /// Each template consists of a [MasonBundle], name, 7 : /// and help text describing the template. 8 : /// {@endtemplate} 9 : abstract class Template { 10 : /// {@macro template} 11 15 : const Template({ 12 : required this.name, 13 : required this.bundle, 14 : required this.help, 15 : }); 16 : 17 : /// The name associated with this template. 18 : final String name; 19 : 20 : /// The [MasonBundle] used to generate this template. 21 : final MasonBundle bundle; 22 : 23 : /// The help text shown in the usage information for the CLI. 24 : final String help; 25 : 26 : /// Callback invoked after template generation has completed. 27 : Future<void> onGenerateComplete(Logger logger, Directory outputDir); 28 : }