import 'package:json_annotation/json_annotation.dart'; part 'user.g.dart'; @JsonSerializable() class User { final String id; final String email; final String name; @JsonKey(name: 'avatar_url') final String? avatarUrl; @JsonKey(name: 'height_cm') final int? heightCm; @JsonKey(name: 'weight_kg') final double? weightKg; final int? age; final String? gender; final String? activity; final String? goal; @JsonKey(name: 'daily_calories') final int? dailyCalories; final String plan; @JsonKey(defaultValue: {}) final Map preferences; const User({ required this.id, required this.email, required this.name, this.avatarUrl, this.heightCm, this.weightKg, this.age, this.gender, this.activity, this.goal, this.dailyCalories, required this.plan, this.preferences = const {}, }); factory User.fromJson(Map json) => _$UserFromJson(json); Map toJson() => _$UserToJson(this); bool get hasCompletedOnboarding => heightCm != null && weightKg != null && age != null && gender != null; }