mirror of
https://github.com/chenasraf/pantry-flutter.git
synced 2026-05-17 17:28:03 +00:00
40 lines
918 B
Dart
40 lines
918 B
Dart
class House {
|
|
final int id;
|
|
final String name;
|
|
final String? description;
|
|
final String ownerUid;
|
|
final String role;
|
|
final int createdAt;
|
|
final int updatedAt;
|
|
|
|
const House({
|
|
required this.id,
|
|
required this.name,
|
|
this.description,
|
|
required this.ownerUid,
|
|
required this.role,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
});
|
|
|
|
factory House.fromJson(Map<String, dynamic> json) => House(
|
|
id: json['id'] as int,
|
|
name: json['name'] as String,
|
|
description: json['description'] as String?,
|
|
ownerUid: json['ownerUid'] as String,
|
|
role: json['role'] as String,
|
|
createdAt: json['createdAt'] as int,
|
|
updatedAt: json['updatedAt'] as int,
|
|
);
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
'id': id,
|
|
'name': name,
|
|
'description': description,
|
|
'ownerUid': ownerUid,
|
|
'role': role,
|
|
'createdAt': createdAt,
|
|
'updatedAt': updatedAt,
|
|
};
|
|
}
|