Skip to content

inheritance support #145

Closed
Closed
@frickt

Description

@frickt

Is inheritance supported? I've tried the following example but got an exception, is there something i miss?:

@JsonSerializable()
abstract class Base extends Object with _$BaseSerializerMixin {
  Base(this.value);

  num value;

  factory Base.fromJson(Map<String, dynamic> json) => _$BaseFromJson(json);
}

@JsonSerializable()
class Sub extends Base with _$SubSerializerMixin {
  Sub(num value, this.subVal): super(value);

  num subVal;

  factory Sub.fromJson(Map<String, dynamic> json) => _$SubFromJson(json);
}

exception thrown:

Unsupported operation: Cannot populate the required constructor argument: value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions