chooseStateHelper function
Prompts the user to choose a state management helper and returns the corresponding dependencies.
Implementation
StateHelperChoice chooseStateHelper() {
stdout.write(
'Choose state management helper:\n'
'1. equatable\n'
'2. freezed\n'
'Enter your choice (1 or 2): '
);
final choice = stdin.readLineSync();
if (choice == '2') {
return StateHelperChoice(
dependencies: [
'freezed_annotation:',
],
devDependencies: [
'freezed:',
'build_runner:',
],
);
}
return StateHelperChoice(
dependencies: [
'equatable:',
],
devDependencies: [],
);
}