current property

LiveApp? get current

The app commands run on: the one picked with use, or the only connected app. Null when commands run on every app or none is picked.

Implementation

LiveApp? get current {
  if (_all) return null;
  if (_chosenUri != null || _chosenDevice != null) {
    for (final LiveApp app in _apps) {
      if (app.uri.toString() == _chosenUri) return app;
    }
    final List<LiveApp> named = _apps
        .where((app) => app.device == _chosenDevice)
        .toList();
    return named.length == 1 ? named.single : null;
  }
  return _apps.length == 1 ? _apps.single : null;
}