toMap method
conversion to Map
Implementation
Map toMap() {
Map map = Map();
if (deviceId != null) map[_MAP_DEVICE_ID] = deviceId;
map[_MAP_ENABLE] = isEnabled;
if (pushToken != null) map[_MAP_PUSH_TOKEN] = pushToken;
if (platform != null) map[_MAP_PLATFORM] = platform;
if (version != null) map[_MAP_VERSION] = version;
if (productName != null) map[_MAP_PRODUCT_NAME] = productName;
if (productVersion != null) map[_MAP_PRODUCT_VERSION] = productVersion;
if (osName != null) map[_MAP_OS_NAME] = osName;
if (osVersion != null) map[_MAP_OS_VERSION] = osVersion;
if (deviceBrand != null) map[_MAP_DEVICE_BRAND] = deviceBrand;
if (deviceModel != null) map[_MAP_DEVICE_MODEL] = deviceModel;
if (operator != null) map[_MAP_OPERATOR] = operator;
if (deviceType != null) map[_MAP_DEVICE_TYPE] = deviceType;
if (appVersion != null) map[_MAP_APP_VERSION] = appVersion;
if (locale != null) map[_MAP_LOCALE] = locale;
if (timeZone != null) map[_MAP_TIME_ZONE] = timeZone;
if (timeOffset != null) map[_MAP_TIME_OFFSET] = timeOffset;
if (externalApps != null) {
List<Map> list = [];
for (var i = 0; i < externalApps!.length; i++) {
list.add(externalApps![i].toMap());
}
map[_MAP_EXTERNAL_APPS] = list;
}
if (externalCode != null) map[_MAP_EXTERNAL_CODE] = externalCode;
return map;
}