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 contactNumber;
|
||||||
final String? logoImage;
|
final String? logoImage;
|
||||||
final String? organizationSize;
|
final String? organizationSize;
|
||||||
final String? industry;
|
final Industry? industry;
|
||||||
final String? tenantStatus;
|
final TenantStatus? tenantStatus;
|
||||||
|
|
||||||
Tenant({
|
Tenant({
|
||||||
required this.id,
|
required this.id,
|
||||||
@ -34,9 +34,46 @@ class Tenant {
|
|||||||
logoImage: json['logoImage'] is String ? json['logoImage'] : null,
|
logoImage: json['logoImage'] is String ? json['logoImage'] : null,
|
||||||
organizationSize:
|
organizationSize:
|
||||||
json['organizationSize'] is String ? json['organizationSize'] : null,
|
json['organizationSize'] is String ? json['organizationSize'] : null,
|
||||||
industry: json['industry'] is String ? json['industry'] : null,
|
industry: json['industry'] != null
|
||||||
tenantStatus:
|
? Industry.fromJson(json['industry'])
|
||||||
json['tenantStatus'] is String ? json['tenantStatus'] : null,
|
: 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),
|
const SizedBox(height: 16),
|
||||||
TextButton.icon(
|
TextButton.icon(
|
||||||
onPressed: () => Get.back(),
|
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(
|
label: MyText(
|
||||||
'Back to Login',
|
'Back to Login',
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
@ -278,7 +279,7 @@ class _TenantCard extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 6),
|
const SizedBox(height: 6),
|
||||||
MyText(
|
MyText(
|
||||||
"Industry: ${tenant.industry != null && tenant.industry!.isNotEmpty ? tenant.industry! : "-"}",
|
"Industry: ${tenant.industry?.name ?? "-"}",
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
color: Colors.black54,
|
color: Colors.black54,
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user