Flutter Installer

Flutter Installer is a Flutter package designed to assist with file operations within your application's documents directory. It provides an easy-to-use API for installing, deleting, checking, reading, copying, and renaming files.


  • Install file from a list of bytes
  • Install file from application assets
  • Delete specific file
  • Delete all files in the directory
  • Check if a file exists
  • Read file content
  • Copy a file
  • Rename a file


To use this package, add flutter_installer as a dependency in your pubspec.yaml file.


First, import the package:

import 'package:flutter_installer/flutter_installer.dart';

Then, create an instance of the FlutterInstaller class:

FlutterInstaller installer = FlutterInstaller();

You can specify a directory name while creating the FlutterInstaller object. If not specified, it defaults to 'flutter_installer':

FlutterInstaller installer = FlutterInstaller(mainDirectory: 'my_directory');


Here are some examples of using the FlutterInstaller methods:


Install a file from a list of bytes:

String filePath = await installer.install(
  fileBytes: myFileBytes,
  name: 'myfile.txt',
  replace: true


Install a file from application assets:

String filePath = await installer.installFromAssets(
  assetPath: 'assets/myfile.txt',
  name: 'myfile.txt',
  replace: true


Delete a specific file:

bool isDeleted = await installer.deleteFile('myfile.txt');


Delete all files in the directory:

await installer.deleteAllFiles();


Check if a file exists:

bool exists = await installer.isFileExists('myfile.txt');


Read a file:

List<int> fileContent = await installer.readFile('myfile.txt');


Copy a file:

String newFilePath = await installer.copyFile(
  existingFileName: 'myfile.txt',
  newFileName: 'copied_myfile.txt'


Rename a file:

String newFilePath = await installer.renameFile(
  existingFileName: 'myfile.txt',
  newFileName: 'renamed_myfile.txt'

Exception Handling

All methods throw a FlutterInstallerException in case of any errors during execution. It's recommended to use try-catch blocks to handle these exceptions.


If you encounter any problem or the library is missing a feature feel free to open an issue. Feel free to fork, improve the package and make pull request.


This project is licensed under the MIT License - see the LICENSE file for details.