ImmutableKind<T> constructor

  1. @literal
const ImmutableKind<T>(
  1. {String? name,
  2. String? jsonName,
  3. required T blank,
  4. required WalkFunction<T> walk,
  5. Function? fromJson,
  6. Object? toJson(
    1. T object
  7. Map<String, T>? constantsByName}

Constructs a kind for a class that has a constant constructor.

Parameter blank is the default value. It should be a compile-time constant or at least an unmodifiable object.

Parameter walk is a function that maps an instance to a new instance using a Mapper.


const factory ImmutableKind({
  String? name,
  String? jsonName,
  required T blank,
  required WalkFunction<T> walk,
  Function? fromJson,
  Object? Function(T object)? toJson,
  Map<String, T>? constantsByName,
}) = _ImmutableKind<T>;