validateProjectStructure static method

ValidationResult<String> validateProjectStructure()

Validates project structure prerequisites.

Checks that required directories and files exist for the current working directory to be a valid project.

Returns: ValidationResult indicating project validity

Implementation

static ValidationResult<String> validateProjectStructure() {
  final pubspecPath = join(current, 'pubspec.yaml');

  if (!exists(pubspecPath)) {
    return ValidationResult.error(
      'Not a valid Flutter project',
      suggestion: 'Run this command from a Flutter project root directory',
      examples: ['cd /path/to/flutter/project', 'flutter create my_app'],
    );
  }

  return ValidationResult.success(current);
}