knob method

String knob(
  1. String name, {
  2. List<String> options = const [],
  3. String initial = '',
  4. String? description,
})

A value the world is opened with, and answers it: what it was opened or restarted with, else initial. Changing one restarts the world.

Implementation

String knob(
  String name, {
  List<String> options = const [],
  String initial = '',
  String? description,
}) {
  var value = '${_knobValues[name] ?? initial}';
  _send(WorldMessage.knob, {
    'name': name,
    'value': value,
    if (options.isNotEmpty) 'options': options,
    'description': ?description,
  });
  return value;
}