ImmutableKind<T>.withConstructor constructor

  1. @literal
const ImmutableKind<T>.withConstructor({
  1. String? name,
  2. String? jsonName,
  3. required T constructor(),
  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 non-constant constructor.

Parameter constructor is a function that constructs a default instance.

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

Implementation

@literal
const factory ImmutableKind.withConstructor({
  String? name,
  String? jsonName,
  required T Function() constructor,
  required WalkFunction<T> walk,
  Function? fromJson,
  Object? Function(T object)? toJson,
  Map<String, T> constantsByName,
}) = _ConstructorImmutableKind<T>;