Refactor profile data handling and update UI components

- Changed references from companyProfileData to profileData across multiple profile page views for consistency.
- Updated UI elements to display user-specific information such as username, email, role, department, and position.
- Modified the profile screen to fetch user profile data instead of company profile data.
- Added new string constants for user-related fields in ProfileStrings.
This commit is contained in:
amirrezaghabeli
2025-11-20 17:33:30 +03:30
parent 64a1c30e6c
commit d01e028dc1
6 changed files with 76 additions and 52 deletions
+35 -15
View File
@@ -62,7 +62,7 @@ class _TabletProfilePageState extends State<TabletProfilePage> {
return Center(child: Text(viewModel.errorMessage!));
}
if (viewModel.companyProfileData == null) {
if (viewModel.profileData == null) {
return const Center(child: Text(CommonStrings.noData));
}
@@ -86,27 +86,47 @@ class _TabletProfilePageState extends State<TabletProfilePage> {
children: [
SizedBox(height: 128.0.h()),
TitleDescription(
title: ProfileStrings.companyName,
description: viewModel.companyProfileData!.name!,
title: ProfileStrings.username,
description: viewModel.profileData!.username ?? '',
),
TitleDescription(
title: ProfileStrings.nationalId,
description: viewModel.companyProfileData!.id!,
title: ProfileStrings.email,
description: viewModel.profileData!.email ?? '',
),
TitleDescription(
title: ProfileStrings.registrationNumber,
description:
viewModel.companyProfileData!.registrationNumber!,
),
const TitleDescription(
title: ProfileStrings.businessType,
description: '-',
title: ProfileStrings.role,
description: viewModel.profileData!.role ?? '',
),
TitleDescription(
title: ProfileStrings.founded,
description:
viewModel.companyProfileData!.foundedYear!.toString(),
title: ProfileStrings.department,
description: viewModel.profileData!.department ?? '',
),
TitleDescription(
title: ProfileStrings.position,
description: viewModel.profileData!.position ?? '',
),
// TitleDescription(
// title: ProfileStrings.companyName,
// description: viewModel.companyProfileData!.name!,
// ),
// TitleDescription(
// title: ProfileStrings.nationalId,
// description: viewModel.companyProfileData!.id!,
// ),
// TitleDescription(
// title: ProfileStrings.registrationNumber,
// description:
// viewModel.companyProfileData!.registrationNumber!,
// ),
// const TitleDescription(
// title: ProfileStrings.businessType,
// description: '-',
// ),
// TitleDescription(
// title: ProfileStrings.founded,
// description:
// viewModel.companyProfileData!.foundedYear!.toString(),
// ),
SizedBox(height: 24.0.h()),
// Theme Toggle
Align(