addNewAnalysisOption static method

void addNewAnalysisOption(
  1. String pathApps,
  2. String appsName
)

Creates the analysis_options.yaml file for a new app module.

This method creates a standard analysis_options.yaml file that includes the dev_dependency_manager's Flutter linting configuration.

Parameters:

  • pathApps: The path to the new app module
  • appsName: The name of the new app module (unused but kept for consistency)

Implementation

static void addNewAnalysisOption(String pathApps, String appsName) {
  final analysisOptionsPath = p.join(pathApps, 'analysis_options.yaml');

  try {
    final content = '''include: package:dev_dependency_manager/flutter.yaml

# Additional information about this file can be found at
# https://dart.cn/guides/language/analysis-options
''';

    analysisOptionsPath.write(content);
    StatusHelper.generated(analysisOptionsPath);
  } catch (e) {
    StatusHelper.failed('Failed to create analysis_options.yaml: $e');
  }
}