Skip to content

Commit aecbcfe

Browse files
committed
Update models to work with new keys
creation_date was renamed to created and update_date to last_updated
1 parent f74a343 commit aecbcfe

File tree

54 files changed

+527
-285
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+527
-285
lines changed

integration_test/5_nutritional_plan.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Widget createNutritionalPlanScreen({locale = 'en'}) {
2222
id: 1,
2323
code: '123456787',
2424
name: 'Müsli',
25-
creationDate: DateTime(2021, 5, 1),
25+
created: DateTime(2021, 5, 1),
2626
energy: 500,
2727
carbohydrates: 10,
2828
carbohydratesSugar: 2,
@@ -36,7 +36,7 @@ Widget createNutritionalPlanScreen({locale = 'en'}) {
3636
id: 1,
3737
code: '123456787',
3838
name: 'Milk',
39-
creationDate: DateTime(2021, 5, 1),
39+
created: DateTime(2021, 5, 1),
4040
energy: 500,
4141
carbohydrates: 10,
4242
carbohydratesSugar: 2,
@@ -50,7 +50,7 @@ Widget createNutritionalPlanScreen({locale = 'en'}) {
5050
id: 1,
5151
code: '123456787',
5252
name: 'Apple',
53-
creationDate: DateTime(2021, 5, 1),
53+
created: DateTime(2021, 5, 1),
5454
energy: 500,
5555
carbohydrates: 10,
5656
carbohydratesSugar: 2,

lib/models/body_weight/weight_entry.g.dart

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/models/exercises/base.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ class ExerciseBase extends Equatable {
3939
@JsonKey(required: true, name: 'variations')
4040
final int? variationId;
4141

42-
@JsonKey(required: true, name: 'creation_date')
43-
final DateTime? creationDate;
42+
@JsonKey(required: true, name: 'created')
43+
final DateTime? created;
4444

45-
@JsonKey(required: true, name: 'update_date')
46-
final DateTime? updateDate;
45+
@JsonKey(required: true, name: 'last_update')
46+
final DateTime? lastUpdate;
4747

4848
@JsonKey(required: true, name: 'category')
4949
late int categoryId;
@@ -81,8 +81,8 @@ class ExerciseBase extends Equatable {
8181
ExerciseBase({
8282
this.id,
8383
this.uuid,
84-
this.creationDate,
85-
this.updateDate,
84+
this.created,
85+
this.lastUpdate,
8686
this.variationId,
8787
List<Muscle>? muscles,
8888
List<Muscle>? musclesSecondary,
@@ -115,7 +115,7 @@ class ExerciseBase extends Equatable {
115115
}
116116

117117
if (exercises != null) {
118-
this.translations = exercises;
118+
translations = exercises;
119119
}
120120

121121
if (videos != null) {
@@ -166,8 +166,8 @@ class ExerciseBase extends Equatable {
166166
List<Object?> get props => [
167167
id,
168168
uuid,
169-
creationDate,
170-
updateDate,
169+
created,
170+
lastUpdate,
171171
category,
172172
equipment,
173173
muscles,

lib/models/exercises/base.g.dart

Lines changed: 19 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/models/exercises/category.g.dart

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/models/exercises/image.g.dart

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/models/exercises/translation.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ class Translation extends Equatable {
3939
@JsonKey(includeFromJson: false, includeToJson: false)
4040
late Language languageObj;
4141

42-
@JsonKey(required: true, name: 'creation_date')
43-
final DateTime? creationDate;
42+
@JsonKey(required: true, name: 'created')
43+
final DateTime? created;
4444

4545
@JsonKey(required: true, name: 'exercise_base')
4646
late int? baseId;
@@ -60,7 +60,7 @@ class Translation extends Equatable {
6060
Translation({
6161
this.id,
6262
this.uuid,
63-
this.creationDate,
63+
this.created,
6464
required this.name,
6565
required this.description,
6666
int? baseId,
@@ -96,7 +96,7 @@ class Translation extends Equatable {
9696
baseId,
9797
uuid,
9898
languageId,
99-
creationDate,
99+
created,
100100
name,
101101
description,
102102
];

lib/models/exercises/translation.g.dart

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/models/measurements/measurement_category.g.dart

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/models/measurements/measurement_entry.g.dart

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)