Files
pantry-flutter/lib/models/house.dart
2026-04-09 01:45:45 +03:00

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