term_glyph 1.0.1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 91

This library contains getters for useful Unicode glyphs as well as plain ASCII alternatives. It's intended to be used in command-line applications that may run on Windows and libraries that may be used by those applications.

We recommend that you import this library with the prefix "glyph". For example:

import 'package:term_glyph/term_glyph.dart' as glyph;

/// Formats [items] into a bulleted list, with one item per line.
String bulletedList(List<String> items) =>
    items.map((item) => "${glyph.bullet} $item").join("\n");

ASCII Mode

The default Windows cmd.exe shell is unable to display Unicode characters, so this package is able to transparently switch its glyphs to ASCII alternatives by setting the ascii attribute. When this attribute is true, all glyphs use ASCII characters instead. It currently defaults to false, although in the future it may default to true for applications running on the Dart VM on Windows. For example:

import 'dart:io';

import 'package:term_glyph/term_glyph.dart' as glyph;

void main() {
  glyph.ascii = Platform.isWindows;

  // Prints "Unicode => ASCII" on Windows, "Unicode ━▶ ASCII" everywhere else.
  print("Unicode ${glyph.rightArrow} ASCII");
}

All ASCII glyphs are guaranteed to be the same number of characters as the corresponding Unicode glyphs, so that they line up properly when printed on a terminal. The specific ASCII text for a given Unicode glyph may change over time; this is not considered a breaking change.

1.0.1

  • Set max SDK version to <3.0.0.

1.0.0

  • Initial version.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  term_glyph: ^1.0.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:term_glyph/term_glyph.dart';
  
Version Uploaded Documentation Archive
1.0.1 Jul 17, 2018 Go to the documentation of term_glyph 1.0.1 Download term_glyph 1.0.1 archive
1.0.0 Jan 6, 2017 Go to the documentation of term_glyph 1.0.0 Download term_glyph 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
94
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
91
Learn more about scoring.

We analyzed this package on Oct 10, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.4

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:term_glyph/term_glyph.dart.

Maintenance suggestions

The description is too short. (-20 points)

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. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use term_glyph.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <3.0.0
Dev dependencies
csv ^3.0.0
dart_style >=0.2.0 <2.0.0
test >=0.12.0 <2.0.0