ImmutableKind<T>.withConstructor constructor

  1. @literal
const ImmutableKind<T>.withConstructor(
  1. {String? name,
  2. String? jsonName,
  3. required T constructor(
    1. required WalkFunction<T> walk,
    2. Function? fromJson,
    3. Object? toJson(
      1. T object
    4. 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.


    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>;