feat: Update Tenant model to use Industry and TenantStatus objects and improve industry display in TenantCard
This commit is contained in:
parent
efb5564fcb
commit
17c7b9f10d
@ -7,8 +7,8 @@ class Tenant {
|
||||
final String contactNumber;
|
||||
final String? logoImage;
|
||||
final String? organizationSize;
|
||||
final String? industry;
|
||||
final String? tenantStatus;
|
||||
final Industry? industry;
|
||||
final TenantStatus? tenantStatus;
|
||||
|
||||
Tenant({
|
||||
required this.id,
|
||||
@ -34,9 +34,46 @@ class Tenant {
|
||||
logoImage: json['logoImage'] is String ? json['logoImage'] : null,
|
||||
organizationSize:
|
||||
json['organizationSize'] is String ? json['organizationSize'] : null,
|
||||
industry: json['industry'] is String ? json['industry'] : null,
|
||||
tenantStatus:
|
||||
json['tenantStatus'] is String ? json['tenantStatus'] : null,
|
||||
industry: json['industry'] != null
|
||||
? Industry.fromJson(json['industry'])
|
||||
: null,
|
||||
tenantStatus: json['tenantStatus'] != null
|
||||
? TenantStatus.fromJson(json['tenantStatus'])
|
||||
: null,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class Industry {
|
||||
final String id;
|
||||
final String name;
|
||||
|
||||
Industry({
|
||||
required this.id,
|
||||
required this.name,
|
||||
});
|
||||
|
||||
factory Industry.fromJson(Map<String, dynamic> json) {
|
||||
return Industry(
|
||||
id: json['id'] ?? '',
|
||||
name: json['name'] ?? '',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class TenantStatus {
|
||||
final String id;
|
||||
final String name;
|
||||
|
||||
TenantStatus({
|
||||
required this.id,
|
||||
required this.name,
|
||||
});
|
||||
|
||||
factory TenantStatus.fromJson(Map<String, dynamic> json) {
|
||||
return TenantStatus(
|
||||
id: json['id'] ?? '',
|
||||
name: json['name'] ?? '',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -223,7 +223,8 @@ class TenantCardList extends StatelessWidget {
|
||||
const SizedBox(height: 16),
|
||||
TextButton.icon(
|
||||
onPressed: () => Get.back(),
|
||||
icon: const Icon(Icons.arrow_back, size: 20, color: Colors.redAccent),
|
||||
icon: const Icon(Icons.arrow_back,
|
||||
size: 20, color: Colors.redAccent),
|
||||
label: MyText(
|
||||
'Back to Login',
|
||||
color: Colors.red,
|
||||
@ -278,7 +279,7 @@ class _TenantCard extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
MyText(
|
||||
"Industry: ${tenant.industry != null && tenant.industry!.isNotEmpty ? tenant.industry! : "-"}",
|
||||
"Industry: ${tenant.industry?.name ?? "-"}",
|
||||
fontSize: 13,
|
||||
color: Colors.black54,
|
||||
),
|
||||
|
Loading…
x
Reference in New Issue
Block a user