Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.
/ anonfiles.dart Public archive

Unofficial Dart client for AnonFiles, LetsUpload, FileChan, etc.

License

Notifications You must be signed in to change notification settings

alexrintt/anonfiles.dart

Repository files navigation

AnonFiles for Dart

Pub Version Pub Version

This is a library for interacting with AnonFiles related APIs:

Installation

dependencies:
  anonfiles: ^<latest-version>

Import:

import 'package:anonfiles/anonfiles.dart';

Usage

The usage is pretty straightforward:

final client = AnonFiles(); // LetsUpload() and FileChan() are also available.

final AnonFileUploadResponse? response = await client.uploadFileBytes(
  byteStream: byteStream,
  filename: filename,
  length: length,
);

final String htmlDownloadUrl = response!.htmlDownloadUrl!;

final String? fileDirectDownloadUrl =
    await client.getDirectDownloadUrl(htmlDownloadUrl);

Check /example for details.

Issues and requests

Contributing

  1. First off, fork the repository.

  2. Setup dev environment:

# Clone repo.
$ git clone <your-fork-url>
$ cd anonfiles.dart

# Get deps.
$ dart pub get

# Dart code gen for data models.
$ dart run derry run gen:dart:watch
  1. Commit and push:
git add .
git commit -m "Describe changes"
git push origin main
  1. Open PR.