roccograpisarda / flutter-simple-create-or-upload-file

Simple flutter app example which allows user to upload a file and get its true path or create a file in a specific path.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple Flutter upload or create file application example

Flutter app that allows users to upload or create files on their device, while providing the real path of the selected file.This is particularly useful for developers who need to access the real path of a file, as opposed to the cached file path or URI.

In addition, the app includes a method that requests storage permission for all Android versions.

Features: - Real path support: When a user selects a file, RealPath provides the real path of the file instead of the cached file path or URI.

This ensures that developers can access the actual location of the file, which can be crucial for certain use cases.

  • File upload and creation: users can upload existing files or create new files directly from the app. The app provides a file manager interface where users can browse through their device’s files and folders.

  • Storage permission request: this app includes a method that requests storage permission for all Android versions. This ensures that users can access their files without any permission issues.

  • User-friendly interface: The app’s interface is designed to be easy to use and intuitive. Users can quickly upload or create files with just a few taps.

Whether you’re a developer who needs to access the real path of a file or just someone who wants to manage their files on-the-go, this is the perfect app for you. With its simple yet powerful features, this app makes file management a breeze.

Requirements

AndroidMainifest.xml changes:

To get storage access you need to write these three code lines in the AndroidManifest.xml stored in android>app>src.

In this project these lines are already written but generally to get storage access:

For Android version 11 or greater:

    <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"  />

For Android version below 11:

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

How to use

Install application dependencies and run it:

cd simple-create-or-upload-file/app && flutter pub get && flutter run

Screenshots

no_file
Figure 1. No file created or selected
select_file
Figure 2. Select file dialog
create_file_page
Figure 3. Create file page
save_to_folder
Figure 4. Select folder dialog
after_upload_or_creation
Figure 5. File created or selected

About

Simple flutter app example which allows user to upload a file and get its true path or create a file in a specific path.

License:GNU General Public License v3.0


Languages

Language:Dart 98.9%Language:Kotlin 1.1%