toMap method

Map<String, dynamic> toMap()

companyStartDate is formatted to a "yyyy-MM-dd" formatted date String

Implementation

Map<String, dynamic> toMap() {
  return <String, dynamic>{
    'Id': id,
    'CompanyName': companyName,
    'LegalName': legalName,
    'CompanyAddr': companyAddr?.toMap(),
    'CustomerCommunicationAddr': customerCommunicationAddr?.toMap(),
    'LegalAddr': legalAddr?.toMap(),
    'CustomerCommunicationEmailAddr': customerCommunicationEmailAddr?.toMap(),
    'PrimaryPhone': primaryPhone?.toMap(),
    'CompanyStartDate': companyStartDate != null
        ? DateFormat("yyyy-MM-dd").format(companyStartDate!)
        : null,
    'FiscalYearStartMonth': fiscalYearStartMonth,
    'Country': country,
    'Email': email?.toMap(),
    'WebAddr': webAddr?.toMap(),
    'SupportedLanguages': supportedLanguages,
    'NameValue': nameValue?.map((x) => x.toMap()).toList(),
    'domain': domain,
    'sparse': sparse,
    'SyncToken': syncToken,
    'MetaData': metaData,
  };
}