rluv_client/lib/models/family_model.dart

32 lines
754 B
Dart
Raw Normal View History

2023-07-19 02:16:13 -06:00
import 'package:json_annotation/json_annotation.dart';
import '../global/utils.dart';
part 'family_model.g.dart';
@JsonSerializable()
class FamilyModel {
const FamilyModel({
required this.id,
2023-07-27 01:40:26 -06:00
required this.code,
2023-07-19 02:16:13 -06:00
required this.createdAt,
required this.updatedAt,
2023-07-22 21:29:32 -06:00
this.hide = false,
2023-07-19 02:16:13 -06:00
});
2023-07-27 01:40:26 -06:00
final int id;
final String? code;
2023-07-19 02:16:13 -06:00
2023-07-22 21:29:32 -06:00
@JsonKey(fromJson: boolFromJson, toJson: boolToJson)
final bool hide;
2023-07-19 02:16:13 -06:00
@JsonKey(fromJson: dateFromJson, toJson: dateToJson)
final DateTime createdAt;
@JsonKey(fromJson: dateFromJson, toJson: dateToJson)
final DateTime updatedAt;
factory FamilyModel.fromJson(Map<String, dynamic> json) =>
_$FamilyModelFromJson(json);
Map<String, dynamic> toJson() => _$FamilyModelToJson(this);
}