ui_core_test library

Checks for design systems built on ui_core, read from what is drawn: controls that line up where they share a row, labels on their faces' middles, cards on shared keylines, widths, word breaks and clips, tap targets, cursors, cut shadows and spacing, and the sheets that draw them for review. A design system's tests take it as a dev dependency, as an app takes flutter_test.

Classes

DesignAlignmentEntry
One control of a DesignAlignmentRow: its kind and how the look builds it.
DesignAlignmentMatrix
A look's controls that share a line, row by row, and the themes they are checked under. Every kind of DesignInlineControl is in a row or in absent with the reason.
DesignAlignmentReport
What a check found: one line per problem, and the advisories a check reports without failing (a rule still learning its cases).
DesignAlignmentRow
The controls of one size that may share a line: each the same height, on the same centre, with its label's capitals on that centre.
DesignAlignmentSheet
The matrix drawn for a person: each row at zoom times its size under one of the look's themes, with the row's centre line (blue), each control's box (grey) and each label's baseline (red) marked.
DesignClipCheck
Whether everything on a screen shows whole: no control and no line of words cut by a clip.
DesignCursorCheck
Whether every control on a screen shows a pointer that says it acts: over its whole hit area while it is live, and nothing of its own while it is off.
DesignKeylineCheck
Whether the content of each DesignKeylineRegion on a screen starts on one leading keyline and ends on one trailing keyline (or on an indent the region declares), and whether controls that share a row there share a height and a centre line, by their faces' boxes (DesignRowCheck holds a row's controls by their drawn outlines).
DesignKeylineSheet
Draws child with each DesignKeylineRegion in it outlined, its keylines (leading blue, trailing green) and every edge off them (red), for a look's review page. It measures after each layout of child (reading pixels takes a moment), so the lines appear a frame late.
DesignLabelCheck
Whether the words and the icon each control on a screen shows sit on the middle of its face, up and down, as they are drawn, and a chosen control's fill fills its cell.
DesignRowCheck
Checks that the controls sharing a row line up as a person sees them: by their drawn outlines, not their boxes.
DesignShadowClipCheck
Whether every shadow, glow and rim on a screen shows whole: none is cut flat by a clip round it, and none is square behind a round face.
DesignSpacingCheck
Whether a screen keeps its spacing: one page margin that its floating bars and sheets start on too, a shape inside a shape set in by one inset all round with corners that follow the outer ones, and repeated items standing evenly apart.
DesignTapTargetCheck
Whether every tap target on a screen takes a tap where a finger, a pointer and a screen reader are told it is: the area a tap reaches is at least the floor for what reaches the controls (input: 44 by 44 for a finger, 24 by 24 for a pointer, or the look's own from its DesignTapTargetScope), and it is the box a screen reader outlines, whatever the input.
DesignTextEntryCheck
A look's text entries (a field, a search, a composer, a number, a select you type in), checked for the one structure that keeps a line of text where it belongs whatever the platform, density, text size or host theme: the look's own box, the typed text's capitals on its middle, the hint on the typed text's baseline, and nothing else in the editable's decoration.
DesignWidthCheck
Whether a screen's controls keep to the width of what they show, and a list opened from a field to the field's.
DesignWidthLimit
A width a look allows one kind of control, from DesignWidthCheck.from up, with the reason: what a look declares when it means a control wider than DesignWidthCheck.maxWidth.
DesignWordBreakCheck
Whether every word on a screen stands whole on one line: none broken across two.

Enums

DesignInlineControl
A kind of control that shares a line with others.
DesignWidthKind
The controls DesignWidthCheck holds to the width of what they show.

Typedefs

DesignAlignmentBuilder = Widget Function(BuildContext context, String label)
Builds a look's control showing label: a button's text, a field's hint, a select's value, a chip's or a list tile's title. It is given at most 240 logical pixels of width, and a field takes what it is given.
DesignAlignmentTheme = Widget Function(BuildContext context, Widget child)
Puts child where a look's page would have it: under the look's theme and, for a Material look, a Material.
DesignTextEntryBuilder = Widget Function(BuildContext context, TextEditingController controller, String hint)
Builds one of a look's text entries around controller, showing hint while it is empty.

Exceptions / Errors

DesignAlignmentError
A look's controls out of line, as DesignAlignmentReport.verify throws it.