I want to pass the 'GoogleSignInAccount' object to kotlin via the invokeMethod - flutter method chanel. On the kotlin side, count and use this object. But when transmitting, I get the error 'ArgumentError (Invalid argument: Instance of 'GoogleSignInAccount')'
How can I transfer and is it possible to transfer objects at all ?
error what i recive
the error occurs in this line. I was looking for an example of transferring objects, but I didn't find them. I tried to write to map, and pass an array. but the error is the same
final decoded = json.decode(await platform.invokeMethod('readFitData', googleUser));
you need to stringify your payload as method channel only accepts certain native data type alternatively you can use https://pub.dev/packages/pigeon
More details can be found here https://docs.flutter.dev/platform-integration/platform-channels?tab=type-mappings-kotlin-tab