hiltvine.blogg.se

Shareplus 55
Shareplus 55








shareplus 55

Pick image or video from galary or camera & share it work(imageurl),įinal imageurl = 'define your image url here' Here we will download image from a url using http package & store it into temporary directory & then get the path of downloaded image using path provider & share the image file using share_plus. Share image from assets folder of flutter project ElevatedButton(Ĭhild: const Text('Share Assets Folder Image'),īyteData imagebyte = await rootBundle.load('assets/images/image1.jpg') įinal temp = await getTemporaryDirectory() įile(path).writeAsBytesSync(8List()) Īwait Share.shareFiles(, text: 'Image Shared') Padding: const EdgeInsets.only(left: 8, right: 8),Īwait Share.share('$') Ģ. TextEditingController textdata = TextEditingController() Here i have TextField & Button, user can enter text message in TextField & press on share button to share the text to another app for example like Whatsapp by using share_plus methods. Share Text Message with links to another app using share_plus share(' your text message here ') įile Sharing: Share.shareFiles(, text: 'Image Shared') // here path is the location of file in your mobile directory.

#Shareplus 55 plus#

In Share plus package we have 2 method that let us in sharing content like text and files. Import 'package:file_picker/file_picker.dart' Import 'package:image_picker/image_picker.dart' Import 'package:share_plus/share_plus.dart' Then, to use the packages you need to import them where it’s required (say main.dart) import 'package:path_provider/path_provider.dart' dependencies:įile_picker: Step 2: Import all of them where required Open pubspec.yaml file and under dependencies section add below packages. Let’s get Started Step 1: Add required dependencies










Shareplus 55