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.
This commit is contained in:
@@ -88,6 +88,11 @@ class _DesktopProfilePageState extends State<DesktopProfilePage> {
|
||||
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<DesktopProfilePage> {
|
||||
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(
|
||||
|
||||
@@ -91,6 +91,10 @@ class _MobileProfilePageState extends State<MobileProfilePage> {
|
||||
),
|
||||
|
||||
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<MobileProfilePage> {
|
||||
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(
|
||||
|
||||
@@ -85,6 +85,10 @@ class _TabletProfilePageState extends State<TabletProfilePage> {
|
||||
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<TabletProfilePage> {
|
||||
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,
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user