toJson method
Convert the platform data to a JSON map.
Implementation
Map<String, dynamic> toJson() {
return {
'name': name,
'baseUrl': baseUrl,
'currentUrl': currentUrl,
'device': device,
'language': language,
'userAgent': userAgent,
'height': height.toPx,
'width': width.toPx,
'isMobile': isMobile,
'isTablet': isTablet,
'isDesktop': isDesktop,
'isPWA': isPWA,
'isIphone': isIphone,
'isiPad': isiPad,
'isMacOS': isMacOS,
'isWindows': isWindows,
'isAndroid': isAndroid,
'isiOS': isiOS,
'isMobileBrowser': isMobileBrowser,
};
}