Initial commit — DLS lab-app Flutter project

This commit is contained in:
egecankomur
2026-06-10 23:22:15 +03:00
commit d1acc1d367
225 changed files with 31294 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
class ProstheticProduct {
const ProstheticProduct({
required this.id,
required this.labTenantId,
required this.name,
required this.prostheticType,
this.unitPrice,
this.currency,
this.isActive = true,
this.description,
});
final String id;
final String labTenantId;
final String name;
final String prostheticType;
final double? unitPrice;
final String? currency;
final bool isActive;
final String? description;
factory ProstheticProduct.fromJson(Map<String, dynamic> j) {
String? _str(dynamic v) { final s = v as String?; return (s == null || s.isEmpty) ? null : s; }
return ProstheticProduct(
id: j['id'] as String,
labTenantId: j['lab_tenant_id'] as String,
name: j['name'] as String,
prostheticType: j['prosthetic_type'] as String,
unitPrice: (j['unit_price'] as num?)?.toDouble(),
currency: j['currency'] as String? ?? 'TRY',
isActive: j['is_active'] as bool? ?? true,
description: _str(j['description']),
);
}
Map<String, dynamic> toJson() => {
'lab_tenant_id': labTenantId,
'name': name,
'prosthetic_type': prostheticType,
if (unitPrice != null) 'unit_price': unitPrice,
'currency': currency ?? 'TRY',
'is_active': isActive,
if (description != null) 'description': description,
};
}