INNER CODE UNIT · Dart

selected

livekit/client-sdk-flutter · scripts/create_change.dart:116

        selected = (selected - 1) % options.length;
        if (selected < 0) selected = options.length - 1;
      } else if (key[2] == 66) {
        // Down arrow
        selected = (selected + 1) % options.length;
      }
    } else if (key.length == 1 && (key[0] == 10 || key[0] == 13)) {
      // Enter
      stdout.write(_showCursor);
      // Clear the list and show selection
      stdout.write('${_esc}${options.length}A'); // Move up
      stdout.write('${_esc}0J'); // Clear from cursor down
      stdout.writeln('  $_green>${_reset} $_bold${options[selected]}$_reset');
      return options[selected];
    } else if (key.length == 1 && (key[0] == 3 || key[0] == 27)) {
      // Ctrl+C or Escape
      stdout.write(_showCursor);
      exit(0);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…