confirm method
//////////////////// Confirmation Messages Guidelines
Prompts the user for a y/n
confirmation.
Accepts an optional defaultValue
to specify what happens when the user simply presses Enter.
Returns true
for "yes" or "y" and false
for "no" or "n".
Format:
<message prompt> [y/n]:
Implementation
// User input
/// ***Confirmation Messages Guidelines***
///
/// Prompts the user for a `y/n` confirmation.
/// Accepts an optional [defaultValue] to specify what happens when the user simply presses Enter.
/// Returns `true` for "yes" or "y" and `false` for "no" or "n".
///
/// Format:
/// ```bash
/// <message prompt> [y/n]:
/// ```
Future<bool> confirm(
final String message, {
final bool? defaultValue,
}) async {
if (configuration?.skipConfirmation == true) {
return true;
}
return prompts.confirm(
message,
defaultValue: defaultValue,
logger: _logger,
);
}