PlatformResolver<T> constructor

PlatformResolver<T>({
  1. T nativeResolver()?,
  2. T androidResolver()?,
  3. T iOSResolver()?,
  4. T chromeExtensionResolver()?,
  5. T fuschiaResolver()?,
  6. T linuxResolver()?,
  7. T macOSResolver()?,
  8. T webResolver()?,
  9. T windowsResolver()?,
  10. T defaultResolver()?,
  11. Set<Platforms>? supportedPlatforms,
})

Implementation

PlatformResolver({
  this.nativeResolver,
  this.androidResolver,
  this.iOSResolver,
  this.chromeExtensionResolver,
  this.fuschiaResolver,
  this.linuxResolver,
  this.macOSResolver,
  this.webResolver,
  this.windowsResolver,
  this.defaultResolver,
  Set<Platforms>? supportedPlatforms,
}) {
  supportedPlatforms ??= Platform.instance.supportedPlatforms;

  if (supportedPlatforms.contains(Platforms.android)) {
    assert(_android != null, 'Missing android resolver');
  }
  if (supportedPlatforms.contains(Platforms.chromeExtension)) {
    assert(_chromeExtension != null, 'Missing chrome extension resolver');
  }
  if (supportedPlatforms.contains(Platforms.fuschia)) {
    assert(_fuschia != null, 'Missing fuschia resolver');
  }
  if (supportedPlatforms.contains(Platforms.iOS)) {
    assert(_iOS != null, 'Missing iOS resolver');
  }
  if (supportedPlatforms.contains(Platforms.linux)) {
    assert(_linux != null, 'Missing linux resolver');
  }
  if (supportedPlatforms.contains(Platforms.macOS)) {
    assert(_macOS != null, 'Missing macOS resolver');
  }
  if (supportedPlatforms.contains(Platforms.web)) {
    assert(_web != null, 'Missing web resolver');
  }
  if (supportedPlatforms.contains(Platforms.windows)) {
    assert(_windows != null, 'Missing windows resolver');
  }
}