Yimaru-Mobile/lib/models/user.dart
BisratHailu 35baae8d92 - fix(learn): Modify overall learn hierarchy.
- fix(learn): Modify learn path flow according to the new hierarchy.
- add(learn): Add additionl screens for the new hierarchy levels.
2026-04-18 22:04:56 +03:00

95 lines
2.3 KiB
Dart

import 'package:json_annotation/json_annotation.dart';
part 'user.g.dart';
@JsonSerializable()
class User {
final String? email;
final String? gender;
final String? region;
final String? country;
final String? occupation;
final bool? userInfoLoaded;
@JsonKey(name: 'user_id')
final int? userId;
@JsonKey(name: 'last_name')
final String? lastName;
@JsonKey(name: 'birth_day')
final String? birthday;
@JsonKey(name: 'first_name')
final String? firstName;
@JsonKey(name: 'access_token')
final String? accessToken;
@JsonKey(name: 'refresh_token')
final String? refreshToken;
@JsonKey(name: 'profile_completed')
final bool? profileCompleted;
@JsonKey(name: 'profile_picture_url')
final String? profilePicture;
const User({
this.email,
this.region,
this.gender,
this.userId,
this.country,
this.lastName,
this.birthday,
this.firstName,
this.occupation,
this.accessToken,
this.refreshToken,
this.profilePicture,
this.userInfoLoaded,
this.profileCompleted,
});
User copyWith(
{int? userId,
String? email,
String? gender,
String? region,
String? country,
String? lastName,
String? birthday,
String? firstName,
String? occupation,
String? accessToken,
String? refreshToken,
bool? userInfoLoaded,
bool? profileCompleted,
String? profilePicture}) =>
User(
email: email ?? this.email,
userId: userId ?? this.userId,
gender: gender ?? this.gender,
region: region ?? this.region,
country: country ?? this.country,
lastName: lastName ?? this.lastName,
birthday: birthday ?? this.birthday,
firstName: firstName ?? this.firstName,
occupation: occupation ?? this.occupation,
accessToken: accessToken ?? this.accessToken,
refreshToken: refreshToken ?? this.refreshToken,
userInfoLoaded: userInfoLoaded ?? this.userInfoLoaded,
profilePicture: profilePicture ?? this.profilePicture,
profileCompleted: profileCompleted ?? this.profileCompleted);
factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
Map<String, dynamic> toJson() => _$UserToJson(this);
}