rikulo_commons 4.0.1

  • Readme
  • Changelog
  • Installing
  • 59

Rikulo Commons #

Rikulo Commons is a collection of common reusable Dart classes and utilities.

Rikulo Commons is distributed under an Apache 2.0 License.

Build Status

Install #

Add this to your pubspec.yaml (or create it):


Run on Client and/or Server #

Library Run on Server Run on Client
async.dart Yes Yes
browser.dart Yes Yes
io.dart Yes No
logging.dart Yes Yes
mirrors.dart Yes Yes
util.dart Yes Yes

Notes to Contributors #

Fork Rikulo Commons #

If you'd like to contribute back to the core, you can fork this repository and send us a pull request, when it is ready.

Please be aware that one of Rikulo's design goals is to keep the sphere of API as neat and consistency as possible. Strong enhancement always demands greater consensus.

If you are new to Git or GitHub, please read this guide first.

Who Uses #

  • Quire - a simple, collaborative, multi-level task management tool.
  • Keikai - a sophisticated spreadsheet for big data

Rikulo Commons Changes #

4.0.1 #

  • Fix #5

4.0.0 #

  • defer()'s task callback takes the key as the argument. It helps to reuse the same closure for different keys.

3.3.1 #

  • cancelDeferred() added.

3.3.0 #

  • Upgrade to Dart 2.5 or later

3.2.1+1 #

  • Prepare for upcoming breaking changes to HttpRequest in the Dart SDK.

3.2.1 #

  • XmlUtil.encode() supports the entity parameter to escape XML entities.

3.2.0 #

  • ajax() added to simplify HTTP request at server side or flutter.

3.1.3 #

  • The signature of flushDefers() was changed. Use repeatLater: Duration.zero instead of repeat: true.

3.1.0 #

  • Browser.dart not supported.

3.0.0 #

  • Dart 2 required

2.3.0 #

  • The signature of flushDefers() was changed.

2.2.1 #

  • flushDefers() introduced to flush all deferred tasks.

2.2.0 #

  • Browser.version considers, say, 12.1 as a double, 12.01. Thus, 12.10 is larger than 12.1.

2.0.6 #

  • NullTreeSanitizer is removed. Please use NodeTreeSanitizer.trusted instead which was introduced in Dart 1.12.

2.0.5 #

  • NullTreeSanitizer, NullNodeValidator, setUncheckedInnerHtml and createUncheckedHtml are added.

2.0.3 #

  • MapWrapper is introduced to simplify the extension of a map instance.

2.0.1 #

  • XmlUtil.encode() supports the space argument to preserve the right space also able to break lines

2.0.0 #

  • StringUtil's toHexString, addCharCodes, encodeId, filterIn and filterOut have been removed.
  • MapUtil.onDeman has been renamed to MapUtil.auto
  • The html library has been removed.

1.1.5 #

  • addContentType() is introduced to add extra content types that the mime package might not support yet.
  • TreeLink is removed.

1.1.4 #

  • TreeLink is deprecated and will be removed soon.

1.0.3 #

  • AbstractBufferedResponse is added.

1.0.1 #

  • XmlUtil.encode() changed: multiline renamed to multiLine, and maxlength not supported.

1.0.0 #

November 20, 2013

  • EMPTY_SET is added.

0.8.10 #

  • contentTypes and httpStatusMessages are added.
  • ObjectUtil.injectAsync() is removed since Dart removes asynchronous Mirrors API.

0.8.2 #

  • encodeString and decodeString are removed. Please use dart:convert directly.
  • IOUtil is removed and replace with convert.dart.

0.8.0 #

  • defer() in async.dart was introduced to run a costly operation smartly.

0.7.8 #

  • gzip and gzipString were introduced.
  • BufferedResponse renamed to StringBufferedResponse, while BufferedResponse reserved for bytes
  • IOUtil.decode and IOUtil.encode became public methods: decodeString and encodeString.

0.7.6 #

  • The js package was removed (part of Rikulo Gap).

0.7.4 #

  • MapUtil.copy was introduced.
  • The signature CssUtil.copy has been changed. To be consistent with others, the first argument is now the source.

0.7.3 #

  • Browser.size was removed. Use DomUtil.windowSize or window.innerWidth/innerHeight instead.

0.7.2 #

  • ClassUtil and ObjectUtil are both synchronous (no Future required)
  • ClassUtil: renamed invokeObjectMirror to invokeByMirror; newInstanceByClassMirror to newInstanceByMirror

0.7.1 #

  • HttpUtil.decodePostedParameter was introduced to decode the parameters of a POST requests.

0.7.0 #

  • Css was renamed to CssUtil
  • DomAgent was removed and replaced with DomUtil, which is a collection of static utilities.

0.6.8 #

  • encodeString and decodeString are put into IOUtil, and renamed to encode and decode
  • IOUtil.readAsString and readAsJson are added.

0.6.5 #

  • StreamWrapper is added
  • HttpRequestWrapper and HttpResponseWrapper are upgraded to new Dart API

0.6.4 #

  • ObjectUtil is added to inject values into the given object
  • ClassUtil.coerce is added to coerce types

0.6.3 #

  • HttpHeadersWrapper is added.
  • Upgrade to new Dart SDK.
  • StreamProvider and CapturableStreamProvider are added.

0.6.2 #


  • StringUtil, MapUtil and many others are added.
  • HttpRequestWrapper and HttpRespnseWrapper are added.

Use this package as a library

1. Depend on it

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

  rikulo_commons: ^4.0.1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

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

3. Import it

Now in your Dart code, you can use:

import 'package:rikulo_commons/async.dart';
import 'package:rikulo_commons/browser.dart';
import 'package:rikulo_commons/convert.dart';
import 'package:rikulo_commons/html.dart';
import 'package:rikulo_commons/io.dart';
import 'package:rikulo_commons/logging.dart';
import 'package:rikulo_commons/mirrors.dart';
import 'package:rikulo_commons/util.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 19, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4

Health suggestions

Fix lib/src/mirrors/classes.dart. (-16.93 points)

Analysis of lib/src/mirrors/classes.dart reported 37 hints, including:

line 22 col 1: Prefer using /// for doc comments.

line 24 col 3: Prefer using /// for doc comments.

line 38 col 11: DO use curly braces for all flow control structures.

line 44 col 3: Prefer using /// for doc comments.

line 52 col 7: DO use curly braces for all flow control structures.

Fix lib/src/io/http_wrapper.dart. (-11.33 points)

Analysis of lib/src/io/http_wrapper.dart reported 24 hints, including:

line 6 col 1: Prefer using /// for doc comments.

line 196 col 1: Prefer using /// for doc comments.

line 208 col 3: Avoid return types on setters.

line 215 col 3: Avoid return types on setters.

line 222 col 3: Avoid return types on setters.

Fix lib/browser.dart. (-10.44 points)

Analysis of lib/browser.dart reported 22 hints, including:

line 6 col 1: Prefer using /// for doc comments.

line 23 col 3: Prefer using /// for doc comments.

line 25 col 3: Prefer using /// for doc comments.

line 35 col 3: Prefer using /// for doc comments.

line 37 col 3: Prefer using /// for doc comments.

Fix additional 18 files with analysis or formatting issues. (-78.61 points)

Additional issues in the following files:

  • lib/src/util/strings.dart (20 hints)
  • lib/src/util/color.dart (17 hints)
  • lib/src/util/maps.dart (17 hints)
  • lib/src/util/xmls.dart (16 hints)
  • lib/src/async/stream_provider.dart (15 hints)
  • lib/src/async/async_util.dart (13 hints)
  • lib/src/io/http_util.dart (13 hints)
  • lib/src/util/lists.dart (9 hints)
  • lib/src/io/gzip_util.dart (8 hints)
  • lib/src/mirrors/objects.dart (8 hints)
  • lib/src/io/content_type.dart (6 hints)
  • lib/util.dart (6 hints)
  • lib/convert.dart (4 hints)
  • lib/html.dart (4 hints)
  • lib/logging.dart (4 hints)
  • lib/src/io/iosink_wrapper.dart (2 hints)
  • lib/src/async/stream_wrapper.dart (Run dartfmt to format lib/src/async/stream_wrapper.dart.)
  • lib/src/mirrors/error.dart (Run dartfmt to format lib/src/mirrors/error.dart.)

Maintenance issues and suggestions

No valid SDK. (-20 points)

The analysis could not detect a valid SDK that can use this package.

Use constrained dependencies. (-20 points)

The pubspec.yaml contains 3 dependencies without version constraints. Specify version ranges for the following dependencies: charcode, logging, mime.

The package description is too short. (-17 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 rikulo_commons.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Homepage URL is insecure. (-5 points)

Update the homepage field and use a secure (https) URL.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.5.0 <3.0.0
charcode any 1.1.2
logging any 0.11.4
mime any 0.9.6+3
Dev dependencies
test any