cleanBuildCache method

  1. @override
Future<void> cleanBuildCache(
  1. String projectName
)
override

Implementation

@override
Future<void> cleanBuildCache(String projectName) async {
  try {
    // Run flutter clean to clear build cache
    final result = await Process.run(
      'flutter',
      ['clean'],
      workingDirectory: projectName,
    );

    if (result.exitCode == 0) {
      // Run flutter pub get to restore dependencies
      await Process.run(
        'flutter',
        ['pub', 'get'],
        workingDirectory: projectName,
      );
    }
  } catch (e) {
    print('Warning: Failed to clean build cache: $e');
  }
}