evaluate method

bool evaluate (
  1. SuitePlatform platform
)

Returns whether the selector matches the given platform.

os defaults to OperatingSystem.none.

Implementation

bool evaluate(SuitePlatform platform) {
  return _inner.evaluate((String variable) {
    if (variable == platform.runtime.identifier) return true;
    if (variable == platform.runtime.parent?.identifier) return true;
    if (variable == platform.os.identifier) return true;
    switch (variable) {
      case 'dart-vm':
        return platform.runtime.isDartVM;
      case 'browser':
        return platform.runtime.isBrowser;
      case 'js':
        return platform.runtime.isJS;
      case 'blink':
        return platform.runtime.isBlink;
      case 'posix':
        return platform.os.isPosix;
      case 'google':
        return platform.inGoogle;
      default:
        return false;
    }
  });
}