From a5b01ffac47091b31259080171c846cf00c754b2 Mon Sep 17 00:00:00 2001 From: amirrezaghabeli Date: Sun, 23 Nov 2025 10:47:51 +0330 Subject: [PATCH] Update ProfileData model to include companies and enhance profile UI - Added a new field for companies in the ProfileData model to store associated company information. - Updated JSON serialization methods to handle the new companies field. - Modified profile page views to display the user's full name and company name, replacing previous role and department fields for improved clarity. - Introduced new string constants for full name and phone in ProfileStrings. --- .../model/profile_data/profile_data.dart | 3 ++ .../profile_data/profile_data.freezed.dart | 51 +++++++++++-------- .../model/profile_data/profile_data.g.dart | 5 ++ lib/views/profile/pages/d_profile_page.dart | 24 +++++---- lib/views/profile/pages/m_profile_page.dart | 17 ++++--- lib/views/profile/pages/t_profile_page.dart | 17 ++++--- .../profile/strings/profile_strings.dart | 2 + 7 files changed, 74 insertions(+), 45 deletions(-) diff --git a/lib/data/services/model/profile_data/profile_data.dart b/lib/data/services/model/profile_data/profile_data.dart index aa48665..7fe2fd7 100644 --- a/lib/data/services/model/profile_data/profile_data.dart +++ b/lib/data/services/model/profile_data/profile_data.dart @@ -2,6 +2,8 @@ import 'package:freezed_annotation/freezed_annotation.dart'; +import '../company_profile_data/company_profile_data.dart'; + part 'profile_data.freezed.dart'; part 'profile_data.g.dart'; @@ -17,6 +19,7 @@ abstract class ProfileData with _$ProfileData { required String? department, required String? position, required String? phone, + required List? companies, @JsonKey(name: 'profile_image') required String? profileImage, @JsonKey(name: 'is_verified') required bool? isVerified, @JsonKey(name: 'last_login_at') required int? lastLoginAt, diff --git a/lib/data/services/model/profile_data/profile_data.freezed.dart b/lib/data/services/model/profile_data/profile_data.freezed.dart index 611d906..7c04a93 100644 --- a/lib/data/services/model/profile_data/profile_data.freezed.dart +++ b/lib/data/services/model/profile_data/profile_data.freezed.dart @@ -15,7 +15,7 @@ T _$identity(T value) => value; /// @nodoc mixin _$ProfileData { - String? get id;@JsonKey(name: 'full_name') String? get fullName; String? get username; String? get email; String? get role; String? get status; String? get department; String? get position; String? get phone;@JsonKey(name: 'profile_image') String? get profileImage;@JsonKey(name: 'is_verified') bool? get isVerified;@JsonKey(name: 'last_login_at') int? get lastLoginAt;@JsonKey(name: 'created_at') int? get createdAt;@JsonKey(name: 'updated_at') int? get updatedAt; + String? get id;@JsonKey(name: 'full_name') String? get fullName; String? get username; String? get email; String? get role; String? get status; String? get department; String? get position; String? get phone; List? get companies;@JsonKey(name: 'profile_image') String? get profileImage;@JsonKey(name: 'is_verified') bool? get isVerified;@JsonKey(name: 'last_login_at') int? get lastLoginAt;@JsonKey(name: 'created_at') int? get createdAt;@JsonKey(name: 'updated_at') int? get updatedAt; /// Create a copy of ProfileData /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -28,16 +28,16 @@ $ProfileDataCopyWith get copyWith => _$ProfileDataCopyWithImpl Object.hash(runtimeType,id,fullName,username,email,role,status,department,position,phone,profileImage,isVerified,lastLoginAt,createdAt,updatedAt); +int get hashCode => Object.hash(runtimeType,id,fullName,username,email,role,status,department,position,phone,const DeepCollectionEquality().hash(companies),profileImage,isVerified,lastLoginAt,createdAt,updatedAt); @override String toString() { - return 'ProfileData(id: $id, fullName: $fullName, username: $username, email: $email, role: $role, status: $status, department: $department, position: $position, phone: $phone, profileImage: $profileImage, isVerified: $isVerified, lastLoginAt: $lastLoginAt, createdAt: $createdAt, updatedAt: $updatedAt)'; + return 'ProfileData(id: $id, fullName: $fullName, username: $username, email: $email, role: $role, status: $status, department: $department, position: $position, phone: $phone, companies: $companies, profileImage: $profileImage, isVerified: $isVerified, lastLoginAt: $lastLoginAt, createdAt: $createdAt, updatedAt: $updatedAt)'; } @@ -48,7 +48,7 @@ abstract mixin class $ProfileDataCopyWith<$Res> { factory $ProfileDataCopyWith(ProfileData value, $Res Function(ProfileData) _then) = _$ProfileDataCopyWithImpl; @useResult $Res call({ - String? id,@JsonKey(name: 'full_name') String? fullName, String? username, String? email, String? role, String? status, String? department, String? position, String? phone,@JsonKey(name: 'profile_image') String? profileImage,@JsonKey(name: 'is_verified') bool? isVerified,@JsonKey(name: 'last_login_at') int? lastLoginAt,@JsonKey(name: 'created_at') int? createdAt,@JsonKey(name: 'updated_at') int? updatedAt + String? id,@JsonKey(name: 'full_name') String? fullName, String? username, String? email, String? role, String? status, String? department, String? position, String? phone, List? companies,@JsonKey(name: 'profile_image') String? profileImage,@JsonKey(name: 'is_verified') bool? isVerified,@JsonKey(name: 'last_login_at') int? lastLoginAt,@JsonKey(name: 'created_at') int? createdAt,@JsonKey(name: 'updated_at') int? updatedAt }); @@ -65,7 +65,7 @@ class _$ProfileDataCopyWithImpl<$Res> /// Create a copy of ProfileData /// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? fullName = freezed,Object? username = freezed,Object? email = freezed,Object? role = freezed,Object? status = freezed,Object? department = freezed,Object? position = freezed,Object? phone = freezed,Object? profileImage = freezed,Object? isVerified = freezed,Object? lastLoginAt = freezed,Object? createdAt = freezed,Object? updatedAt = freezed,}) { +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? fullName = freezed,Object? username = freezed,Object? email = freezed,Object? role = freezed,Object? status = freezed,Object? department = freezed,Object? position = freezed,Object? phone = freezed,Object? companies = freezed,Object? profileImage = freezed,Object? isVerified = freezed,Object? lastLoginAt = freezed,Object? createdAt = freezed,Object? updatedAt = freezed,}) { return _then(_self.copyWith( id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable as String?,fullName: freezed == fullName ? _self.fullName : fullName // ignore: cast_nullable_to_non_nullable @@ -76,7 +76,8 @@ as String?,status: freezed == status ? _self.status : status // ignore: cast_nul as String?,department: freezed == department ? _self.department : department // ignore: cast_nullable_to_non_nullable as String?,position: freezed == position ? _self.position : position // ignore: cast_nullable_to_non_nullable as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable -as String?,profileImage: freezed == profileImage ? _self.profileImage : profileImage // ignore: cast_nullable_to_non_nullable +as String?,companies: freezed == companies ? _self.companies : companies // ignore: cast_nullable_to_non_nullable +as List?,profileImage: freezed == profileImage ? _self.profileImage : profileImage // ignore: cast_nullable_to_non_nullable as String?,isVerified: freezed == isVerified ? _self.isVerified : isVerified // ignore: cast_nullable_to_non_nullable as bool?,lastLoginAt: freezed == lastLoginAt ? _self.lastLoginAt : lastLoginAt // ignore: cast_nullable_to_non_nullable as int?,createdAt: freezed == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable @@ -166,10 +167,10 @@ return $default(_that);case _: /// } /// ``` -@optionalTypeArgs TResult maybeWhen(TResult Function( String? id, @JsonKey(name: 'full_name') String? fullName, String? username, String? email, String? role, String? status, String? department, String? position, String? phone, @JsonKey(name: 'profile_image') String? profileImage, @JsonKey(name: 'is_verified') bool? isVerified, @JsonKey(name: 'last_login_at') int? lastLoginAt, @JsonKey(name: 'created_at') int? createdAt, @JsonKey(name: 'updated_at') int? updatedAt)? $default,{required TResult orElse(),}) {final _that = this; +@optionalTypeArgs TResult maybeWhen(TResult Function( String? id, @JsonKey(name: 'full_name') String? fullName, String? username, String? email, String? role, String? status, String? department, String? position, String? phone, List? companies, @JsonKey(name: 'profile_image') String? profileImage, @JsonKey(name: 'is_verified') bool? isVerified, @JsonKey(name: 'last_login_at') int? lastLoginAt, @JsonKey(name: 'created_at') int? createdAt, @JsonKey(name: 'updated_at') int? updatedAt)? $default,{required TResult orElse(),}) {final _that = this; switch (_that) { case _ProfileData() when $default != null: -return $default(_that.id,_that.fullName,_that.username,_that.email,_that.role,_that.status,_that.department,_that.position,_that.phone,_that.profileImage,_that.isVerified,_that.lastLoginAt,_that.createdAt,_that.updatedAt);case _: +return $default(_that.id,_that.fullName,_that.username,_that.email,_that.role,_that.status,_that.department,_that.position,_that.phone,_that.companies,_that.profileImage,_that.isVerified,_that.lastLoginAt,_that.createdAt,_that.updatedAt);case _: return orElse(); } @@ -187,10 +188,10 @@ return $default(_that.id,_that.fullName,_that.username,_that.email,_that.role,_t /// } /// ``` -@optionalTypeArgs TResult when(TResult Function( String? id, @JsonKey(name: 'full_name') String? fullName, String? username, String? email, String? role, String? status, String? department, String? position, String? phone, @JsonKey(name: 'profile_image') String? profileImage, @JsonKey(name: 'is_verified') bool? isVerified, @JsonKey(name: 'last_login_at') int? lastLoginAt, @JsonKey(name: 'created_at') int? createdAt, @JsonKey(name: 'updated_at') int? updatedAt) $default,) {final _that = this; +@optionalTypeArgs TResult when(TResult Function( String? id, @JsonKey(name: 'full_name') String? fullName, String? username, String? email, String? role, String? status, String? department, String? position, String? phone, List? companies, @JsonKey(name: 'profile_image') String? profileImage, @JsonKey(name: 'is_verified') bool? isVerified, @JsonKey(name: 'last_login_at') int? lastLoginAt, @JsonKey(name: 'created_at') int? createdAt, @JsonKey(name: 'updated_at') int? updatedAt) $default,) {final _that = this; switch (_that) { case _ProfileData(): -return $default(_that.id,_that.fullName,_that.username,_that.email,_that.role,_that.status,_that.department,_that.position,_that.phone,_that.profileImage,_that.isVerified,_that.lastLoginAt,_that.createdAt,_that.updatedAt);case _: +return $default(_that.id,_that.fullName,_that.username,_that.email,_that.role,_that.status,_that.department,_that.position,_that.phone,_that.companies,_that.profileImage,_that.isVerified,_that.lastLoginAt,_that.createdAt,_that.updatedAt);case _: throw StateError('Unexpected subclass'); } @@ -207,10 +208,10 @@ return $default(_that.id,_that.fullName,_that.username,_that.email,_that.role,_t /// } /// ``` -@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? id, @JsonKey(name: 'full_name') String? fullName, String? username, String? email, String? role, String? status, String? department, String? position, String? phone, @JsonKey(name: 'profile_image') String? profileImage, @JsonKey(name: 'is_verified') bool? isVerified, @JsonKey(name: 'last_login_at') int? lastLoginAt, @JsonKey(name: 'created_at') int? createdAt, @JsonKey(name: 'updated_at') int? updatedAt)? $default,) {final _that = this; +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? id, @JsonKey(name: 'full_name') String? fullName, String? username, String? email, String? role, String? status, String? department, String? position, String? phone, List? companies, @JsonKey(name: 'profile_image') String? profileImage, @JsonKey(name: 'is_verified') bool? isVerified, @JsonKey(name: 'last_login_at') int? lastLoginAt, @JsonKey(name: 'created_at') int? createdAt, @JsonKey(name: 'updated_at') int? updatedAt)? $default,) {final _that = this; switch (_that) { case _ProfileData() when $default != null: -return $default(_that.id,_that.fullName,_that.username,_that.email,_that.role,_that.status,_that.department,_that.position,_that.phone,_that.profileImage,_that.isVerified,_that.lastLoginAt,_that.createdAt,_that.updatedAt);case _: +return $default(_that.id,_that.fullName,_that.username,_that.email,_that.role,_that.status,_that.department,_that.position,_that.phone,_that.companies,_that.profileImage,_that.isVerified,_that.lastLoginAt,_that.createdAt,_that.updatedAt);case _: return null; } @@ -222,7 +223,7 @@ return $default(_that.id,_that.fullName,_that.username,_that.email,_that.role,_t @JsonSerializable() class _ProfileData implements ProfileData { - const _ProfileData({required this.id, @JsonKey(name: 'full_name') required this.fullName, required this.username, required this.email, required this.role, required this.status, required this.department, required this.position, required this.phone, @JsonKey(name: 'profile_image') required this.profileImage, @JsonKey(name: 'is_verified') required this.isVerified, @JsonKey(name: 'last_login_at') required this.lastLoginAt, @JsonKey(name: 'created_at') required this.createdAt, @JsonKey(name: 'updated_at') required this.updatedAt}); + const _ProfileData({required this.id, @JsonKey(name: 'full_name') required this.fullName, required this.username, required this.email, required this.role, required this.status, required this.department, required this.position, required this.phone, required final List? companies, @JsonKey(name: 'profile_image') required this.profileImage, @JsonKey(name: 'is_verified') required this.isVerified, @JsonKey(name: 'last_login_at') required this.lastLoginAt, @JsonKey(name: 'created_at') required this.createdAt, @JsonKey(name: 'updated_at') required this.updatedAt}): _companies = companies; factory _ProfileData.fromJson(Map json) => _$ProfileDataFromJson(json); @override final String? id; @@ -234,6 +235,15 @@ class _ProfileData implements ProfileData { @override final String? department; @override final String? position; @override final String? phone; + final List? _companies; +@override List? get companies { + final value = _companies; + if (value == null) return null; + if (_companies is EqualUnmodifiableListView) return _companies; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + @override@JsonKey(name: 'profile_image') final String? profileImage; @override@JsonKey(name: 'is_verified') final bool? isVerified; @override@JsonKey(name: 'last_login_at') final int? lastLoginAt; @@ -253,16 +263,16 @@ Map toJson() { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _ProfileData&&(identical(other.id, id) || other.id == id)&&(identical(other.fullName, fullName) || other.fullName == fullName)&&(identical(other.username, username) || other.username == username)&&(identical(other.email, email) || other.email == email)&&(identical(other.role, role) || other.role == role)&&(identical(other.status, status) || other.status == status)&&(identical(other.department, department) || other.department == department)&&(identical(other.position, position) || other.position == position)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.profileImage, profileImage) || other.profileImage == profileImage)&&(identical(other.isVerified, isVerified) || other.isVerified == isVerified)&&(identical(other.lastLoginAt, lastLoginAt) || other.lastLoginAt == lastLoginAt)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)); + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ProfileData&&(identical(other.id, id) || other.id == id)&&(identical(other.fullName, fullName) || other.fullName == fullName)&&(identical(other.username, username) || other.username == username)&&(identical(other.email, email) || other.email == email)&&(identical(other.role, role) || other.role == role)&&(identical(other.status, status) || other.status == status)&&(identical(other.department, department) || other.department == department)&&(identical(other.position, position) || other.position == position)&&(identical(other.phone, phone) || other.phone == phone)&&const DeepCollectionEquality().equals(other._companies, _companies)&&(identical(other.profileImage, profileImage) || other.profileImage == profileImage)&&(identical(other.isVerified, isVerified) || other.isVerified == isVerified)&&(identical(other.lastLoginAt, lastLoginAt) || other.lastLoginAt == lastLoginAt)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override -int get hashCode => Object.hash(runtimeType,id,fullName,username,email,role,status,department,position,phone,profileImage,isVerified,lastLoginAt,createdAt,updatedAt); +int get hashCode => Object.hash(runtimeType,id,fullName,username,email,role,status,department,position,phone,const DeepCollectionEquality().hash(_companies),profileImage,isVerified,lastLoginAt,createdAt,updatedAt); @override String toString() { - return 'ProfileData(id: $id, fullName: $fullName, username: $username, email: $email, role: $role, status: $status, department: $department, position: $position, phone: $phone, profileImage: $profileImage, isVerified: $isVerified, lastLoginAt: $lastLoginAt, createdAt: $createdAt, updatedAt: $updatedAt)'; + return 'ProfileData(id: $id, fullName: $fullName, username: $username, email: $email, role: $role, status: $status, department: $department, position: $position, phone: $phone, companies: $companies, profileImage: $profileImage, isVerified: $isVerified, lastLoginAt: $lastLoginAt, createdAt: $createdAt, updatedAt: $updatedAt)'; } @@ -273,7 +283,7 @@ abstract mixin class _$ProfileDataCopyWith<$Res> implements $ProfileDataCopyWith factory _$ProfileDataCopyWith(_ProfileData value, $Res Function(_ProfileData) _then) = __$ProfileDataCopyWithImpl; @override @useResult $Res call({ - String? id,@JsonKey(name: 'full_name') String? fullName, String? username, String? email, String? role, String? status, String? department, String? position, String? phone,@JsonKey(name: 'profile_image') String? profileImage,@JsonKey(name: 'is_verified') bool? isVerified,@JsonKey(name: 'last_login_at') int? lastLoginAt,@JsonKey(name: 'created_at') int? createdAt,@JsonKey(name: 'updated_at') int? updatedAt + String? id,@JsonKey(name: 'full_name') String? fullName, String? username, String? email, String? role, String? status, String? department, String? position, String? phone, List? companies,@JsonKey(name: 'profile_image') String? profileImage,@JsonKey(name: 'is_verified') bool? isVerified,@JsonKey(name: 'last_login_at') int? lastLoginAt,@JsonKey(name: 'created_at') int? createdAt,@JsonKey(name: 'updated_at') int? updatedAt }); @@ -290,7 +300,7 @@ class __$ProfileDataCopyWithImpl<$Res> /// Create a copy of ProfileData /// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? fullName = freezed,Object? username = freezed,Object? email = freezed,Object? role = freezed,Object? status = freezed,Object? department = freezed,Object? position = freezed,Object? phone = freezed,Object? profileImage = freezed,Object? isVerified = freezed,Object? lastLoginAt = freezed,Object? createdAt = freezed,Object? updatedAt = freezed,}) { +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? fullName = freezed,Object? username = freezed,Object? email = freezed,Object? role = freezed,Object? status = freezed,Object? department = freezed,Object? position = freezed,Object? phone = freezed,Object? companies = freezed,Object? profileImage = freezed,Object? isVerified = freezed,Object? lastLoginAt = freezed,Object? createdAt = freezed,Object? updatedAt = freezed,}) { return _then(_ProfileData( id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable as String?,fullName: freezed == fullName ? _self.fullName : fullName // ignore: cast_nullable_to_non_nullable @@ -301,7 +311,8 @@ as String?,status: freezed == status ? _self.status : status // ignore: cast_nul as String?,department: freezed == department ? _self.department : department // ignore: cast_nullable_to_non_nullable as String?,position: freezed == position ? _self.position : position // ignore: cast_nullable_to_non_nullable as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable -as String?,profileImage: freezed == profileImage ? _self.profileImage : profileImage // ignore: cast_nullable_to_non_nullable +as String?,companies: freezed == companies ? _self._companies : companies // ignore: cast_nullable_to_non_nullable +as List?,profileImage: freezed == profileImage ? _self.profileImage : profileImage // ignore: cast_nullable_to_non_nullable as String?,isVerified: freezed == isVerified ? _self.isVerified : isVerified // ignore: cast_nullable_to_non_nullable as bool?,lastLoginAt: freezed == lastLoginAt ? _self.lastLoginAt : lastLoginAt // ignore: cast_nullable_to_non_nullable as int?,createdAt: freezed == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable diff --git a/lib/data/services/model/profile_data/profile_data.g.dart b/lib/data/services/model/profile_data/profile_data.g.dart index 2a69bda..30cfd4b 100644 --- a/lib/data/services/model/profile_data/profile_data.g.dart +++ b/lib/data/services/model/profile_data/profile_data.g.dart @@ -16,6 +16,10 @@ _ProfileData _$ProfileDataFromJson(Map json) => _ProfileData( department: json['department'] as String?, position: json['position'] as String?, phone: json['phone'] as String?, + companies: + (json['companies'] as List?) + ?.map((e) => CompanyProfileData.fromJson(e as Map)) + .toList(), profileImage: json['profile_image'] as String?, isVerified: json['is_verified'] as bool?, lastLoginAt: (json['last_login_at'] as num?)?.toInt(), @@ -34,6 +38,7 @@ Map _$ProfileDataToJson(_ProfileData instance) => 'department': instance.department, 'position': instance.position, 'phone': instance.phone, + 'companies': instance.companies, 'profile_image': instance.profileImage, 'is_verified': instance.isVerified, 'last_login_at': instance.lastLoginAt, diff --git a/lib/views/profile/pages/d_profile_page.dart b/lib/views/profile/pages/d_profile_page.dart index d8a4f64..0403d93 100644 --- a/lib/views/profile/pages/d_profile_page.dart +++ b/lib/views/profile/pages/d_profile_page.dart @@ -88,6 +88,11 @@ class _DesktopProfilePageState extends State { child: Column( children: [ SizedBox(height: 36.0.h()), + TitleDescription( + title: ProfileStrings.fullname, + description: + viewModel.profileData!.fullName ?? '', + ), TitleDescription( title: ProfileStrings.username, description: @@ -98,19 +103,20 @@ class _DesktopProfilePageState extends State { description: viewModel.profileData!.email ?? '', ), TitleDescription( - title: ProfileStrings.role, - description: viewModel.profileData!.role ?? '', + title: ProfileStrings.phone, + description: viewModel.profileData!.phone ?? '', ), TitleDescription( - title: ProfileStrings.department, + title: ProfileStrings.companyName, description: - viewModel.profileData!.department ?? '', - ), - TitleDescription( - title: ProfileStrings.position, - description: - viewModel.profileData!.position ?? '', + viewModel + .profileData! + .companies! + .first + .name ?? + '', ), + SizedBox(height: 24.0.h()), // Theme Toggle Align( diff --git a/lib/views/profile/pages/m_profile_page.dart b/lib/views/profile/pages/m_profile_page.dart index e789b5d..6ea0337 100644 --- a/lib/views/profile/pages/m_profile_page.dart +++ b/lib/views/profile/pages/m_profile_page.dart @@ -91,6 +91,10 @@ class _MobileProfilePageState extends State { ), SizedBox(height: 24.0.h()), + TitleDescription( + title: ProfileStrings.fullname, + description: viewModel.profileData!.fullName ?? '', + ), TitleDescription( title: ProfileStrings.username, description: viewModel.profileData!.username ?? '', @@ -100,16 +104,13 @@ class _MobileProfilePageState extends State { description: viewModel.profileData!.email ?? '', ), TitleDescription( - title: ProfileStrings.role, - description: viewModel.profileData!.role ?? '', + title: ProfileStrings.phone, + description: viewModel.profileData!.phone ?? '', ), TitleDescription( - title: ProfileStrings.department, - description: viewModel.profileData!.department ?? '', - ), - TitleDescription( - title: ProfileStrings.position, - description: viewModel.profileData!.position ?? '', + title: ProfileStrings.companyName, + description: + viewModel.profileData!.companies!.first.name ?? '', ), SizedBox(height: 32.0.h()), Align( diff --git a/lib/views/profile/pages/t_profile_page.dart b/lib/views/profile/pages/t_profile_page.dart index ecfb3a0..ab3e8fe 100644 --- a/lib/views/profile/pages/t_profile_page.dart +++ b/lib/views/profile/pages/t_profile_page.dart @@ -85,6 +85,10 @@ class _TabletProfilePageState extends State { child: Column( children: [ SizedBox(height: 128.0.h()), + TitleDescription( + title: ProfileStrings.fullname, + description: viewModel.profileData!.fullName ?? '', + ), TitleDescription( title: ProfileStrings.username, description: viewModel.profileData!.username ?? '', @@ -94,16 +98,13 @@ class _TabletProfilePageState extends State { description: viewModel.profileData!.email ?? '', ), TitleDescription( - title: ProfileStrings.role, - description: viewModel.profileData!.role ?? '', + title: ProfileStrings.phone, + description: viewModel.profileData!.phone ?? '', ), TitleDescription( - title: ProfileStrings.department, - description: viewModel.profileData!.department ?? '', - ), - TitleDescription( - title: ProfileStrings.position, - description: viewModel.profileData!.position ?? '', + title: ProfileStrings.companyName, + description: + viewModel.profileData!.companies!.first.name ?? '', ), // TitleDescription( // title: ProfileStrings.companyName, diff --git a/lib/views/profile/strings/profile_strings.dart b/lib/views/profile/strings/profile_strings.dart index ea156e6..5baa79a 100644 --- a/lib/views/profile/strings/profile_strings.dart +++ b/lib/views/profile/strings/profile_strings.dart @@ -18,4 +18,6 @@ class ProfileStrings { static const String role = 'role'; static const String department = 'department'; static const String position = 'position'; + static const String phone = 'phone'; + static const String fullname = 'full name'; }