confirmChanges static method

Future<bool> confirmChanges(
  1. List<String> changes
)

Show a summary and ask for confirmation

Implementation

static Future<bool> confirmChanges(List<String> changes) async {
  if (changes.isEmpty) {
    print('No changes to apply.');
    return false;
  }

  print('\nThe following changes will be made:');
  for (int i = 0; i < changes.length; i++) {
    print('  ${i + 1}. ${changes[i]}');
  }
  print('');

  return promptYesNo('Apply these ${changes.length} change(s)? [Y/n]');
}