0

I have a flutter app that is using Cards (within a container). The cards have motivational quotes in them. The quotes are generated from a database.

We want to have the ability for a user to share that motivational quote with their friends (via Facebook, email, WhatsApp etc). So, it would need to convert that Card into an image - am I right? How could we do this?

As for my code, it is really standard flutter code

Thanks

houba
  • 496
  • 7
  • 20
  • share inside your app, facebook, twitter, whatsapp? you need to be a lot more specific... and please show some code of what you've tried... – Argee May 23 '20 at 16:13
  • I haven't tried anything. Yes, I want to share it in FB or WhatsApp. I can show you my code, but it is standard Flutter... – houba May 23 '20 at 16:18

2 Answers2

1

You don't have to convert the quote into an image. You can share the quote from platform's standard share screen. Just use Share package from pub.dev.

All it takes is one line of code :

Share.share("Everyone wants to go to heaven yet nobody wants to die");

The standard sharing options such as SMS, Email etc are shown. And depending on the user's installed apps, they are shown as well. That means if a user has Whatsapp installed then Whatsapp is shown as one of the sharing options.

Note : I don't know if Facebook can share text or not (as in @Chatura's answer). Please check.

Sukhi
  • 13,261
  • 7
  • 36
  • 53
0

From the server-side you can generate an image for your quote and you can use Flutter library Social share plugin to share it on Facebook since you cannot share text on Facebook. Whatapp and Twitter you can share the text using Flutter Share Me Library

Chatura Dilan
  • 1,502
  • 1
  • 16
  • 29