toJson method

Map<String, dynamic> toJson()

Serialises to a JSON-compatible map. Omits null / empty fields.

Implementation

Map<String, dynamic> toJson() => {
      if (osName != null) 'osName': osName,
      if (osVersion != null) 'osVersion': osVersion,
      if (deviceModel != null) 'deviceModel': deviceModel,
      if (appName != null) 'appName': appName,
      if (buildNumber != null) 'buildNumber': buildNumber,
      if (extra.isNotEmpty) 'extra': extra,
    };