ui_core_test 0.1.0
ui_core_test: ^0.1.0 copied to clipboard
Checks for Flutter design systems on ui_core, read from the drawn pixels: rows in line, labels centred, keylines, widths, tap targets, cursors, cut shadows and spacing.
0.1.0 #
The checks a design system's tests run, moved out of ui_core 0.2.1's package:ui_core/alignment.dart into a package
of their own, which a design system takes as a dev dependency. Supports ui_core ^0.3.0.
Moving from ui_core 0.2 #
- Add
ui_core_test: ^0.1.0todev_dependencies(and to a gallery example'sdependencieswhen a page of it showsDesignKeylineSheetorDesignAlignmentSheet). - Change
import 'package:ui_core/alignment.dart';toimport 'package:ui_core_test/ui_core_test.dart';. Every name is as it was:DesignAlignmentMatrix,DesignAlignmentRow,DesignAlignmentEntry,DesignAlignmentBuilder,DesignAlignmentTheme,DesignInlineControl,DesignAlignmentSheet,DesignTextEntryCheck,DesignTextEntryBuilder,DesignKeylineCheck,DesignKeylineSheet,DesignLabelCheck,DesignRowCheck,DesignWidthCheck,DesignWidthLimit,DesignWidthKind,DesignWordBreakCheck,DesignClipCheck,DesignTapTargetCheck,DesignCursorCheck,DesignShadowClipCheck,DesignSpacingCheck,DesignAlignmentReportandDesignAlignmentError. package:ui_core/alignment.dartalso passed onDesignSpacing,DesignSpacingScope,DesignInput,DesignTapTargetsandDesignTapTargetScope; this package does not. They are ui_core's, inpackage:ui_core/ui_core.dart, which a look's barrel passes on.
Fixed since ui_core 0.2.1's checks #
DesignRowCheckleaves out a control another surface covers, wholly or in part: a window in front of it, a later layer of aStackor anOverlay. Where a pointer at its middle, or at the middle of an edge, reaches something painted after it that fills there, what is drawn is that surface, not the control's outline. A row left with one control is not held. What takes the pointer in front and paints nothing (a barrier with no colour) is no cover.DesignWidthCheck.checkListreads a list's edges against the page under it. A list drawn in a repaint boundary of its own size (aDesignAnchoredOverlay's surface) holds nothing of the page round it in its own pixels, so the check took the list's own colour for its ground and a frame line inside the list for its edge (a light list read 5 px narrower than its field, 2.5 px in on each side).DesignRowCheckreads a face a look paints itself to every pixel a person tells from the ground, as its outline is read (contrastFloor). A raised face by night (Retro Platinum: a pale top and left rim, a black bottom and right one, on a dialog of #2e2f36) has bottom and right bands within 64 a channel of the dialog, so read by colour it stopped 1.3 px short there: its bottom read above its neighbour's, its capitals below the row's line.DesignRowCheckreads a row drawn in a layer of its own, clear where it stands (a section in a repaint boundary over the page), in the layer round it, where what lies under it is drawn too. Read against the clear pixels, taken as black, the same black edges were no edge (Retro Platinum's Buttons page by night).DesignWidthCheck.checkListreads a field drawn in a repaint boundary its own size (a paddedListView's child) against the page round it. In its own image nothing of the page is round it, so a field whose rule is its edge had that rule read as ground: the field 2 px in on each side as drawn, and its list "2 px out past" it.DesignWidthCheckleaves out a modal barrier. A dialog's or a sheet's barrier that a tap dismisses is named for a screen reader ('Dismiss') and takes taps, so in an app drawn in a repaint boundary it was read as a button as wide as the barrier, with no content to need it.- Every check runs from a navigator (or anything round an
Overlay) with pages under the top one. A page under an opaque route is offstage: never laid out when it was built there, soDesignCursorCheckand the others asserted "RenderBox was not laid out" on its first transform. The checks read only what is painted: a box never laid out is passed by with what it holds, and an overlay's offstage entries too. DesignLabelCheckreads a label's capitals from the ground under its words, the row of its box nearest the face's colour. A chip lit a little on one side of its words (Frosted's chosen filter chip, a sheen 10 a channel lighter than its face) stood out by more than a sixteenth of its words' ink in every row, so the capitals read from the top of the line box: 30.1 device px high whereDesignCapCentergave 25.2, by where the chip stood.