when<TResult extends Object?> method Null safety

  1. @optionalTypeArgs
TResult when<TResult extends Object?>(
  1. {required TResult object(
    1. String key,
    2. String? description,
    3. Object? value
    ),
  2. required TResult map(
    1. String key,
    2. String? description,
    3. Map<String, Object?>? value
    ),
  3. required TResult string(
    1. String key,
    2. String? description,
    3. String? value
    ),
  4. required TResult bool(
    1. String key,
    2. String? description,
    3. bool? value
    ),
  5. required TResult double(
    1. String key,
    2. String? description,
    3. double? value
    ),
  6. required TResult int(
    1. String key,
    2. String? description,
    3. int? value
    ),
  7. required TResult num(
    1. String key,
    2. String? description,
    3. num? value
    ),
  8. required TResult dateTime(
    1. String key,
    2. String? description,
    3. DateTime? value
    ),
  9. required TResult duration(
    1. String key,
    2. String? description,
    3. Duration? value
    ),
  10. required TResult color(
    1. String key,
    2. String? description,
    3. Color? value
    )}
)
@optionalTypeArgs, inherited

Implementation

@optionalTypeArgs
TResult when<TResult extends Object?>({
  required TResult Function(String key, String? description, Object? value)
      object,
  required TResult Function(
          String key, String? description, Map<String, Object?>? value)
      map,
  required TResult Function(String key, String? description, String? value)
      string,
  required TResult Function(String key, String? description, bool? value)
      bool,
  required TResult Function(String key, String? description, double? value)
      double,
  required TResult Function(String key, String? description, int? value) int,
  required TResult Function(String key, String? description, num? value) num,
  required TResult Function(String key, String? description, DateTime? value)
      dateTime,
  required TResult Function(String key, String? description, Duration? value)
      duration,
  required TResult Function(String key, String? description, Color? value)
      color,
}) =>
    throw _privateConstructorUsedError;