Import 'package:flutter_app_demo/screens/' In this API we create methods for the functions that the program will perform, i.e., picking images and videos from the local storage. We will create four APIs which we will use to build the functionality of our application. encrypt allows us to encrypt and decrypt files using the AES algorithm.file_picker enables us to pick from the local storage.file_saver provides us an easier way to save document files to the local storage.gallery_saver provides an easier way to save images or videos to the gallery.video_compress enables us to compress videos.flutter_native_image helps us to compress images that we pick from the local storage.firebase_storage and firebase_core help us to access our Firebase storage where we will store our files.Go to the pubspec.yaml file and add the following dependencies:Įncrypt: ^ 5.0. Note that this rule is not recommended when in production mode because it makes your data insecure. Next, select to start in test mode and specify the location of your Firebase server and then click done.Īfter the process is complete, navigate to the Rules tab and then change the rules, as shown below: Navigate to the menu in the dashboard and select Storage and then Get Started as shown below: To set up Firebase go to the Firebase Console and follow the step-by-step process to create your Firebase project.Īfter successfully creating your Firebase Android app. This folder will contain the APIs that we will use for the functionality of our application.Ī Firebase API - It will contain the code that will enable us to upload files to Firebase storage.įile picker API - This API will enable us to pick files from the local storage.įile compression API - This APi will enable us to compress images and videos picked from the gallery.įile encryption API - This API will enable us to encrypt a file. Next, we will create another folder under the lib folder called services. It will allow the user to pick a document and manipulate it. Document screen - This will be called.It will allow the user to pick a video and upload it to Firebase storage. Video screen - This page will be called. It will allow the user to pick and upload an image. Image screen - This page will be called.Home screen - This will be our startup page when the application loads.We will go to the lib folder of our project and create a new folder called screens and here, we will add our routes. Open Android Studio and create a new Flutter application with the name flutter-app-demo.Īfter the project has been initialized, we will create our project structure. If you do not have Flutter SDK installed, visit Flutter Docs for the installation process. We will be using Flutter version 2.10.4 in this tutorial. This tutorial uses Android Studio with the Flutter plugin installed. An IDE that supports Flutter such as Visual Studio Code.Knowledge of working with Flutter widgets.A solid understanding of the Dart programming language.Encrypt the files using the AES encryption algorithm before uploading the file to Firebase storage.Compress the files without losing their quality.Accept files such as images, videos, or documents from the phone’s local storage.This tutorial will guide the reader on how to create a simple Flutter mobile application that will be able to: This prevents unauthorized access and tampering. On the other hand, file encryption is a way of encoding files, including the sensitive data they contain, to send them securely. It also involves network optimization of files for easier transfer over the internet. File compression is the process of reducing the logical size of a file to save disk space.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |