SuitePlatform constructor Null safety

SuitePlatform(
  1. Runtime runtime,
  2. {OperatingSystem os = OperatingSystem.none,
  3. bool inGoogle = false}
)

Creates a new platform with the given runtime and os, which defaults to OperatingSystem.none.

Throws an ArgumentError if runtime is a browser and os is not null or OperatingSystem.none.

Implementation

SuitePlatform(this.runtime,
    {this.os = OperatingSystem.none, this.inGoogle = false}) {
  if (runtime.isBrowser && os != OperatingSystem.none) {
    throw ArgumentError('No OS should be passed for runtime "$runtime".');
  }
}