lazy_g_drive 2.1.1 copy "lazy_g_drive: ^2.1.1" to clipboard
lazy_g_drive: ^2.1.1 copied to clipboard

A simple Google Drive Api package mainly design for AppData scope operation.

example/lazy_g_drive_example.dart

import 'package:lazy_extensions/lazy_extensions.dart';
import 'package:lazy_g_drive/lazy_g_drive.dart' as lazy;
import 'package:lazy_log/lazy_log.dart' as lazy;

void main() async {
  lazy.logEnable = true;

  var gdrive = lazy.GDrive();
  // This is sample code. To get actual [token],
  // check lazy_sign_in example: https://pub.dev/packages/lazy_sign_in/example
  gdrive.token = 'Google OAuth Access Token';

  // File meta
  var fileMeta =
      lazy.gDriveFileMeta(name: 'Sample.txt', modifiedTime: DateTime.now());

  // File content
  String content = 'This is sample text.';
  var media = content.toMedia();

  // Upload
  var result = await gdrive.create(file: fileMeta, uploadMedia: media);

  lazy.log(result.jsonPretty());
}
10
likes
150
points
140
downloads

Publisher

verified publisherjsiu.dev

Weekly Downloads

A simple Google Drive Api package mainly design for AppData scope operation.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

googleapis, lazy_extensions, lazy_http_client, lazy_log

More

Packages that depend on lazy_g_drive