gradle_doctor 0.0.2
gradle_doctor: ^0.0.2 copied to clipboard
CLI tool to auto-fix Gradle & Android Gradle Plugin versions for Flutter projects
import '../bin/gradle_doctor.dart';
/// Example usage of Gradle Doctor CLI commands programmatically.
///
/// This example demonstrates how to check, fix, cleanup, and restore
/// Gradle & Android Gradle Plugin configuration for a Flutter project.
void main() async {
print('--- Gradle Doctor CLI Example ---');
// 1️⃣ Check project configuration
final isOk = await checkProject();
if (isOk) {
print('✅ Project is OK. No fixes needed.');
} else {
print('⚠️ Project requires fixes.');
}
// 2️⃣ Fix project if needed
print('\nRunning fix...');
await fixProject();
// 3️⃣ Cleanup backup files (optional)
print('\nCleaning up backups...');
await cleanupBackups();
// 4️⃣ Restore backup files (optional)
print('\nRestoring backups...');
await restoreBackups();
print('\n--- Example Complete ---');
}