hospitalfert.blogg.se

Shareplus flutter
Shareplus flutter









shareplus flutter

We need import ‘dart:ui’ as ui so that we can convert the boundary into an image.Static GlobalKey previewContainer = GlobalKey() And in this method, we are using RenderRepaintBoundary to use the key and get the current context and build a separate display. You need to wrap your Scaffold widget with RepaintBoundary as a parent and provide key to it because it creates a separate display list for its child.Why? because we can possibly face a PlatformException with iOS platform (because of its restrictions). We are performing Exception Handling before implementing the above logic. Converting the image URL to an image file and share it with a single tap.įirst of all, create two buttons in your app which will call the above two logics and do our work:.

shareplus flutter

Capturing the current screen and sharing that screenshot on a single tap.I’ll implement two logic for sharing files So that we won’t face an issue like the owner changing the files. Note: It’s better to fork the above repository and use it. If you are wondering what is this modified share package, check it here: And about the already available packages, we have few issues with these packages like, we cannot share a File which we call from a network (like converting an image URL into an image file and then sharing it).īefore starting, If you are new at Flutter Development, you can get started here: We’ll use a modified version of the share package for sharing files. But you might be thinking it only supports text share, so how do we do it? and we already have other packages for that. In this article, we will implement the sharing files feature using the share package.











Shareplus flutter