installStateManagement function
Implementation
Future<void> installStateManagement(
String projectPath,
String state,
) async {
final flutterCmd = Platform.isWindows ? 'flutter.bat' : 'flutter';
if (state == 'bloc') {
print('📦 Installing BLoC...');
await Process.run(
flutterCmd,
['pub', 'add', 'flutter_bloc', 'equatable'],
workingDirectory: projectPath,
runInShell: true,
);
} else if (state == 'riverpod') {
print('📦 Installing Riverpod...');
await Process.run(
flutterCmd,
['pub', 'add', 'flutter_riverpod'],
workingDirectory: projectPath,
runInShell: true,
);
}
}