Rikulo Commons #
Rikulo Commons is a collection of common reusable Dart classes and utilities.
Rikulo Commons is distributed under an Apache 2.0 License.
Add this to your
pubspec.yaml (or create it):
Run on Client and/or Server #
|Library||Run on Server||Run on Client|
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 #
Rikulo Commons Changes #
- Fix #5
taskcallback takes the key as the argument. It helps to reuse the same closure for different keys.
- Upgrade to Dart 2.5 or later
- Prepare for upcoming breaking changes to
HttpRequestin the Dart SDK.
entityparameter to escape XML entities.
ajax()added to simplify HTTP request at server side or flutter.
- The signature of flushDefers() was changed. Use
repeatLater: Duration.zeroinstead of
- Dart 2 required
- The signature of flushDefers() was changed.
- flushDefers() introduced to flush all deferred tasks.
- Browser.version considers, say,
12.1as a double,
12.10is larger than
- NullTreeSanitizer is removed. Please use NodeTreeSanitizer.trusted instead which was introduced in Dart 1.12.
- NullTreeSanitizer, NullNodeValidator, setUncheckedInnerHtml and createUncheckedHtml are added.
- MapWrapper is introduced to simplify the extension of a map instance.
- XmlUtil.encode() supports the space argument to preserve the right space also able to break lines
- 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.
- addContentType() is introduced to add extra content types that the mime package might not support yet.
- TreeLink is removed.
- TreeLink is deprecated and will be removed soon.
- AbstractBufferedResponse is added.
- XmlUtil.encode() changed: multiline renamed to multiLine, and maxlength not supported.
November 20, 2013
- EMPTY_SET is added.
- contentTypes and httpStatusMessages are added.
- ObjectUtil.injectAsync() is removed since Dart removes asynchronous Mirrors API.
- encodeString and decodeString are removed. Please use dart:convert directly.
- IOUtil is removed and replace with convert.dart.
- defer() in async.dart was introduced to run a costly operation smartly.
- 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.
- The js package was removed (part of Rikulo Gap).
- MapUtil.copy was introduced.
- The signature CssUtil.copy has been changed. To be consistent with others, the first argument is now the source.
- Browser.size was removed. Use DomUtil.windowSize or window.innerWidth/innerHeight instead.
- ClassUtil and ObjectUtil are both synchronous (no Future required)
- ClassUtil: renamed invokeObjectMirror to invokeByMirror; newInstanceByClassMirror to newInstanceByMirror
- HttpUtil.decodePostedParameter was introduced to decode the parameters of a POST requests.
- Css was renamed to CssUtil
- DomAgent was removed and replaced with DomUtil, which is a collection of static utilities.
- encodeString and decodeString are put into IOUtil, and renamed to encode and decode
- IOUtil.readAsString and readAsJson are added.
- StreamWrapper is added
- HttpRequestWrapper and HttpResponseWrapper are upgraded to new Dart API
- ObjectUtil is added to inject values into the given object
- ClassUtil.coerce is added to coerce types
- HttpHeadersWrapper is added.
- Upgrade to new Dart SDK.
- StreamProvider and CapturableStreamProvider are added.
- 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:
dependencies: rikulo_commons: ^4.0.1
2. Install it
You can install packages from the command line:
$ pub get
Alternatively, your editor might support
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]
We analyzed this package on Dec 10, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.7.0
- pana: 0.13.1+4
lib/src/mirrors/classes.dart. (-16.93 points)
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.
lib/src/io/http_wrapper.dart. (-11.33 points)
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.
lib/browser.dart. (-10.44 points)
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.11 points)
Additional issues in the following files:
Maintenance issues and suggestions
Use constrained dependencies. (-20 points)
pubspec.yaml contains 3 dependencies without version constraints. Specify version ranges for the following dependencies:
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
rikulo_commons.dart. Packages with multiple examples should provide
For more information see the pub package layout conventions.
Homepage URL is insecure. (-5 points)
homepage field and use a secure (