Working api call to backend

This commit is contained in:
Nathan Anderson
2023-07-19 02:16:13 -06:00
parent 37c644ab0d
commit eba628bb4c
26 changed files with 1094 additions and 119 deletions
+33
View File
@@ -0,0 +1,33 @@
import 'package:json_annotation/json_annotation.dart';
import '../global/utils.dart';
part 'user.g.dart';
@JsonSerializable()
class User {
const User({
this.id,
required this.name,
required this.familyId,
required this.budgetId,
this.createdAt,
this.updatedAt,
this.lastActivityAt,
});
final int? id;
final int familyId, budgetId;
final String name;
@JsonKey(fromJson: dateFromJson, toJson: dateToJson)
final DateTime? createdAt;
@JsonKey(fromJson: dateFromJson, toJson: dateToJson)
final DateTime? updatedAt;
@JsonKey(fromJson: dateFromJson, toJson: dateToJson)
final DateTime? lastActivityAt;
factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
Map<String, dynamic> toJson() => _$UserToJson(this);
}