搜索插件、代码仓与 APP 分类

GitHub 代码仓Lukiya/flutter_onedrive

flutter_onedrive

Lukiya/flutter_onedrive open-source repository details.

flutter_onedrive 项目封面
星标
11
复刻
14
最近推送(UTC)
2026年4月23日
项目状态
未归档

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

Features

  • Download files from onedrive
  • Upload files to onedrive
  • List files
  • Create directory
  • Delete files

References

Read below documents before you start using this library:

  • https://docs.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/app-registration?view=odsp-graph-online
  • https://docs.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/msa-oauth?view=odsp-graph-online
  • https://learn.microsoft.com/en-us/onedrive/developer/rest-api/concepts/special-folders-appfolder?view=odsp-graph-online
  • https://github.com/LinusU/flutter_web_auth

Getting started

flutter public add flutter_onedrive
import 'package:flutter_onedrive/flutter_onedrive.dart';

Usage

final onedrive = OneDrive(redirectURL: "your redirect URL", clientID: "your client id");

return FutureBuilder(
  future: onedrive.isConnected(),
  builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
    if (!snapshot.hasData) {
      return const Center(child: CircularProgressIndicator());
    }
    if (snapshot.data ?? false) {
      // Has connected
      return const Text("Connected");
    } else {
      // Hasn't connected
      return MaterialButton(
        child: const Text("Connect"),
        onPressed: () async {
          final success = await onedrive.connect(context);
          if (success) {
            // Create directories
            OneDriveResponse response = await onedrive.createDirectory("/test");
            
            // Upload files
            const str = "Hello, World!";
            var data = Uint8List.fromList(utf8.encode(str));
            response = await onedrive.push(data, "/test/hello.txt");
            
            // Download files
            response = await onedrive.pull("/test/hello.txt");

            // List files
            final files = await onedrive.listFiles("/test/");

            // Delete files
            response = await onedrive.deleteFile("/test/hello.txt");

            // Delete directories
            response = await onedrive.deleteFile("/test");
          }
        },
      );
    }
  },
);
Lukiya GitHub avatar
GitHub 作者

Lukiya ↗

语言DartRubySwiftKotlinPowerShellObjective-C

此仓库发布的插件

使用的依赖

依赖清单 8 项

如何选择适合项目的代码仓?

先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。

  1. 通过仓库名、作者或描述搜索,再按技术分类缩小范围。
  2. 结合星标、复刻与最近推送比较项目;星标反映社区关注,不代表质量保证。
  3. 使用前在 GitHub 核对 README、许可证与 Issues。

来源与维护

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗