updateAnalysisOptionsFileSync static method
Writes an analysis_options.yaml that enables Flutter lints and plugin support.
Parameters:
projectName: the application folder where the file will be written.
Implementation
static void updateAnalysisOptionsFileSync({required String projectName}) {
print('📝 Updating analysis options file...');
final content = '''
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
include: package:flutter_lints/flutter.yaml
analyzer:
plugins:
- custom_lint
linter:
rules:
package_names: false
depend_on_referenced_packages: false
''';
final file = File('$projectName/analysis_options.yaml');
file.writeAsStringSync(content);
print('✅ Analysis options file updated');
}