aliyun_oss_flutter_tko 1.0.6 copy "aliyun_oss_flutter_tko: ^1.0.6" to clipboard
aliyun_oss_flutter_tko: ^1.0.6 copied to clipboard

aliyun oss plugin for flutter. Use this plugin to upload files to aliyun oss.

aliyun_oss_flutter_tko #

aliyun oss plugin for flutter. Use this plugin to upload files to aliyun oss.

Usage #

To use this plugin, add aliyun_oss_flutter_tko as a dependency in your pubspec.yaml file.

OSSClient is a static class

压缩需求 #

现版本已移除图片压缩、宽高获取,如需对视频、图片进行压缩可以使用media_asset_utils

  • ✅ 视频硬编码压缩以及图片仿微信Luban压缩
  • ✅ 视频缩略图获取
  • ✅ 视频和图片的width、height、orientation等信息获取
  • ✅ 保存到相册,支持Android Q+

Example #

import 'package:flutter/material.dart';
import 'package:aliyun_oss_flutter_tko/aliyun_oss_flutter_tko.dart';

void main() {

  // 初始化OSSClient
  OSSClient.init(
    endpoint: 'oss-cn-hangzhou.aliyuncs.com',
    bucket: 'xxxx',
    credentials: () {
      // Future Credentials
      return Credentials.fromJson(response.data);
      // Or Credentials Config
      return Credentials(
        accessKeyId: 'xxxx',
        accessKeySecret: 'xxxx',
      );
    },
  );

  runApp(...);
}

Future<void> upload() async {
  final object = await OSSClient().putObject(
    object: OSSObject
    bucket: xxx, // String?
    endpoint: xxx, // String?
    path: xxx, // String?
  );
}
0
likes
110
points
25
downloads

Publisher

unverified uploader

Weekly Downloads

aliyun oss plugin for flutter. Use this plugin to upload files to aliyun oss.

Documentation

API reference

License

MIT (license)

Dependencies

crypto, dio, flutter, http_parser, intl, path, uuid

More

Packages that depend on aliyun_oss_flutter_tko