Created
October 18, 2021 13:42
-
-
Save aniekan12/5ba4ff4fe0a402f7f6c5138d7bee331a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//the fields we will use to create the table columns in our database | |
class DemandFields { | |
static final List<String> values = [ | |
id, | |
propertyId | |
]; | |
static final String id = 'id'; | |
static final String propertyId = 'property_id'; | |
} | |
class DemandNoticeModel { | |
final int id; | |
final String propertyId; | |
const DemandNoticeModel({ | |
this.id, | |
this.propertyId, | |
}); | |
DemandNoticeModel copy({ | |
int id, | |
String propertyId, | |
}) => | |
DemandNoticeModel( | |
id: id ?? this.id, | |
propertyId: propertyId ?? this.propertyId, | |
); | |
static DemandNoticeModel fromJson(Map<String, Object> json) => | |
DemandNoticeModel( | |
id: json[DemandFields.id] as int, | |
propertyId: json[DemandFields.propertyId] as String, | |
); | |
Map<String, Object> toJson() => { | |
DemandFields.id: id, | |
DemandFields.propertyId: propertyId, | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment