Colorize console output in dart console apps!
Add dependency to your
You have two way to colorize your string:
For colorize string with
Colorize class you should create object of type
Colorize string = new Colorize("This is my string!");
Then you can call methods of
After apply styles to string you can print it to console:
color apply one required parameter -
String text. It is text, that would be print
Also top-level function
color has seven named parameters:
String front- name of front color (you can also use the constants of class
Styles). Default value is
String back: name of background color (you can also use the constants of class
Styles). Default value is
bool isUnderline- default value is
bool isBold- default value is
bool isDark- default value is
bool isItalic- default value is
bool isReverse- default value is
Example of usage
color("Bold Italic Underline", front: Styles.RED, isBold: true, isItalic: true, isUnderline: true);
Styles contains constants with color's names.
Add this to your package's pubspec.yaml file:
dependencies: colorize: "^0.1.2"
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:
|0.1.2||Oct 27, 2014|
|0.1.1||Oct 27, 2014|
|0.1.0||Oct 27, 2014|
|0.0.1||Oct 27, 2014|
We analyzed this package on May 14, 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: web, other
Changelog entries help clients to follow the progress in your code.
Fix analysis and formatting issues.
Analysis or formatting checks reported 5 errors 5 hints.
Strong-mode analysis of
lib/src/color.dartfailed with the following error:
line: 24 col: 12
The method 'underline' isn't defined for the class 'Colorize'.
Similar analysis of the following files failed:
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.
Package is pre-v1 release.
While there is nothing inherently wrong with versions of
0.*.*, it usually means that the author is still experimenting with the general direction API.
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