LCOV - code coverage report
Current view: top level - src/commands/create/commands - flutter_plugin.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 13 13 100.0 %
Date: 2023-11-15 10:29:52 Functions: 0 0 -

          Line data    Source code
       1             : import 'package:very_good_cli/src/commands/commands.dart';
       2             : import 'package:very_good_cli/src/commands/create/templates/templates.dart';
       3             : 
       4             : /// {@template very_good_create_flutter_plugin_command}
       5             : /// A [CreateSubCommand] for creating Flutter plugins.
       6             : /// {@endtemplate}
       7             : class CreateFlutterPlugin extends CreateSubCommand with Publishable, OrgName {
       8             :   /// {@macro very_good_create_flutter_plugin_command}
       9          15 :   CreateFlutterPlugin({
      10             :     required super.logger,
      11             :     required super.generatorFromBundle,
      12             :     required super.generatorFromBrick,
      13             :   }) {
      14          30 :     argParser.addMultiOption(
      15             :       'platforms',
      16             :       help: 'The platforms supported by the plugin. By default, all platforms '
      17             :           'are enabled. Example: --platforms=android,ios',
      18          15 :       defaultsTo: ['android', 'ios', 'web', 'linux', 'macos', 'windows'],
      19          15 :       allowed: ['android', 'ios', 'web', 'linux', 'macos', 'windows'],
      20          15 :       allowedHelp: {
      21             :         'android': 'The plugin supports the Android platform.',
      22             :         'ios': 'The plugin supports the iOS platform.',
      23             :         'web': 'The plugin supports the Web platform.',
      24             :         'linux': 'The plugin supports the Linux platform.',
      25             :         'macos': 'The plugin supports the macOS platform.',
      26             :         'windows': 'The plugin supports the Windows platform.',
      27             :       },
      28             :     );
      29             :   }
      30             : 
      31          15 :   @override
      32             :   String get name => 'flutter_plugin';
      33             : 
      34           3 :   @override
      35             :   String get description => 'Generate a Very Good Flutter plugin.';
      36             : 
      37           1 :   @override
      38           1 :   Template get template => FlutterPluginTemplate();
      39             : 
      40           1 :   @override
      41             :   Map<String, dynamic> getTemplateVars() {
      42           1 :     final vars = super.getTemplateVars();
      43             : 
      44           2 :     final platforms = argResults['platforms'] as List<String>;
      45             : 
      46           1 :     vars['platforms'] = platforms;
      47             : 
      48             :     return vars;
      49             :   }
      50             : }

Generated by: LCOV version 1.16