askTheme static method

Future<int> askTheme(
  1. String prompt,
  2. List<String> themes,
  3. List<String> descriptions, {
  4. int initialIndex = 0,
})

Theme/option selector with descriptions

Implementation

static Future<int> askTheme(
  String prompt,
  List<String> themes,
  List<String> descriptions, {
  int initialIndex = 0,
}) async {
  // Build options with descriptions
  final List<String> options = <String>[];
  for (int i = 0; i < themes.length; i++) {
    if (i < descriptions.length) {
      options.add('${themes[i]} - ${descriptions[i]}');
    } else {
      options.add(themes[i]);
    }
  }

  return showMenu(prompt, options, defaultIndex: initialIndex);
}