fl_cloud_storage 0.1.0 copy "fl_cloud_storage: ^0.1.0" to clipboard
fl_cloud_storage: ^0.1.0 copied to clipboard

Store files in the cloud from Flutter apps. In the first step we only support Google Drive but adding other clouds is much appreciated.

fl_cloud_storage #

Features a cloud service can provide #

  1. Authenticate (login)
  2. Authorize
  3. Upload files to a cloud
  4. Download files from a cloud
  5. Delete files from cloud
  6. Supported operating systems: iOS, Android, Web, MacOS, Windows, Linux (or subset)

Supported clouds #

Google Drive Dropbox
Authenticate
Authorize
Upload files
Download files
Delete files
iOS support
Android support
Web support
MacOS support ?
Windows support ?
Linux support ?

Usage #

Import the package:

import 'package:fl_cloud_storage/fl_cloud_storage.dart';

Initialize the service you want to use:

final driveService = await CloudStorageService.initialize(
  StorageType.GOOGLE_DRIVE,
  cloudStorageConfig: null, // optional parameter, vendor specific implementation
);

If you need special scopes, read the section for each cloud storage vendor.

1.a) Login:

cloudStorageService.authenticate();

1.b) Ask if the user is logged in:

cloudStorageService.isSignedIn;

1.c) Logout:

cloudStorageService.logout();

4.a) List files on cloud storage:

cloudStorageService.getAllFiles()

Google Drive Cloud Storage #

2.) Authorization

By default the app scope is used for Google Drive:

[v3.DriveApi.driveAppdataScope, v3.DriveApi.driveFileScope]

If you need full read and write access, add a cloudStorageConfig:

final driveService = await CloudStorageService.initialize<GoogleDriveScope>(
  StorageType.GOOGLE_DRIVE,
  cloudStorageConfig: GoogleDriveScope.full,
);

Behind the scens this scope is asked for:

[v3.DriveApi.driveAppdataScope, v3.DriveApi.driveFileScope, v3.DriveApi.driveScope]
3
likes
130
pub points
69%
popularity

Publisher

verified publisherehwplus.com

Store files in the cloud from Flutter apps. In the first step we only support Google Drive but adding other clouds is much appreciated.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (LICENSE)

Dependencies

flutter, google_sign_in, googleapis, http, json_annotation, logger

More

Packages that depend on fl_cloud_storage