forked from eatvio/eatvio_app
20 lines
641 B
Dart
20 lines
641 B
Dart
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
|
|
part 'weight_model.freezed.dart';
|
|
|
|
part 'weight_model.g.dart';
|
|
|
|
@freezed
|
|
abstract class WeightModel with _$WeightModel {
|
|
const factory WeightModel({
|
|
@JsonKey(name: "id") required int id,
|
|
@JsonKey(name: "user_id") required int userId,
|
|
@JsonKey(name: "weight") required int weight,
|
|
@JsonKey(name: "created_at") required DateTime createdAt,
|
|
@JsonKey(name: "updated_at") required DateTime updatedAt,
|
|
@JsonKey(name: "bmi") required double bmi,
|
|
}) = _WeightModel;
|
|
|
|
factory WeightModel.fromJson(Map<String, dynamic> json) => _$WeightModelFromJson(json);
|
|
}
|