a5b01ffac4
- 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.
33 lines
1.1 KiB
Dart
33 lines
1.1 KiB
Dart
// ignore_for_file: invalid_annotation_target
|
|
|
|
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';
|
|
|
|
@freezed
|
|
abstract class ProfileData with _$ProfileData {
|
|
const factory ProfileData({
|
|
required String? id,
|
|
@JsonKey(name: 'full_name') required String? fullName,
|
|
required String? username,
|
|
required String? email,
|
|
required String? role,
|
|
required String? status,
|
|
required String? department,
|
|
required String? position,
|
|
required String? phone,
|
|
required List<CompanyProfileData>? companies,
|
|
@JsonKey(name: 'profile_image') required String? profileImage,
|
|
@JsonKey(name: 'is_verified') required bool? isVerified,
|
|
@JsonKey(name: 'last_login_at') required int? lastLoginAt,
|
|
@JsonKey(name: 'created_at') required int? createdAt,
|
|
@JsonKey(name: 'updated_at') required int? updatedAt,
|
|
}) = _ProfileData;
|
|
|
|
factory ProfileData.fromJson(Map<String, Object?> json) =>
|
|
_$ProfileDataFromJson(json);
|
|
}
|