However, we only need the name, image, protein content, and quota.Ĭreate a folder named models in the lib directory, which will hold all the models we’ll use. From the FishWatch API documentation, we see that the API returns the name, description, image, and a host of other details. Next, we’ll set up the models for converting the data we receive. Stacked_generator: ^0.5.7 Setting up the models image_downloader: Enables us download the image file we want to share.permission_handler: Enables us to request permission to use the phone’s mobile storage.share_plus: The package we’ll use to implement the share functionality.logger: Prints important information to the debug console.stacked_generator: Generates files from stacked annotations.build_runner: Provides access to run commands for auto-generating files from annotations.stacked: An architectural solution that uses Provider under the hood, giving us access to classes that will spice up our development process.http: To make a GET request to the FishWatch API and retrieve the list of various fish species.Next, we’ll import the following dependencies in our pubspec.yaml file: The command above would create the base files that we’ll build upon for our sample application. Let’s dive right in! File sharing in operation: Sample application walkthrough Project setupĬreate a new codebase by running the command below: flutter create flutter_share We’ll fetch a list of fish species from the FishWatch API, display it in our app, then add the share functionality, enabling us to share information like the image, name, habitat, and quota of each fish specie with any other application. In this tutorial, we’ll cover how to share texts and images from our sample application to other mobile applications. Sharing files, text, and images between apps
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |