showOptions method

Future<void> showOptions(
  1. List<String> unusedDependencies
)

Implementation

Future<void> showOptions(List<String> unusedDependencies) async {
  print('What would you like to do?');
  print('1. Remove all unused dependencies');
  print('2. Remove specific dependencies');
  print('3. Cancel');

  stdout.write("➢ Your choice: ");
  var input = stdin.readLineSync();
  switch (input) {
    case '1':
      removeDependencies(unusedDependencies);
      break;
    case '2':
      await removeSpecificDependencies(unusedDependencies);
      break;
    case '3':
      MsgUtils.showInfo("Operation cancelled.");
      break;
    default:
      MsgUtils.showError("Invalid option. Exiting...");
  }
}