filesaverz 1.6.0 copy "filesaverz: ^1.6.0" to clipboard
filesaverz: ^1.6.0 copied to clipboard

outdated

A package that makes it easy for user to browse folder and save file or pick files in android.

File Saver Z #

FileSaverZ Version
A package that makes it easy for user to browse folder and save file or pick files in android.

Preview #

Install #

Add this to your dependency

dependencies:
  filesaverz: ^1.6.0

Continue by adding permission in your AndroidManifest.xml.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.example">
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

And then import the filesaver (with z) package.

import 'package:filesaverz/filesaver.dart';

FileSaver Usage #

First, setting up the FileSaver widget like this.

  /// This is default FileSaver for saving file.
  FileSaver fileSaver = FileSaver(
  fileTypes: const ['txt','pdf'],
  initialFileName: 'Untitled File',
);

or this customable FileSaver.

FileSaver fileSaver = FileSaver.builder(
   fileTypes: const ['txt','pdf'],
   initialFileName: 'Untitled File',

   headerBuilder: (context,state)=> /* Your Widget */,
   bodyBuilder: (context,state)=> /* Your Widget */,
   footerBuilder: (context,state)=> /* Your Widget */,
);

And then in async function call these:

Purpose Code
Getting selected path from saving file.
String? path = await fileSaver.getPath(context);
Calling writeAsBytes method.
fileSaver.writeAsBytes(bytes, context: context);
Calling writeAsBytesSync method.
fileSaver.writeAsBytesSync(bytes, context: context);
Calling writeAsString method.
fileSaver.writeAsString(contents, context: context);

    
Calling writeAsStringSync method.
fileSaver.writeAsStringSync(contents, context: context);

FilePicker Usage #

Setting up the FilePicker like this.

/// This is default FilePicker for picking file or files.
final filePicker = FileSaver.picker(
   fileTypes: const ['jpg','gif'],
);
Purpose Code
Picking single file.
File? file = await filePicker.getFile(context);
Picking multiple files.
List

Documentation #

Full Documentation here.

Example #

17
likes
0
pub points
54%
popularity

Publisher

verified publisherinidia.app

A package that makes it easy for user to browse folder and save file or pick files in android.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, permission_handler, provider

More

Packages that depend on filesaverz