map<TResult extends Object?> method

TResult map<TResult extends Object?>({
  1. required TResult wallpaper(
    1. BackgroundTypeWallpaper value
    ),
  2. required TResult pattern(
    1. BackgroundTypePattern value
    ),
  3. required TResult fill(
    1. BackgroundTypeFill value
    ),
  4. required TResult chatTheme(
    1. BackgroundTypeChatTheme value
    ),
})

Implementation

TResult map<TResult extends Object?>({
  required TResult Function(BackgroundTypeWallpaper value) wallpaper,
  required TResult Function(BackgroundTypePattern value) pattern,
  required TResult Function(BackgroundTypeFill value) fill,
  required TResult Function(BackgroundTypeChatTheme value) chatTheme,
}) {
  switch (getConstructor()) {
    case BackgroundTypeWallpaper.constructor:
      return wallpaper.call(this as BackgroundTypeWallpaper);
    case BackgroundTypePattern.constructor:
      return pattern.call(this as BackgroundTypePattern);
    case BackgroundTypeFill.constructor:
      return fill.call(this as BackgroundTypeFill);
    case BackgroundTypeChatTheme.constructor:
      return chatTheme.call(this as BackgroundTypeChatTheme);
  }
  throw StateError('not handled type Generator');
}