dbx_platform 1.0.0+1 dbx_platform: ^1.0.0+1 copied to clipboard
An unofficial dropbox platform package.
dbx_platform #
unofficial Dropbox client Hecho en 🇵🇷 por Radamés J. Valentín Reyes
Getting an API key and other required info #
Step 1 #
Tap/click the image below to visit the Dropbox developer website and tap the button that says "App console" on the top right corner. Login or create an account if necessary.
Step 2 #
Step 3 #
Make selections from the given options and tap/click on Create app button
Step 4 #
Enable permissions from the app page on the developer console. You need read and write permissions enabled so that your API calls don't throw an error.
Step 5 #
Generate an access token. Go to the Settings tab of your app to generate the access token, copy the app key and app secret for later use.
Import the dart package #
import 'package:dbx_platform/dbx_platform.dart';
import 'dart:io';
Dropbox instance #
DBX dbx = DBX(
accessToken: accessToken,
appKey: appKey,
appSecret: appSecret,
);
Functions(performs the API calls) #
Create folder #
await dbx.createFolder(
fileRequestTitle: "Folder creation test",
folderToCreate: Directory("/test"),
);
Delete folder #
await dbx.deleteFolder(
folderToDelete: Directory("/test"),
);
Folder Exists #
await dbx.folderExists(
folderToCheck: Directory("/test"),
);
Upload file/Create file #
await dbx.createFile(
fileToUpload: File("./test_assets/test.odt"),
path: "/test.odt",
mode: WriteMode.add,
mute: true,
);
File exists #
await dbx.fileExists(
fileToCheck: File("/test.odt"),
);
Delete file #
await dbx.deleteFile(
fileToDelete: File("/test.odt"),
);
Contribute/donate by tapping on the Pay Pal logo/image #
References #
- https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Share-a-folder-for-uploading-files/td-p/472686
- https://www.dropbox.com/developers/documentation/http/documentation#file_requests-create
- https://www.dropbox.com/developers/reference/auth-types#user
- https://www.dropbox.com/developers/reference/content-hash
- https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-in-call-to-API-function-quot-files-upload-quot-HTTP-header/td-p/461110
- https://riptutorial.com/dropbox-api/example/1356/uploading-a-file-via-curl
- https://riptutorial.com/ebook/dropbox-api
- https://riptutorial.com/dropbox-api/example/1348/downloading-a-file-via-curl