preflightInit function
Implementation
PreflightResult preflightInit(String cwd) {
final validation = validateFlutterProject(cwd);
if (!validation.isValid) {
return PreflightResult(
success: false,
error: '✗ Flutter project validation failed',
details: [' • ${validation.error}'],
);
}
if (isAlreadyInitialized(cwd)) {
final themePath = path.join(cwd, 'lib', 'config', 'theme.dart');
return PreflightResult(
success: true,
warning: '⚠ fluttercn is already initialized',
details: [
' Theme file exists at: $themePath',
' Skipping initialization...',
],
);
}
return PreflightResult(success: true);
}