FlutterFlow Docs
Search…
Advanced Functionality πŸ€–
Share Action
Share Action can be used to send a text using the Android or iOS device's share dialog. You can send the text using email, message, or any other application present on the device that supports sharing functionality.

Define Share Action

Go to your project page on FlutterFlow and follow the steps below to define an Upload Photo/Video Action to a widget:
  1. 1.
    Select the widget in which you want to set the Action.
  2. 2.
    Select the Actions from the Properties Panel (the right menu).
  3. 3.
    Click + Add Action button.
  4. 4.
    Choose a gesture from the dropdown among On Tap, On Double Tap, or On Long Press.
  5. 5.
    Select the Action Type as Share.
  6. 6.
    Now, you need to specify a URL/Text Value. It can be set either by defining a Specific Value or by using From Variable to use a value stored inside a variable.
    If you are using Specific Value, enter the text in the Value field.
    If you are using From Variable, you need to select the Source.
Demo of defining Share Action using a Specific Value is as follows:
Alternatively, a demo of defining Share Action using From Variable option is as follows:
NOTE: You won't be able to try out this Action using FlutterFlow's Run Mode or Preview Mode. To test this Action, you have to run it on an iOS or Android device or emulator. You can either download the code (by going to Developer Menu > Download Code) and build it for your device, or use the Build APK button (present on the Tool Bar) to generate an APK that you can run on your Android device.

Code overview

You can view the code that is generated by FlutterFlow in the background by going to the Developer Menu > View Code from the Tool Bar.
Following is the generated code for Share Action using Specific Value and From Variable options respectively:
Share Action using a specific text value
Share Action using the value from a Variable
In the above two snippets, the Share.share() is used to trigger the Share Action using the text String passed. FlutterFlow uses the share_plus package to achieve this.

References

  • Want to know how you can use multiple actions? Check out this page.
  • Get more information about the Flutter share_plus package here.
​