processWhile method
Future
processWhile({
- @Deprecated('Use appLabel instead') String promptLabel = 'App> ',
- String appLabel()?,
- List<
String> ? initArgs,
Implementation
Future processWhile({
@Deprecated('Use appLabel instead') String promptLabel = 'App> ',
/// [appLabel] is a function that returns the label of the prompt.
/// It will be called before each prompt.
/// You can use it to show dynamic labels.
String Function()? appLabel,
List<String>? initArgs,
}) async {
if (appLabel == null) {
appLabel = () => promptLabel;
} else {
promptLabel = appLabel();
}
if (initArgs != null && initArgs.isNotEmpty) {
args = initArgs;
await process();
}
if (onKeyPress != null) {
await _processWhileRaw(appLabel);
} else {
await _processWhileLine(appLabel);
}
}