run method
Runs the feature manager interactive loop.
Displays the feature list and allows the user to add new features or manage existing ones.
Implementation
Future<void> run() async {
while (true) {
final features = _getFeatures();
Console.printFeatureList(features);
final options = <String>[
...features,
'β Add new feature',
'πͺ Exit',
];
final idx = Console.selectFromList(
'ποΈ Feature Manager β What do you want to do?',
options,
);
if (idx == options.length - 1) {
// Exit
Console.info('Goodbye! Happy coding π');
break;
} else if (idx == options.length - 2) {
// Add new feature
await _addFeature();
} else {
// Manage existing feature
await _manageFeature(features[idx]);
}
}
}