Character code constants.
These libraries define symbolic names for some character codes.
Import either one of the libraries:
import "package:charcode/ascii.dart"; import "package:charcode/html_entity.dart";
or import both libraries using the
The character names are preceded by a
$ to avoid conflicting with other
variables due to the short and common names (for example "$i").
The characters that are valid in a Dart identifier directly follow the
$3. Other characters are given symbolic names.
The names of letters are lower-case for lower-case letters, and mixed- or
upper-case for upper-case letters. The names of symbols are all lower-case,
and omit suffixes like "sign", "symbol" and "mark".
ascii.dart library defines a symbolic name for each ASCII character.
For some characters, it has more than one name. For example the common
and the official
$ht for the horizontal tab.
html_entity.dart library defines a constant for each HTML 4.01 character
entity, using the standard entity abbreviation, including its case.
$aring for the lower-case
$Aring for the upper-case
The HTML entities includes all characters in the Latin-1 code page, greek letters and some mathematical symbols.
charcode.dart library just exports both
The Dart language doesn't have character literals. If that ever happens, this library will be irrelevant. Until then, this library can be used for the most common characters. See request for character literals.
- Updated the SDK constraint.
- Initial version
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: charcode: ^1.1.2
2. Install it
You can install packages from the command line:
$ pub get
$ 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:
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 Nov 4, 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 is getting outdated. (-31.51 points)
The package was last published 68 weeks ago.
Maintain an example. (-10 points)
Create a short demo in the
example/ directory to show how to use this package.
Common filename patterns include
charcode.dart. Packages with multiple examples should provide
For more information see the pub package layout conventions.
The description is too long. (-10 points)
Search engines display only the first part of the description. Try to keep the value of the
description field in your package's
pubspec.yaml file between 60 and 180 characters.
|Dart SDK||>=1.0.0 <3.0.0|