Glyphs class final
The marks widgets draw, by what each means (a check, a cross, a cursor bar, a scrollbar's thumb) and not by the widget that draws it: a mark is one field, whichever widgets show it. An app picks a set for itself or for a part of it, in the theme (ThemeData.glyphs), as it picks colors.
The presets: Glyphs.unicode, the default, the marks the widgets draw without a theme of their own; and Glyphs.ascii, ASCII only, for a terminal or a font without the others. copyWith changes some marks of a set; each mark is a string of one column unless its doc says otherwise, and the widgets lay out by the width the terminal gives it (in cells, not code units).
One rule, kept in one place (ThemeMarks, with a descriptor for each
mark in Marks): a mark drawn in one cell or as text in a row that is
not one column wide (an emoji, an ambiguous mark in some terminals), or
is a cluster of more than one code point (a letter and a combining
accent), is the same field of Glyphs.ascii there, with one warning in
the app's log for each such mark; the width is the terminal's, so it is
known only when the mark is drawn. It holds for a mark filled into a
cell (a scrollbar's thumb, a gauge) and for one drawn as text (a radio
button's, a switch's, a button's edge, a chip's close, a pagination's
arrows) alike. An empty mark draws nothing and breaks nothing: what it
draws is the Mark.onEmpty of its descriptor, nothing for most, a
blank for the track of a scrollbar, a slider's, switchKnob and
previous and next, and Glyphs.ascii's for a thumb or the line of a
gauge. The checkbox is as the radio button is: its marks checkboxOn
and checkboxOff are one cell each, and the checkboxBrackets around
them are text of their own. A widget gets the marks with
ThemeMarks.of(context), a render object with ThemeMarks.ofObject.
Borders are in it too: lines is the line of every box, divider, split
and callout given no type of its own, and a set of ASCII lines draws
every type but none as ASCII (borderOf), also where a widget names
a type of its own (rounded, heavy, double), so Glyphs.ascii makes
the whole app ASCII. The charts are in it, where partialBlocks is false:
bars in the ramp of shades, dots as the shade as dense as their number.
So is the ellipsis a Text or a Box title is cut with: ellipsis,
whose columns are counted in the room. Not in it: the pictures of
images.
A widget's own parameter for a mark it has (Spinner.frames,
RadioGroup.mark, Skeleton.glyph, a Callout's icon) stays above
the theme: the glyph set is what a widget draws when it is not given
one.
A check of another shape in the whole app, or ASCII for it all:
final data = ThemeData.dark.copyWith(
glyphs: Glyphs.unicode.copyWith(check: '✔'),
);
final plain = ThemeData.dark.copyWith(glyphs: Glyphs.ascii);
For one part of the app, a Theme around it:
Theme(
data: ThemeData.dark.copyWith(glyphs: Glyphs.ascii),
child: const Scrollbar(child: Text('plain')),
)
See also:
- ThemeData, which holds the set.
- Annotations
-
- @immutable
Constructors
-
Glyphs({String cursor = '▎', String accent = '▌', String check = '✓', String checkBold = '✔', String cross = '✗', String info = 'ℹ', String warning = '⚠', String checkboxOn = 'x', String checkboxOff = ' ', (String, String) checkboxBrackets = ('[', ']'), String radioOn = '●', String radioOff = ' ', (String, String) radioBrackets = ('(', ')'), String switchStart = '▐', String switchEnd = '▌', String switchKnob = '●', String stepCurrent = '●', String ring = '○', String expanded = '▾', String collapsed = '▸', String up = '▴', String down = '▾', String previous = '‹', String next = '›', String first = '«', String last = '»', String close = '×', String maximise = '□', String restore = '▣', String minimise = '_', String bullet = '•', String taskPending = '◦', String taskSkipped = '↓', String separator = '│', (String, String) buttonEdges = ('▕', '▏'), String trackVertical = '│', String trackHorizontal = '─', String thumbVertical = '┃', String thumbHorizontal = '━', String thumbSlim = '▐', bool partialBlocks = true, String gaugeFilled = '─', String gaugeHalf = '╴', String gaugeEmpty = '─', SpinnerFrames spinner = SpinnerFrames.dots, BorderType lines = BorderType.single, String arrowLeft = '←', String arrowRight = '→', String arrowUp = '↑', String arrowDown = '↓', String pointer = '▶', List<
String> shades = const [' ', '░', '▒', '▓', '█'], String swatch = '■', String ellipsis = '…', String omitted = '⋯'}) -
A set of marks; each one left out is that of Glyphs.unicode.
const
- Glyphs.lerp(Glyphs a, Glyphs b, double t)
-
The set
tof the way fromatob: marks do not blend, soa's before halfway andb's after it.factory
Properties
- accent → String
-
The heavier bar at the edge of a toast.
final
- arrowDown → String
-
An arrow down: a key hint's, a dock's side, the log view's "new lines
below".
final
- arrowLeft → String
-
An arrow to the left: a key hint's, a dock's side to drop on.
final
- arrowRight → String
-
An arrow to the right.
final
- arrowUp → String
-
An arrow up: a key hint's, a dock's side to drop on.
final
- bullet → String
-
A bullet between items on a line, and the mask of a hidden text.
final
-
The left and the right edge of a one-row button, a column each:
▕and▏, so a chip's label stands between thin bars. An edge that is not one column wide and one code point is Glyphs.ascii's[or], with a warning; an empty one is no edge.final - check → String
-
A done, chosen or succeeded mark: a menu's checked entry, a chip's
selection, a segmented button's, a finished task, the
successkind.final - checkBold → String
-
The check of a finished prompt or step, heavier than check.
final
- checkboxBrackets → (String, String)
-
The characters either side of a checkbox's mark,
[and]; an empty string for none, as in('', '')for✓ ·. Drawn in theCheckbox'sbracketStyle.final - checkboxOff → String
-
The mark of a checkbox that is off, a space by default (
[ ]). Drawn in the mark's style, as checkboxOn is.final - checkboxOn → String
-
The mark of a checkbox that is on, between its checkboxBrackets and
before its label:
x, so[x]. checkboxOff has its width.final - close → String
-
Close, remove or dismiss: a chip's, a window's, a callout's.
final
- collapsed → String
-
What is closed: a node that hides its children, a menu entry with a
submenu.
final
- cross → String
-
A failed or invalid mark: the
errorkind, a failed task, an error line of a prompt.final - cursor → String
-
The bar at the left of the row the cursor is on in a list, a menu or
a file picker.
final
- down → String
-
A small arrow down: a stepper's decrease, a table sorted
descending, a select's or a date picker's list to open.
final
- ellipsis → String
-
The mark of text cut short, in the rows of a widget that cuts its own
text (a breadcrumb, a page list, a JSON view), and that of a cut
TextandBoxtitle, which the core takes as a value (RenderParagraph.ellipsis). It may be longer than one column (...): its columns come out of the room.final - expanded → String
-
What is open: a tree's or an expansion tile's node that shows its
children, the closed select's arrow.
final
- first → String
-
Go to the first page. A string of one or two columns.
final
- gaugeEmpty → String
-
The rest of a
LineGauge.final - gaugeFilled → String
-
The filled part of a
LineGauge.final - gaugeHalf → String
-
The filled part's last half cell of a
LineGauge; empty for a set that has none, whole cells then.final - hashCode → int
-
The hash code for this object.
no setteroverride
- info → String
-
The icon of the
infokind of status and toast.final - last → String
-
Go to the last page.
final
- lines → BorderType
-
The lines of a box, a divider, a split's bar, a callout, a tree's
guides and a rule, for every one given no type of its own
(
Border.type,Divider.typeand the like are null then): BorderType.single, or BorderType.ascii (+-|).final - maximise → String
-
A window's maximise button.
final
-
The menu toggle of a scaffold: three bars.
final
- minimise → String
-
A window's minimise button.
final
- next → String
-
Go to the next.
final
- omitted → String
-
The mark of lines left out of a view, a row standing for what is not
shown (the unchanged lines a diff folds): a midline
⋯in Glyphs.unicode,...in Glyphs.ascii, so a row that begins with it reads the same in both. Text in a row, not a cell: it may be longer than one column, and the row measures it; the one-column rule of Marks is not applied to it.final - partialBlocks → bool
-
Whether a scrollbar's thumb and a slider's may draw with the block
elements that cover a part of a cell (eighths), where the terminal
draws them one column wide; else whole cells of thumbVertical and
thumbHorizontal.
final
- pointer → String
-
What points at a row: the row of a traceback the error is in.
final
- previous → String
-
Go to the previous: a tab strip's edge, a stepper's left arrow, a
pagination's previous page.
final
- radioBrackets → (String, String)
-
The characters either side of a radio button's mark,
(and); an empty string for none, as in('', '')for◉ ○. Drawn in theRadioGroup'sbracketStyle.final - radioOff → String
-
The mark of a radio button that is not chosen, a space by default
(
( )); a ring as○for a set with no brackets. Drawn in the brackets' style.final - radioOn → String
-
The mark of a radio button that is chosen, between its
radioBrackets and before its label:
●, so(●). radioOff has its width.RadioGroup.markreplaces it.final - restore → String
-
A maximised window's button to restore it.
final
- ring → String
-
An empty ring: a step not done yet.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- separator → String
-
The line between the segments of a segmented button.
final
-
shades
→ List<
String> -
The shades of a fill, from none to full, at least two: a blank, a
light, a medium, a dark and a full cell. A heatmap's ramp; the
skeleton's mark is the light one (index 1). A
constconstructor cannot check the length, so only copyWith asserts it, and only of a list it is given; the charts,SkeletonandHeatmapdraw with a shorter one (ThemeMarks.ramp) rather than throw. The list copyWith is given is copied unmodifiable, so the caller's list changing later does not change the set; aconstconstructor cannot copy, so a list given to it is the caller's own.final - spinner → SpinnerFrames
-
The frames of a
Spinnergiven none, and of the running task of a list.final - stepCurrent → String
-
The step in hand of a stepper, being edited: a filled dot, as
ring is a step not done yet.
final
- swatch → String
-
A solid square: a swatch of a color, the centre of a dock's target.
final
- switchEnd → String
-
The right end of a switch's track.
final
- switchKnob → String
-
A switch's knob, a filled dot, on its track between switchStart
and switchEnd.
final
- switchStart → String
-
The left end of a switch's track; the knob is switchKnob.
final
- taskPending → String
-
The mark of a task not started (
TaskStatus.pending).final - taskSkipped → String
-
The mark of a task skipped (
TaskStatus.skipped).final - thumbHorizontal → String
-
A horizontal scrollbar's thumb at rest.
final
- thumbSlim → String
-
The thumb of an options list, in its last column: a half cell at the
edge, on the list's own background, where thumbVertical is a whole
cell's line over a trackVertical the list does not draw.
final
- thumbVertical → String
-
A vertical scrollbar's thumb at rest.
final
- trackHorizontal → String
-
A horizontal scrollbar's track.
final
- trackVertical → String
-
A vertical scrollbar's track.
final
- up → String
-
A small arrow up: a stepper's increase, a table sorted ascending.
final
- warning → String
-
The icon of the
warningkind of status and toast.final
Methods
-
borderOf(
BorderType? type) → BorderType -
typeas it is drawn in this set: lines wheretypeis null, and BorderType.ascii where lines is that andtypeis any line but BorderType.none; elsetypeas it is. -
copyWith(
{String? cursor, String? accent, String? check, String? checkBold, String? cross, String? info, String? warning, String? checkboxOn, String? checkboxOff, (String, String)? checkboxBrackets, String? radioOn, String? radioOff, (String, String)? radioBrackets, String? switchStart, String? switchEnd, String? switchKnob, String? stepCurrent, String? ring, String? expanded, String? collapsed, String? up, String? down, String? previous, String? next, String? first, String? last, String? close, String? maximise, String? restore, String? minimise, String? bullet, String? taskPending, String? taskSkipped, String? separator, (String, String)? buttonEdges, String? trackVertical, String? trackHorizontal, String? thumbVertical, String? thumbHorizontal, String? thumbSlim, bool? partialBlocks, String? gaugeFilled, String? gaugeHalf, String? gaugeEmpty, SpinnerFrames? spinner, BorderType? lines, String? arrowLeft, String? arrowRight, String? arrowUp, String? arrowDown, String? pointer, List< String> ? shades, String? swatch, String? ellipsis, String? omitted}) → Glyphs -
This set with the marks given in place of its own; a
gaugeHalfof''leaves it with no half cell. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Constants
- ascii → const Glyphs
-
ASCII only:
+-|for lines,>for a cursor,vfor a check,xfor a cross and a close,[/]ends of a switch and a button's edge,#for a scrollbar's thumb on a|or-track,=for the filled part of a line gauge,vand>for what is open and closed,<>^vfor arrows,.:+#for shades,...for an ellipsis, the spinner-\|/; no mark in eighths of a cell. - unicode → const Glyphs
- The marks the widgets draw with Unicode: the default of ThemeData.glyphs.