A library for consistently representing identifiers, usually in a code generation setting.
The purpose of the library is to have a standard way of generating an object, an Id, that can be used in any of a variety of casing contexts.
For example, suppose you are writing a code generator that has a need for a single id with multiple representations. The following representations are covered:
The default constructor requires the identifier to be snake case:
var id = new Id('how_now_brown_cow'); print(id); // => howNowBrownCow print(id.snake); // => how_now_brown_cow print(id.emacs); // => how-now-brown-cow print(id.shout); // => HOW_NOW_BROWN_COW print(id.camel); // => howNowBrownCow print(id.capCamel); // => HowNowBrownCow print(id.title); // => How Now Brown Cow print(id.squish); // => hownowbrowncow print(id.abbrev); // => hnbc
An library function accepts either snake or any camel and returns a new Id:
var id = idFromString('testName');
Add this to your package's pubspec.yaml file:
dependencies: id: ^1.0.16
You can install packages from the command line:
$ pub get
Alternatively, your editor might support
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
|1.0.16||May 27, 2017|
|1.0.15||Jun 8, 2016|
|1.0.13||Feb 7, 2016|
|1.0.12||Sep 5, 2015|
|1.0.11||Aug 21, 2015|
|1.0.10||May 20, 2015|
|1.0.9||Apr 20, 2015|
|1.0.8||Apr 12, 2015|
|1.0.7||Apr 11, 2015|
|1.0.6||Apr 3, 2015|
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]
The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.
Support Dart 2 in
The SDK constraint in
pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.
dartdoc successfully runs on your package's source files. (-10 points)
Dependencies were not resolved.
|Dart SDK||>=1.8.2 <2.0.0|