creating a custom Flutter action using Amplitude's package

  • 16 May 2022
  • 1 reply

Userlevel 1


I posted the following question also in Stackoverflow:


I installed the following pub-dev package:

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[1].  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.



1 reply

Userlevel 5
Badge +2

Hi @assembly Thanks for posting here! 😁 I noticed that you found some answers in this thread and wanted to close the loop here. Please keep us posted if you need any additional support. We’re here to help!