import 'package:json_annotation/json_annotation.dart'; import '../global/utils.dart'; part 'family_model.g.dart'; @JsonSerializable() class FamilyModel { const FamilyModel({ required this.id, required this.budgetId, required this.createdAt, required this.updatedAt, }); final int id, budgetId; @JsonKey(fromJson: dateFromJson, toJson: dateToJson) final DateTime createdAt; @JsonKey(fromJson: dateFromJson, toJson: dateToJson) final DateTime updatedAt; factory FamilyModel.fromJson(Map json) => _$FamilyModelFromJson(json); Map toJson() => _$FamilyModelToJson(this); }