promptSetupMode function
Prompts for exactly the three setup modes, each with a one-line description (FR-001; contracts/cli-commands.md). Recommended is the default on empty input — the proven, most-travelled path.
Implementation
SetupModePromptResult promptSetupMode(WizardIo io) {
io.writeLine('How do you want to set up the project?');
io.writeLine(
' 1. Recommended The proven Release 0.1 stack, ready to review',
);
io.writeLine(
' 2. Customize Open the full section-based configurator — Application',
);
io.writeLine(
' Foundation (theme, flavors, logging, localization) + stack',
);
io.writeLine(
' 3. Minimal A valid minimal project, optional integrations skipped',
);
while (true) {
final input = io.prompt('Setup mode [1]: ').trim().toLowerCase();
if (input.isEmpty || input == '1' || input == 'recommended') {
return const SetupModeSelected(SetupMode.recommended);
} else if (input == '2' || input == 'customize') {
return const SetupModeSelected(SetupMode.customize);
} else if (input == '3' || input == 'minimal') {
return const SetupModeSelected(SetupMode.minimal);
} else if (input == 'cancel' || input == 'c' || input == '4') {
return const SetupModePromptCancelled();
}
io.writeLine(
'Invalid selection. Enter 1, 2, 3 (or Recommended/Customize/Minimal), or Cancel.',
);
}
}