feat(profile): add weight and imt charts, menu add dividers

This commit is contained in:
mso7nueh
2024-08-28 15:55:08 +03:00
parent fda601106a
commit f994589baa
12 changed files with 287 additions and 32 deletions

View File

@@ -101,6 +101,7 @@ class ChartPoint with _$ChartPoint {
@JsonKey(name: "id") required int id,
@JsonKey(name: "user_id") required int userId,
@JsonKey(name: "weight") required int weight,
@JsonKey(name: "bmi") required String bmi,
@JsonKey(name: "created_at") required DateTime createdAt,
@JsonKey(name: "updated_at") required DateTime updatedAt,
}) = _ChartPoint;

View File

@@ -2122,6 +2122,8 @@ mixin _$ChartPoint {
int get userId => throw _privateConstructorUsedError;
@JsonKey(name: "weight")
int get weight => throw _privateConstructorUsedError;
@JsonKey(name: "bmi")
String get bmi => throw _privateConstructorUsedError;
@JsonKey(name: "created_at")
DateTime get createdAt => throw _privateConstructorUsedError;
@JsonKey(name: "updated_at")
@@ -2143,6 +2145,7 @@ abstract class $ChartPointCopyWith<$Res> {
{@JsonKey(name: "id") int id,
@JsonKey(name: "user_id") int userId,
@JsonKey(name: "weight") int weight,
@JsonKey(name: "bmi") String bmi,
@JsonKey(name: "created_at") DateTime createdAt,
@JsonKey(name: "updated_at") DateTime updatedAt});
}
@@ -2163,6 +2166,7 @@ class _$ChartPointCopyWithImpl<$Res, $Val extends ChartPoint>
Object? id = null,
Object? userId = null,
Object? weight = null,
Object? bmi = null,
Object? createdAt = null,
Object? updatedAt = null,
}) {
@@ -2179,6 +2183,10 @@ class _$ChartPointCopyWithImpl<$Res, $Val extends ChartPoint>
? _value.weight
: weight // ignore: cast_nullable_to_non_nullable
as int,
bmi: null == bmi
? _value.bmi
: bmi // ignore: cast_nullable_to_non_nullable
as String,
createdAt: null == createdAt
? _value.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
@@ -2203,6 +2211,7 @@ abstract class _$$ChartPointImplCopyWith<$Res>
{@JsonKey(name: "id") int id,
@JsonKey(name: "user_id") int userId,
@JsonKey(name: "weight") int weight,
@JsonKey(name: "bmi") String bmi,
@JsonKey(name: "created_at") DateTime createdAt,
@JsonKey(name: "updated_at") DateTime updatedAt});
}
@@ -2221,6 +2230,7 @@ class __$$ChartPointImplCopyWithImpl<$Res>
Object? id = null,
Object? userId = null,
Object? weight = null,
Object? bmi = null,
Object? createdAt = null,
Object? updatedAt = null,
}) {
@@ -2237,6 +2247,10 @@ class __$$ChartPointImplCopyWithImpl<$Res>
? _value.weight
: weight // ignore: cast_nullable_to_non_nullable
as int,
bmi: null == bmi
? _value.bmi
: bmi // ignore: cast_nullable_to_non_nullable
as String,
createdAt: null == createdAt
? _value.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
@@ -2256,6 +2270,7 @@ class _$ChartPointImpl implements _ChartPoint {
{@JsonKey(name: "id") required this.id,
@JsonKey(name: "user_id") required this.userId,
@JsonKey(name: "weight") required this.weight,
@JsonKey(name: "bmi") required this.bmi,
@JsonKey(name: "created_at") required this.createdAt,
@JsonKey(name: "updated_at") required this.updatedAt});
@@ -2272,6 +2287,9 @@ class _$ChartPointImpl implements _ChartPoint {
@JsonKey(name: "weight")
final int weight;
@override
@JsonKey(name: "bmi")
final String bmi;
@override
@JsonKey(name: "created_at")
final DateTime createdAt;
@override
@@ -2280,7 +2298,7 @@ class _$ChartPointImpl implements _ChartPoint {
@override
String toString() {
return 'ChartPoint(id: $id, userId: $userId, weight: $weight, createdAt: $createdAt, updatedAt: $updatedAt)';
return 'ChartPoint(id: $id, userId: $userId, weight: $weight, bmi: $bmi, createdAt: $createdAt, updatedAt: $updatedAt)';
}
@override
@@ -2291,6 +2309,7 @@ class _$ChartPointImpl implements _ChartPoint {
(identical(other.id, id) || other.id == id) &&
(identical(other.userId, userId) || other.userId == userId) &&
(identical(other.weight, weight) || other.weight == weight) &&
(identical(other.bmi, bmi) || other.bmi == bmi) &&
(identical(other.createdAt, createdAt) ||
other.createdAt == createdAt) &&
(identical(other.updatedAt, updatedAt) ||
@@ -2300,7 +2319,7 @@ class _$ChartPointImpl implements _ChartPoint {
@JsonKey(ignore: true)
@override
int get hashCode =>
Object.hash(runtimeType, id, userId, weight, createdAt, updatedAt);
Object.hash(runtimeType, id, userId, weight, bmi, createdAt, updatedAt);
@JsonKey(ignore: true)
@override
@@ -2321,6 +2340,7 @@ abstract class _ChartPoint implements ChartPoint {
{@JsonKey(name: "id") required final int id,
@JsonKey(name: "user_id") required final int userId,
@JsonKey(name: "weight") required final int weight,
@JsonKey(name: "bmi") required final String bmi,
@JsonKey(name: "created_at") required final DateTime createdAt,
@JsonKey(name: "updated_at") required final DateTime updatedAt}) =
_$ChartPointImpl;
@@ -2338,6 +2358,9 @@ abstract class _ChartPoint implements ChartPoint {
@JsonKey(name: "weight")
int get weight;
@override
@JsonKey(name: "bmi")
String get bmi;
@override
@JsonKey(name: "created_at")
DateTime get createdAt;
@override

View File

@@ -169,6 +169,7 @@ _$ChartPointImpl _$$ChartPointImplFromJson(Map<String, dynamic> json) =>
id: (json['id'] as num).toInt(),
userId: (json['user_id'] as num).toInt(),
weight: (json['weight'] as num).toInt(),
bmi: json['bmi'] as String,
createdAt: DateTime.parse(json['created_at'] as String),
updatedAt: DateTime.parse(json['updated_at'] as String),
);
@@ -178,6 +179,7 @@ Map<String, dynamic> _$$ChartPointImplToJson(_$ChartPointImpl instance) =>
'id': instance.id,
'user_id': instance.userId,
'weight': instance.weight,
'bmi': instance.bmi,
'created_at': instance.createdAt.toIso8601String(),
'updated_at': instance.updatedAt.toIso8601String(),
};