detectStateManagement method

String detectStateManagement()

Implementation

String detectStateManagement() {
  final pubspecFile = File(p.join(_projectDir, 'pubspec.yaml'));
  if (!pubspecFile.existsSync()) return 'riverpod';

  final content = pubspecFile.readAsStringSync();
  if (content.contains('flutter_bloc')) return 'bloc';
  if (content.contains('flutter_riverpod')) return 'riverpod';
  return 'riverpod';
}