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

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

example/lazy_g_drive_example.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(lazy.jsonPretty(result));
}
10
likes
50
pub points
0%
popularity

Publisher

verified publisherjsiu.dev

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

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

googleapis, lazy_extensions, lazy_http_client, lazy_log

More

Packages that depend on lazy_g_drive