toJson method
Implementation
Map<String, dynamic> toJson() {
// we need to check web first because `defaultTargetPlatform` is not
// available for web.
if (kIsWeb) {
return <String, dynamic>{};
} else if (defaultTargetPlatform == TargetPlatform.android) {
return android.toJson();
} else if (defaultTargetPlatform == TargetPlatform.iOS) {
return iOS.toJson();
} else {
return <String, dynamic>{};
}
}