I posted the following question also in Stackoverflow: https://stackoverflow.com/questions/72254438/how-do-i-use-amplitudes-flutter-package-in-a-custom-action
I installed the following pub-dev package: https://pub.dev/packages/amplitude_flutter
Amplitude has a flutter SDK and a flutter package which should allow the app to send events to the Amplitude server.
I want to execute it within a custom action so that I can send events when the users performs certain actions.
Here is the code. IDE errors include:
Error: 'Amplitude' is imported from both 'package:amplitude_flutter/amplitude.dart' and 'package:amplitude_flutter/web/amplitude_js.dart
Error: Can't assign to the final variable 'analytics'.
analytics = Amplitude.getInstance(instanceName: "Assembly");
I have also tried to run “flutter run” in an IOS Simulator on a Mac. I am unable to get it to run.
When I comment out everything in the custom action, it does run.