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
$ flutter packages get
Alternatively, your editor might support
pub get or
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||failed|
|1.0.13||Feb 7, 2016||failed|
|1.0.12||Sep 5, 2015||failed|
|1.0.11||Aug 21, 2015||failed|
|1.0.10||May 20, 2015||failed|
|1.0.9||Apr 20, 2015||failed|
|1.0.8||Apr 12, 2015||failed|
|1.0.7||Apr 11, 2015||failed|
|1.0.6||Apr 3, 2015||failed|
We analyzed this package on Apr 23, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
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]
Detected platforms: Flutter, web, other
No platform restriction found in primary library
Changelog entries help clients to follow the progress in your code.
Fix analysis and formatting issues.
Analysis or formatting checks reported 1 error 4 hints.
Strong-mode analysis of
lib/id.dartfailed with the following error:
line: 23 col: 3
Invalid override. The type of 'Id.==' ('(Id) → bool') isn't a subtype of 'Object.==' ('(dynamic) → bool').
The description is too short.
Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.
Maintain an example.
Create a short demo in the
example/directory to show how to use this package. Common file name patterns include:
example.dartor you could also use