aliossflutter 0.0.4

  • Readme
  • Changelog
  • Example
  • Installing
  • 73

aliossflutter #


 static final  String stsserver="";
 static final String endpoint="";
 static final String cryptkey="";
 static final String bucket="";
 static final String key="";
static final String callbackUrl="";
 static final String callbackHost="";
 ///支持 application/x-www-form-urlencoded 和application/json
 static final String callbackBodyType="application/json";
 static final String callbackBody="{\"j_bucket\":\${bucket},\"j_object\":\${object},\"j_etag\":\${etag},\"j_size\":\${size},\"j_mimeType\":\${mimeType},\"j_height\":\${imageInfo.height},\"j_width\":\${imageInfo.width},\"j_format\":\${imageInfo.format},\"j_memberId\":\${x:var1}}";
 static final String callbackVars="{\"x:var1\":\"123\"}";

阿里云oss 初始化一次就可以了,可以在main.dart里初始化,插件会自动管理sts token过期

 "StatusCode": 200,


 "Data": "3des加密后的 sts"


import 'package:aliossflutter/aliossflutter.dart';
AliOSSFlutter  alioss=AliOSSFlutter();
alioss.init("sts url", "");
//可选一种 sts token 3DES加密方式
//alioss.init("sts url", "",cryptkey:"key");
      if(data) { 


AliOSSFlutter  alioss=AliOSSFlutter();
alioss.upload("bucket", file.path, "key",callbackBody: Config.callbackBody,callbackBodyType: Config.callbackBodyType,callbackHost: Config.callbackHost,callbackUrl: Config.callbackUrl,callbackVars: Config.callbackVars);
alioss.responseFromUpload.listen((data) {
      if(data.success) {
        setState(() {
          _msg="上传成功 key:"+data.key+" 服务器回调返回值:"+data.servercallback;


AliOSSFlutter  alioss=AliOSSFlutter();, key, path,{process = ""});
alioss.responseFromDownload.listen((data) {
      if(data.success) {
        setState(() {


//type=1 签名私有资源
//type=0 签名公开的访问URL
alioss.signUrl(bucket, key,{type = "0",interval = "1800",process = ""})

      if(data.success) {
        setState(() {
          _msg="url 签名 :"+data.url;
        _msg="url 签名失败";


if(data.key==key) {
 setState(() {


alioss.exist(bucket, key).then((exist) {
      if (exist) {
        _msg = "已存在";
      } else if (!exist) {
        _msg = "不存在";
      setState(() {});
    }).catchError((err) {
      _msg = "错误:$err";
      setState(() {});

写了个插件开发过程,可以参考下 插件开发方法.

0.0.2 #


0.0.1 #

  • TODO: Describe initial release.


aliossflutter_example #

Demonstrates how to use the aliossflutter plugin.

Getting Started #

For help getting started with Flutter, view our online documentation.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  aliossflutter: ^0.0.4

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:aliossflutter/aliossflutter.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 27, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Health issues and suggestions

Document public APIs. (-1 points)

74 out of 74 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/aliossflutter.dart. (-3.45 points)

Analysis of lib/aliossflutter.dart reported 7 hints, including:

line 18 col 26: Close instances of dart.core.Sink.

line 23 col 38: Close instances of dart.core.Sink.

line 28 col 38: Close instances of dart.core.Sink.

line 33 col 36: Close instances of dart.core.Sink.

line 38 col 34: Close instances of dart.core.Sink.

Format lib/response.dart.

Run flutter format to format lib/response.dart.

Maintenance issues and suggestions

The description contains too many non-ASCII characters. (-20 points)

The site uses English as its primary language. The value of the description field in your package's pubspec.yaml field should primarily contain characters used in English.

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
uuid ^2.0.0 2.0.4
Transitive dependencies
charcode 1.1.2
collection 1.14.11 1.14.12
convert 2.1.1
crypto 2.1.4
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8