19 lines
563 B
Dart
19 lines
563 B
Dart
import '../../domain/entities/user_entity.dart';
|
|
|
|
/// مدلِ دادهی کاربر؛ از JSON ساخته شده و به UserEntity نگاشت میشود.
|
|
class UserModel extends UserEntity {
|
|
const UserModel({
|
|
required super.id,
|
|
required super.mobile,
|
|
super.firstName,
|
|
super.avatar,
|
|
});
|
|
|
|
factory UserModel.fromJson(Map<String, dynamic> j) => UserModel(
|
|
id: (j['id'] ?? 0) as int,
|
|
mobile: (j['mobile'] ?? '') as String,
|
|
firstName: j['first_name'] as String?,
|
|
avatar: j['avatar'] as String?,
|
|
);
|
|
}
|