DEV Community

Discussion on: Data Modeling with Flutter using freezed package

Collapse
 
dul profile image
Abdul Rojak

sir, how to inheritance from a parent class with freezed.

with a case like this ??

class InformationDownlineModel extends InformationDownline {
final Header? header;
final Data? data;

InformationDownlineModel({this.header, this.data})
: super(
agentName: data?.agentName,
personresponsible: data?.personresponsible,
phone: data?.phone,
email: data?.email,
);

class InformationDownline extends Equatable {
final String? agentName;
final String? personresponsible;
final String? phone;
final String? email;

InformationDownline({this.agentName, this.personresponsible, this.phone, this.email});

@override
List get props => [agentName, personresponsible, phone, email];

Collapse
 
crossbread profile image
Jeff Neet • Edited

Had the same question, the creator of Freezed touches on it here:
github.com/rrousselGit/freezed/dis...