jason property

FutureOr<Jason?> get jason

Returns the Jason instance of these MediaUtils.

Implementation

FutureOr<Jason?> get jason {
  if (_jason == null) {
    return _guard.protect(() async {
      if (_jason != null) {
        return _jason;
      }

      try {
        _jason = await Jason.init();
      } catch (_) {
        // TODO: So the test would run. Jason currently only supports Web and
        //       Android, and unit tests run on a host machine.
        _jason = null;
      }

      WebUtils.onPanic((e) {
        Log.error('Panic: ${e.toString()}', 'Jason');
        _jason = null;
        __mediaManager = null;
      });

      return _jason;
    });
  }

  return _jason;
}