oss_flutter 0.1.2

  • Readme
  • Changelog
  • Installing
  • 73

oss_flutter #

pure dart oss client for flutter (only support STS authentication)

Only generate signature and http request wrapper instance

your have to implement 2 things

  1. request to update STS token
  2. request to do real http request

Usage #

1. Install #

    oss_flutter: ^0.1.0

2. Initialization #

import 'package:oss_flutter/oss_flutter.dart';

final client = Client('url to fetch sts token', 'oss bucket domain', (url) async{
    // use your favorite http lib to fetch sts token
    // return as 
    //    "AccessKeyId": "STS.NJt3c8tHjMzwzPvxoB6QHFwLY", 
    //    "AccessKeySecret": "2momjH1gfJ9RFA57cPwTA1of6Pr29qijGGkeXsVyoSqt", 
    //   "Expiration": "2019-06-23T16:40:01Z", 
    //    "SecurityToken": "CAIS9gF1q6Ft5B2yfSjIr4nBeNmMmZdL+riceHbHnG8XOt5kqbLnuzz2IH9OeHhqB+kWsPkyn2FW7fwalrh+W4NIX0rNaY5t9ZlN9wqkbtJUNnF0PflW5qe+EE2/VjTZvqaLEcibIfrZfvCyESOm8gZ43br9cxi7QlWhKufnoJV7b9MRLGLaBHg8c7UwHAZ5r9IAPnb8LOukNgWQ4lDdF011oAFx+wgdgOadupDGtUOC0QCilrZM99yre8WeApMybMcvYbCcx/drc6fN6ilU5iVR+b1+5K4+omid4oDHXQABvUjbaLuKqYc3NmF+fbMzEKVUczQjVFHbfI0agAEqTKBFvjnmklHx9Gg8O9Hw4V0oIhmodRXGMT0NxFSBa+GghJOrfjNiNl60P8Z72OOsww2fXsubwkz7u9dAifyb8oZ0z1o60NRCBXOZxSFxOHDpljq+wByr4yE2n5qIkjeqSkJrMKnhBxtXKGEbyIU8WdJXjOkQxWaxIEXlFgfE1A==", 
    //    "StatusCode": 200

3 Access OSS Services #

final req = client.list_buckets() // return wrapper
// make real http request with req use your favorite http lib


0.0.1 init version #

  1. list buckets
  2. put object
  3. delete object

0.0.2 #

  1. Add more mimetypes

0.0.3 #

  1. Add a getter returns the url with parameters

0.0.4 #

  1. Fix bugs of json decode

0.0.5 #

  1. Fix bugs of null or empty determine

0.0.6 #

  1. Fix bugs of null or empty determine 2

0.0.7 #

  1. Use String instead of Map to solve the cast problem

0.0.8 #

  1. Fix bugs in asUrl

0.1.0 #

  1. Add fileData getter

0.1.1 #

  1. Change Date format

Use this package as a library

1. Depend on it

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

  oss_flutter: ^0.1.2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or 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:oss_flutter/oss_flutter.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 Nov 8, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:oss_flutter/oss_flutter.dart.

Health suggestions

Fix lib/src/oss.dart. (-5.84 points)

Analysis of lib/src/oss.dart reported 12 hints, including:

line 6 col 16: Use ; instead of {} for empty constructor bodies.

line 42 col 11: Use isNotEmpty instead of length

line 50 col 18: Don't explicitly initialize variables to null.

line 50 col 27: Use = to separate a named parameter from its default value.

line 74 col 33: Avoid types as parameter names.

Format lib/src/utils.dart.

Run dartfmt to format lib/src/utils.dart.

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (intl).

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.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and oss_flutter.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
crypto ^2.0.6 2.1.3
intl ^0.15.8 0.15.8 0.16.0
Transitive dependencies
charcode 1.1.2
collection 1.14.12
convert 2.1.1
path 1.6.4
typed_data 1.1.6
Dev dependencies
test >=0.12.30 <1.4.0