Term Style :dancer:
Making your Dart command-line apps funky! :dancer:
About :books:
I always thought that the output of command-line apps was just a slew of text and a little bit boring. So I decided to spice things up a little! Term Style gives you the ability to use emojis and colors in your terminal!
What's available?
Colors
In terms of colors, these colors are currently provided by Term Style:
- Red
- Green
- Blue
- Cyan
- Magenta
- Yellow
Emojis
In terms of emojis, these emojis are currently provided by Term Style in four different categories:
Faces
grinningFace
: :grinning:laughCry
: :joy:upsideDownFace
: :upside_down_face:heartsInFace
: :smiling_face_with_three_hearts:smilingFace
: :blush:haloFace
: :innocent:winkingFace
: :wink:kissingFace
: :kissing_closed_eyes:angryFace
: :angry:crazyFace
: :zany_face:thinkingFace
: :thinking:naughtyface
: :smiling_imp:
Animals
seeNoEvil
: :see_no_evil:animalGorilla
: :gorilla:windCloud
: :dash:sweatDroplets
: :sweat_drops:dogFace
: :dog:unicornHead
: :unicorn:catFace
: :cat:horseHead
: :horse:pandaFace
: :panda_face:bearFace
: :bear:tigerFace
: :tiger:
Symbols
readHeart
: :heart:blackHeart
: :black_heart:backArrow
: :back:soonArrow
: :soon:topArrow
: :top:infinitySign
: :infinity:multiplySign
: :heavy_multiplication_x:plusSign
: :heavy_plus_sign:divideSign
: :heavy_division_sign:minusSign
: :heavy_minus_sign:tickSign
: :heavy_check_mark:
Tools
kitchenKnife
: :knife:scissors
: :scissors:bomb
: :bomb:gun
: :gun:hammer
: :hammer:wrench
: :wrench:hammerAndWrench
: :hammer_and_wrench:hammerAndPick
: :hammer_and_pick:pick
: :pick:woodSaw
:not supported by GitHub markdown
axe
: :axe:
Installation :inbox_tray:
Adding to your project
To add TermStyle to your project's dependencies, add this to your project's pubspec.yaml
:
From GitHub
dependencies:
...
termstyle:
git: git://github.com/iamtheblackunicorn/TermStyle.git
From Pub.dev
dependencies:
...
termstyle: ^1.1.0
The three dots represent anything else that you might have in the dependencies
section.
Having done that, re-fetch your project's dependencies by running this in the project's root directory:
$ dart pub get
Usage :hammer:
Importing
To import the color module into your code, use this line:
import 'package:termstyle/colors.dart';
To import the emoji module into your code, use this line:
import 'package:termstyle/emojis.dart';
API
Emojis
Map<String, dynamic> emojiDataBase()
This method returns a database of 44 select emojis in form of a map in four select categories.
String getEmoji(String emoji)
This method returns an emoji by its name as a string.
void printEmoji(String emoji)
This method prints an emoji by its name to the console.
void testAllEmojis()
This method iterates over the emoji database, once getting and printing a string by the name of the emoji, and once by directly printing a string by the name of the emoji to the console.
Colors
Map<String, dynamic> termColors()
This method is a database of all the six colors for pretty console colors. It returns a map.
String getColoredString(String message, String userColor)
This method returns a string in the specified color.
void printColoredString(String message, String userColor)
This method prints a string in the specified color to the console.
void testAllColors()
This method tests all available colors.
Note :scroll:
- TermStyle by Alexander Abraham a.k.a. The Black Unicorn
- licensed under the MIT license