1017import 'dart:convert';
1018import 'dart:developer';
1021import 'package:another_flushbar/flushbar.dart';
1022import 'package:connect/core/constants/assets.dart';
1023import 'package:connect/core/ui/widgets/custom_snackbar.dart';
1024import 'package:connect/core/utils/number_conversion.dart';
1025import 'package:flutter/material.dart';
1026import 'package:flutter/services.dart';
1027import 'package:flutter_screenutil/flutter_screenutil.dart';
1028import 'package:open_filex/open_filex.dart';
1029import 'package:path_provider/path_provider.dart';
1030import 'package:pdf/pdf.dart';
1031import 'package:pdf/widgets.dart' as pw;
1033import '../../../../../../../../../../core/api/api_client.dart';
1034import '../../../../../../../../../../core/services/service_locator.dart';
1037 required BuildContext context,
1038 required String collectionName,
1040 final data = await
fetchData(collectionName: collectionName);
1043 margin: EdgeInsets.all(10),
1044 borderRadius: BorderRadius.circular(10),
1046 message:
"E-Manifest generation failed. Please try again",
1047 duration: Duration(seconds: 2),
1052 final pdf = pw.Document();
1056 final Uint8List logoData = logoBytes.buffer.asUint8List();
1057 final pw.MemoryImage logoImage = pw.MemoryImage(logoData);
1060 String adaptStatus({required String status}) {
1072 final PdfColor headerBlue = PdfColor.fromInt(0xFF9DCDE7);
1075 final fontData = await rootBundle.load(
'assets/fonts/notokufi_font.ttf');
1076 final ttf = pw.Font.ttf(fontData);
1079 await rootBundle.load(
"assets/fonts/NotoKufiArabic-Bold.ttf");
1080 final boldFont = pw.Font.ttf(boldyFont);
1083 final theme = pw.ThemeData.withFont(
1087 boldItalic: boldFont,
1090 String _formatDate(DateTime? date) {
1091 if (date == null)
return '--';
1092 return '${date.day}/${date.month}/${date.year}';
1098 pageFormat: PdfPageFormat.a4,
1099 margin:
const pw.EdgeInsets.all(16),
1100 build: (context) => pw.Column(
1101 crossAxisAlignment: pw.CrossAxisAlignment.start,
1105 mainAxisAlignment: pw.MainAxisAlignment.spaceBetween,
1107 pw.Image(logoImage, width: 60, height: 60),
1109 crossAxisAlignment: pw.CrossAxisAlignment.center,
1112 'Waste Electronic Manifest',
1113 style: pw.TextStyle(
1115 fontWeight: pw.FontWeight.bold,
1120 style: pw.TextStyle(
1122 fontWeight: pw.FontWeight.bold,
1128 crossAxisAlignment: pw.CrossAxisAlignment.end,
1132 pw.Text(
'Document No. ',
1133 style: pw.TextStyle(fontSize: 10)),
1134 pw.Text(
'${data?.id}',
1136 pw.TextStyle(fontSize: 10,
color: PdfColors.red)),
1141 pw.Text(
'Status : ', style: pw.TextStyle(fontSize: 10)),
1142 pw.Text(
'${adaptStatus(status: data?.status ?? '')}',
1143 style: pw.TextStyle(fontSize: 10)),
1146 pw.SizedBox(height: 5),
1150 child: pw.BarcodeWidget(
1151 barcode: pw.Barcode.qrCode(),
1153 'WASTE E-MANIFEST - Document No: ${data?.id} - Status: ${adaptStatus(status: data?.status ?? '')} - origin: Aidra Connect',
1162 pw.SizedBox(height: 15),
1165 _buildSectionHeader(
1166 'Part - A : Waste Generator Information', headerBlue),
1168 border: pw.TableBorder.all(),
1170 0: pw.FlexColumnWidth(1),
1171 1: pw.FlexColumnWidth(1),
1172 2: pw.FlexColumnWidth(1.5),
1178 padding:
const pw.EdgeInsets.all(5),
1179 child: pw.Text(
'1.Generator ID. No',
1180 style: pw.TextStyle(fontSize: 10)),
1183 padding:
const pw.EdgeInsets.all(5),
1184 child: pw.Text(
'2. Generator\'s Name',
1185 style: pw.TextStyle(fontSize: 10)),
1188 padding:
const pw.EdgeInsets.all(5),
1190 '3. Generator\'s Address, Phone No.\nand Person To Contact',
1191 style: pw.TextStyle(fontSize: 10)),
1198 padding:
const pw.EdgeInsets.all(5),
1199 child: pw.Text(data?.partner?.internalCode ??
'',
1200 style: pw.TextStyle(fontSize: 9)),
1203 padding:
const pw.EdgeInsets.all(5),
1204 child: pw.Text(data?.partner?.name ??
'',
1205 style: pw.TextStyle(fontSize: 9)),
1208 padding:
const pw.EdgeInsets.all(5),
1210 '${data?.partner?.street ?? ''}\n${data?.partner?.phone ?? ''}\n${data?.partner?.contactName ?? ''}',
1211 style: pw.TextStyle(fontSize: 9),
1217 for (
int i = 0; i < 7; i++)
1220 pw.Container(height: 20),
1221 pw.Container(height: 20),
1222 pw.Container(height: 20),
1230 padding:
const pw.EdgeInsets.all(5),
1232 crossAxisAlignment: pw.CrossAxisAlignment.start,
1234 pw.Text(
'4. Transporter\'s Name :',
1235 style: pw.TextStyle(fontSize: 10)),
1237 padding:
const pw.EdgeInsets.only(left: 10),
1238 child: pw.Text(data?.company?.partner?.name ??
'',
1239 style: pw.TextStyle(fontSize: 9)),
1241 pw.SizedBox(height: 5),
1242 pw.Text(
' Mailing Address:',
1243 style: pw.TextStyle(fontSize: 10)),
1245 padding:
const pw.EdgeInsets.only(left: 10),
1246 child: pw.Text(data?.company?.partner?.street ??
'',
1247 style: pw.TextStyle(fontSize: 9)),
1249 pw.SizedBox(height: 5),
1254 crossAxisAlignment: pw.CrossAxisAlignment.start,
1256 pw.Text(
' Tel. No:',
1257 style: pw.TextStyle(fontSize: 10)),
1259 padding:
const pw.EdgeInsets.only(left: 10),
1260 child: pw.Text(data?.company?.partner?.phone ??
'',
1261 style: pw.TextStyle(fontSize: 9)),
1268 crossAxisAlignment: pw.CrossAxisAlignment.start,
1270 pw.Text(
' Person to Contact:',
1271 style: pw.TextStyle(fontSize: 10)),
1273 padding:
const pw.EdgeInsets.only(left: 10),
1275 data?.partner?.salesPerson?.partnerId?.name ??
1277 style: pw.TextStyle(fontSize: 9)),
1289 pw.SizedBox(height: 10),
1290 _buildShippingTable(data: data),
1294 padding:
const pw.EdgeInsets.all(8),
1295 decoration: pw.BoxDecoration(
1296 border: pw.Border.all(),
1299 crossAxisAlignment: pw.CrossAxisAlignment.start,
1302 '10. Generator\'s Certification: I hereby declare that the containers of this consignment are fully and accurately described above by proper shipping name and classified, packed, and labelled, and are in all respect in proper condition for transport by highway according to applicable laws and regulations of the Kingdom.',
1303 style: pw.TextStyle(fontSize: 9),
1305 pw.SizedBox(height: 10),
1307 mainAxisAlignment: pw.MainAxisAlignment.spaceBetween,
1310 crossAxisAlignment: pw.CrossAxisAlignment.start,
1312 pw.Text(
'Name of the Authorized Representative :',
1313 style: pw.TextStyle(fontSize: 9)),
1314 pw.SizedBox(height: 5),
1315 pw.Text(data?.partner?.contactName ??
'',
1316 style: pw.TextStyle(fontSize: 9)),
1317 pw.SizedBox(height: 10),
1318 pw.Text(
'Signature :',
1319 style: pw.TextStyle(fontSize: 9)),
1323 crossAxisAlignment: pw.CrossAxisAlignment.start,
1325 pw.Text(
'Date:', style: pw.TextStyle(fontSize: 9)),
1326 pw.SizedBox(height: 5),
1327 pw.Text(_formatDate(data?.collectionDate),
1328 style: pw.TextStyle(fontSize: 9)),
1345 pageFormat: PdfPageFormat.a4,
1346 margin:
const pw.EdgeInsets.all(16),
1347 build: (context) => pw.Column(
1348 crossAxisAlignment: pw.CrossAxisAlignment.start,
1352 mainAxisAlignment: pw.MainAxisAlignment.spaceBetween,
1354 pw.Image(logoImage, width: 60, height: 60),
1356 crossAxisAlignment: pw.CrossAxisAlignment.center,
1359 'Waste Electronic Manifest',
1360 style: pw.TextStyle(
1362 fontWeight: pw.FontWeight.bold,
1367 style: pw.TextStyle(
1369 fontWeight: pw.FontWeight.bold,
1375 crossAxisAlignment: pw.CrossAxisAlignment.end,
1379 pw.Text(
'Document No. ',
1380 style: pw.TextStyle(fontSize: 10)),
1381 pw.Text(
'${data?.id}',
1383 pw.TextStyle(fontSize: 10,
color: PdfColors.red)),
1388 pw.Text(
'Status : ', style: pw.TextStyle(fontSize: 10)),
1389 pw.Text(
'${adaptStatus(status: data?.status ?? '')}',
1390 style: pw.TextStyle(fontSize: 10)),
1393 pw.SizedBox(height: 5),
1397 child: pw.BarcodeWidget(
1398 barcode: pw.Barcode.qrCode(),
1400 'WASTE E-MANIFEST - Document No: ${data?.id} - Status: ${adaptStatus(status: data?.status ?? '')} - origin: Aidra Connect',
1409 pw.SizedBox(height: 15),
1412 _buildSectionHeader(
1413 'Part - B : Transporter Informations', headerBlue),
1415 decoration: pw.BoxDecoration(
1416 border: pw.Border.all(),
1418 padding:
const pw.EdgeInsets.all(8),
1420 crossAxisAlignment: pw.CrossAxisAlignment.start,
1423 '11. Transporter\'s Acknowledgement of Receipt of Materials',
1424 style: pw.TextStyle(fontSize: 10)),
1425 pw.SizedBox(height: 10),
1427 mainAxisAlignment: pw.MainAxisAlignment.spaceBetween,
1430 crossAxisAlignment: pw.CrossAxisAlignment.start,
1432 pw.Text(
'Driver Name:',
1433 style: pw.TextStyle(fontSize: 9)),
1434 pw.SizedBox(height: 5),
1435 pw.Text(data?.driver?.name ??
'',
1436 style: pw.TextStyle(fontSize: 9)),
1437 pw.SizedBox(height: 15),
1438 pw.Text(
'Signature of Drive:',
1439 style: pw.TextStyle(fontSize: 9)),
1443 crossAxisAlignment: pw.CrossAxisAlignment.start,
1447 pw.Text(
'Date:', style: pw.TextStyle(fontSize: 9)),
1448 pw.SizedBox(width: 10),
1451 data?.collectionVoucher?.confirmationDate),
1452 style: pw.TextStyle(fontSize: 9)),
1455 pw.SizedBox(height: 15),
1458 pw.Text(
'Vehicle Plate No:',
1459 style: pw.TextStyle(fontSize: 9)),
1460 pw.SizedBox(width: 10),
1461 pw.Text(data?.vehiclePlate ??
'',
1462 style: pw.TextStyle(fontSize: 9)),
1474 pw.SizedBox(height: 15),
1475 _buildSectionHeader(
1476 'Part - C : Warehouse Facility Information', headerBlue),
1478 decoration: pw.BoxDecoration(
1479 border: pw.Border.all(),
1484 width:
double.infinity,
1485 padding:
const pw.EdgeInsets.all(8),
1486 decoration: pw.BoxDecoration(
1487 border: pw.Border(bottom: pw.BorderSide()),
1489 child: pw.Text(
'12. Discrepancy Indication Space',
1490 style: pw.TextStyle(fontSize: 9)),
1493 padding:
const pw.EdgeInsets.all(8),
1495 crossAxisAlignment: pw.CrossAxisAlignment.start,
1501 '13. Facility Owner/Operator: certification of material covered by this manifest except as noted in item',
1502 style: pw.TextStyle(fontSize: 9),
1505 pw.SizedBox(width: 10),
1506 pw.Text(
'Date:', style: pw.TextStyle(fontSize: 9)),
1509 pw.SizedBox(height: 20),
1511 mainAxisAlignment: pw.MainAxisAlignment.spaceBetween,
1514 crossAxisAlignment: pw.CrossAxisAlignment.start,
1516 pw.Text(
'Receiver Name',
1517 style: pw.TextStyle(fontSize: 9)),
1521 crossAxisAlignment: pw.CrossAxisAlignment.start,
1523 pw.Text(
'Signature',
1524 style: pw.TextStyle(fontSize: 9)),
1539 alignment: pw.Alignment.bottomRight,
1541 'POWERED BY\nAidra Connect',
1542 style: pw.TextStyle(fontSize: 8,
color: PdfColors.grey),
1543 textAlign: pw.TextAlign.right,
1551 final output = await getTemporaryDirectory();
1552 final file = File(
'${output.path}/E-Manifest_$collectionName.pdf');
1553 await file.writeAsBytes(await pdf.save());
1555 OpenFilex.open(file.path);
1558pw.Widget _buildSectionHeader(String
title, PdfColor
color) {
1559 return pw.Container(
1560 width:
double.infinity,
1562 padding:
const pw.EdgeInsets.symmetric(vertical: 4, horizontal: 10),
1563 margin:
const pw.EdgeInsets.only(bottom: 5),
1566 style: pw.TextStyle(
1568 fontWeight: pw.FontWeight.bold,
1574pw.Widget _buildShippingTable({required MainifestEntity? data}) {
1576 border: pw.TableBorder.all(),
1578 0: pw.FlexColumnWidth(2),
1579 1: pw.FlexColumnWidth(1),
1580 2: pw.FlexColumnWidth(1),
1581 3: pw.FlexColumnWidth(1),
1582 4: pw.FlexColumnWidth(1),
1587 decoration: pw.BoxDecoration(
color: PdfColors.blue50),
1590 padding:
const pw.EdgeInsets.all(5),
1592 '5.(Shipping Name, Hazard Class, and PIN)',
1593 style: pw.TextStyle(fontSize: 9),
1599 alignment: pw.Alignment.center,
1600 padding:
const pw.EdgeInsets.all(5),
1601 decoration: pw.BoxDecoration(
1602 border: pw.Border(bottom: pw.BorderSide()),
1606 style: pw.TextStyle(fontSize: 9),
1612 child: pw.Container(
1613 alignment: pw.Alignment.center,
1614 padding:
const pw.EdgeInsets.all(5),
1615 decoration: pw.BoxDecoration(
1616 border: pw.Border(right: pw.BorderSide()),
1618 child: pw.Text(
'No.', style: pw.TextStyle(fontSize: 9)),
1622 child: pw.Container(
1623 alignment: pw.Alignment.center,
1624 padding:
const pw.EdgeInsets.all(5),
1625 child: pw.Text(
'Type', style: pw.TextStyle(fontSize: 9)),
1633 alignment: pw.Alignment.center,
1634 padding:
const pw.EdgeInsets.all(5),
1635 child: pw.Text(
'7.Total Qty', style: pw.TextStyle(fontSize: 9)),
1638 alignment: pw.Alignment.center,
1639 padding:
const pw.EdgeInsets.all(5),
1640 child: pw.Text(
'8.Unit Wt/Vol', style: pw.TextStyle(fontSize: 9)),
1643 alignment: pw.Alignment.center,
1644 padding:
const pw.EdgeInsets.all(5),
1645 child: pw.Text(
'9.WPS No.', style: pw.TextStyle(fontSize: 9)),
1653 padding:
const pw.EdgeInsets.all(5),
1654 child: pw.Text(extractName(data?.productName),
1655 style: pw.TextStyle(fontSize: 9)),
1660 child: pw.Container(
1661 alignment: pw.Alignment.center,
1662 padding:
const pw.EdgeInsets.all(5),
1663 decoration: pw.BoxDecoration(
1664 border: pw.Border(right: pw.BorderSide()),
1666 child: pw.Text(
'${data?.containerNumber ?? ""}',
1667 style: pw.TextStyle(fontSize: 9)),
1671 child: pw.Container(
1672 alignment: pw.Alignment.center,
1673 padding:
const pw.EdgeInsets.all(5),
1674 child: pw.Text(
'${data?.containerType ?? ""}',
1675 style: pw.TextStyle(fontSize: 9)),
1681 alignment: pw.Alignment.center,
1682 padding:
const pw.EdgeInsets.all(5),
1684 '${NumberConversionService.convertAndFormatWeight(data?.totalQuantity)}',
1685 style: pw.TextStyle(fontSize: 9)),
1688 alignment: pw.Alignment.center,
1689 padding:
const pw.EdgeInsets.all(5),
1690 child: pw.Text(
'Kg', style: pw.TextStyle(fontSize: 9)),
1693 alignment: pw.Alignment.center,
1694 padding:
const pw.EdgeInsets.all(5),
1695 child: pw.Text(
'', style: pw.TextStyle(fontSize: 9)),
1702 pw.Container(height: 25),
1706 child: pw.Container(
1708 decoration: pw.BoxDecoration(
1709 border: pw.Border(right: pw.BorderSide()),
1714 child: pw.Container(height: 25),
1718 pw.Container(height: 25),
1719 pw.Container(height: 25),
1720 pw.Container(height: 25),
1727String extractName(String? productName) {
1728 if (productName == null || productName.isEmpty) {
1733 final Map<String, dynamic> decoded = jsonDecode(productName);
1734 return decoded[
'en_US'] ??
'';
1740Future<MainifestEntity?>?
fetchData({required String collectionName}) async {
1743 final response = await apiClient.get(
1747 'https://dev-api.aidra.tech/document/ManifestDocument/$collectionName',
1749 if (response == {}) {
1752 log(response.toString());
1753 return MainifestEntity.fromJson(response);
1760class MainifestEntity {
1761 final DateTime? collectionDate;
1762 final CollectionVoucher? collectionVoucher;
1764 final String? containerNumber;
1765 final String? containerType;
1766 final Partner? driver;
1767 final String? generatorId;
1769 final Partner? partner;
1770 final String? productName;
1771 final String? status;
1772 final int? totalQuantity;
1774 final String? vehiclePlate;
1777 this.collectionDate,
1778 this.collectionVoucher,
1780 this.containerNumber,
1793 factory MainifestEntity.
fromJson(Map<String, dynamic> json) {
1794 return MainifestEntity(
1795 collectionDate: json[
'collectionDate'] != null
1796 ? DateTime.parse(json[
'collectionDate'])
1798 collectionVoucher: json[
'collectionVoucher'] != null
1799 ? CollectionVoucher.fromJson(json[
'collectionVoucher'])
1802 json[
'company'] != null ? Company.fromJson(json[
'company']) : null,
1803 containerNumber: json[
'containerNumber'],
1804 containerType: json[
'containerType'],
1805 driver: json[
'driver'] != null ? Partner.fromJson(json[
'driver']) : null,
1806 generatorId: json[
'generatorId'],
1809 json[
'partner'] != null ? Partner.fromJson(json[
'partner']) : null,
1810 productName: json[
'productName'],
1811 status: json[
'status'],
1812 totalQuantity: json[
'totalQuantity'],
1814 vehiclePlate: json[
'vehiclePlate'],
1818 Map<String, dynamic>
toJson() {
1819 final Map<String, dynamic> data = <String, dynamic>{};
1820 if (collectionDate != null) {
1821 data[
'collectionDate'] = collectionDate!.toIso8601String();
1823 if (collectionVoucher != null) {
1824 data[
'collectionVoucher'] = collectionVoucher!.toJson();
1827 data[
'company'] =
company!.toJson();
1829 data[
'containerNumber'] = containerNumber;
1830 data[
'containerType'] = containerType;
1831 if (driver != null) {
1832 data[
'driver'] = driver!.toJson();
1834 data[
'generatorId'] = generatorId;
1836 if (partner != null) {
1837 data[
'partner'] = partner!.toJson();
1839 data[
'productName'] = productName;
1840 data[
'status'] = status;
1841 data[
'totalQuantity'] = totalQuantity;
1843 data[
'vehiclePlate'] = vehiclePlate;
1848class CollectionVoucher {
1849 final String? billStatus;
1850 final String? collectionConfirmRef;
1851 final String? collectionOrderRef;
1852 final DateTime? confirmationDate;
1853 final double? cvAmountTotal;
1856 final String? paymentBillRef;
1857 final String? receiptStatus;
1858 final String? status;
1862 this.collectionConfirmRef,
1863 this.collectionOrderRef,
1864 this.confirmationDate,
1868 this.paymentBillRef,
1873 factory CollectionVoucher.
fromJson(Map<String, dynamic> json) {
1874 return CollectionVoucher(
1875 billStatus: json[
'billStatus'],
1876 collectionConfirmRef: json[
'collectionConfirmRef'],
1877 collectionOrderRef: json[
'collectionOrderRef'],
1878 confirmationDate: json[
'confirmationDate'] != null
1879 ? DateTime.parse(json[
'confirmationDate'])
1881 cvAmountTotal: json[
'cvAmountTotal']?.toDouble(),
1884 paymentBillRef: json[
'paymentBillRef'],
1885 receiptStatus: json[
'receiptStatus'],
1886 status: json[
'status'],
1890 Map<String, dynamic>
toJson() {
1891 final Map<String, dynamic> data = <String, dynamic>{};
1892 data[
'billStatus'] = billStatus;
1893 data[
'collectionConfirmRef'] = collectionConfirmRef;
1894 data[
'collectionOrderRef'] = collectionOrderRef;
1895 if (confirmationDate != null) {
1896 data[
'confirmationDate'] = confirmationDate!.toIso8601String();
1898 data[
'cvAmountTotal'] = cvAmountTotal;
1900 data[
'name'] =
name;
1901 data[
'paymentBillRef'] = paymentBillRef;
1902 data[
'receiptStatus'] = receiptStatus;
1903 data[
'status'] = status;
1911 final Partner? partner;
1919 factory Company.
fromJson(Map<String, dynamic> json) {
1924 json[
'partner'] != null ? Partner.fromJson(json[
'partner']) : null,
1928 Map<String, dynamic>
toJson() {
1929 final Map<String, dynamic> data = <String, dynamic>{};
1931 data[
'name'] =
name;
1932 if (partner != null) {
1933 data[
'partner'] = partner!.toJson();
1940 final String? contactName;
1942 final String? internalCode;
1943 final bool? isCompany;
1944 final double? monthlyCapacity;
1946 final int? parentId;
1947 final String? partnerLatitude;
1948 final String? partnerLongitude;
1949 final String? phone;
1950 final SalesPerson? salesPerson;
1951 final String? street;
1952 final double? tokenTotalValue;
1959 this.monthlyCapacity,
1962 this.partnerLatitude,
1963 this.partnerLongitude,
1967 this.tokenTotalValue,
1970 factory Partner.
fromJson(Map<String, dynamic> json) {
1972 contactName: json[
'contactName'],
1974 internalCode: json[
'internalCode'],
1975 isCompany: json[
'isCompany'],
1976 monthlyCapacity: json[
'monthlyCapacity']?.toDouble(),
1978 parentId: json[
'parentId'],
1979 partnerLatitude: json[
'partnerLatitude'],
1980 partnerLongitude: json[
'partnerLongitude'],
1981 phone: json[
'phone'],
1982 salesPerson: json[
'salesPerson'] != null
1983 ? SalesPerson.fromJson(json[
'salesPerson'])
1985 street: json[
'street'],
1986 tokenTotalValue: json[
'tokenTotalValue']?.toDouble(),
1990 Map<String, dynamic>
toJson() {
1991 final Map<String, dynamic> data = <String, dynamic>{};
1992 data[
'contactName'] = contactName;
1994 data[
'internalCode'] = internalCode;
1995 data[
'isCompany'] = isCompany;
1996 data[
'monthlyCapacity'] = monthlyCapacity;
1997 data[
'name'] =
name;
1998 data[
'parentId'] = parentId;
1999 data[
'partnerLatitude'] = partnerLatitude;
2000 data[
'partnerLongitude'] = partnerLongitude;
2001 data[
'phone'] = phone;
2002 if (salesPerson != null) {
2003 data[
'salesPerson'] = salesPerson!.toJson();
2005 data[
'street'] = street;
2006 data[
'tokenTotalValue'] = tokenTotalValue;
2022 factory SalesPerson.
fromJson(Map<String, dynamic> json) {
2025 json[
'company'] != null ? Company.fromJson(json[
'company']) : null,
2028 ? PartnerId.fromJson(json[
'partnerId'])
2033 Map<String, dynamic>
toJson() {
2034 final Map<String, dynamic> data = <String, dynamic>{};
2036 data[
'company'] =
company!.toJson();
2040 data[
'partnerId'] =
partnerId!.toJson();
2048 final bool? isCompany;
2049 final double? monthlyCapacity;
2051 final String? partnerLatitude;
2052 final String? partnerLongitude;
2053 final double? tokenTotalValue;
2058 this.monthlyCapacity,
2060 this.partnerLatitude,
2061 this.partnerLongitude,
2062 this.tokenTotalValue,
2065 factory PartnerId.
fromJson(Map<String, dynamic> json) {
2068 isCompany: json[
'isCompany'],
2069 monthlyCapacity: json[
'monthlyCapacity']?.toDouble(),
2071 partnerLatitude: json[
'partnerLatitude'],
2072 partnerLongitude: json[
'partnerLongitude'],
2073 tokenTotalValue: json[
'tokenTotalValue']?.toDouble(),
2077 Map<String, dynamic>
toJson() {
2078 final Map<String, dynamic> data = <String, dynamic>{};
2080 data[
'isCompany'] = isCompany;
2081 data[
'monthlyCapacity'] = monthlyCapacity;
2082 data[
'name'] =
name;
2083 data[
'partnerLatitude'] = partnerLatitude;
2084 data[
'partnerLongitude'] = partnerLongitude;
2085 data[
'tokenTotalValue'] = tokenTotalValue;
static const String tajmieLogo
factory CurrencyModel fromJson(Map< String, dynamic > json)
class ResCountryStateEntity company
final Color backgroundColor
Future generateManifest({ required BuildContext context, required String collectionName, }) async
Future< CollectionVoucherDocumentModel?> fetchData({required String collectionName}) async
override Widget build(BuildContext context)
Map< String, dynamic > toJson()