Git Product home page Git Product logo

dart_api_collection's Introduction

Dart wrappers for known media services on internet

⚠️ Not all error catched (yet), please open an issue or PR, if any error exist

Services available

void main() async {
  final key = Platform.environment['DOODSTREAM_API_KEY']!;
  final doodstreamClient = DoodstreamApi(key);
  final getAccount = await doodstreamClient.accountInfo();
  print(getAccount?.toJson());
}
void main() async {
  final user = Platform.environment['STREAMTAPE_USER']!;
  final key = Platform.environment['STREAMTAPE_KEY']!;
  final streamtapeClient = StreamtapeApi(user, key);
  final getAccount = await streamtapeClient.accountInfo();
  print(getAccount?.toJson());
}
void main() async {
  final user = Platform.environment['MIXDROP_EMAIL']!;
  final key = Platform.environment['MIXDROP_KEY']!;
  final mixdropClient = MixdropApi(user, key);
  final listFolder = await mixdropClient.folderList();
  print(listFolder?.toJson());
}
void main() async {
  final token = Platform.environment['GOFILE_TOKEN']!;
  final gofileClient = GofileApi(token);
  final getAccount = await gofileClient.accountInfo();
  print(getAccount?.toJson());
}

Listening to Upload/Download progress

  • To listen for upload/download task, just add code below to your app
transferProgress.stream.listen((e) => print(e));
  • You can also filter specific upload/download task
import 'dart:io';
import 'package:dart_api_collection/dart_api_collection.dart';

void main() async {
ApiConfig.logConfig
  ..enableLog = true
  ..showResponseHeader = false; // Add log for easy debuging
final file = File('video.mp4');
final id = await file.id; // Extension on dart:io File, exported by this package

/// Filter by file ID
transferProgress.stream.where((event) => event.id == id).listen((e) => print(e));
final gofileClient = GofileApi(); // Gofile provide free upload without API key

final result = await gofileClient.uploadFile(file);
print(result?.toJson());
}

Get raw JSON String as result instead of prebuild model

void main()async{
ApiConfig.logConfig
  ..enableLog = true
  ..showResponseHeader = false;
final key = Platform.environment['DOODSTREAM_API_KEY']!;
final doodstreamClient = DoodstreamApi(key);
final getAccount = await doodstreamClient.rawApi.accountInfo(); // Using rawApi directive
print(getAccount); // Print a JSON string
}

- TODO List:

dart_api_collection's People

Contributors

devsdocs avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.