map<TResult extends Object?> method

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

Implementation

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