Skip to main content

ui_core_test 0.1.1 copy "ui_core_test: ^0.1.1" to clipboard
ui_core_test: ^0.1.1 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.1 #

  • Selected-tab fills are measured against the visible tab face, including when a larger touch target surrounds it.
  • List width checks follow transparent repaint layers to the page behind the field and its options.
  • Row checks measure outlined and bevelled controls against their background and distinguish controls in separate windows.
  • Rows on the same surface reuse the captured image and background measurements.

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.0 to dev_dependencies (and to a gallery example's dependencies when a page of it shows DesignKeylineSheet or DesignAlignmentSheet).
  • Change import 'package:ui_core/alignment.dart'; to import '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, DesignAlignmentReport and DesignAlignmentError.
  • package:ui_core/alignment.dart also passed on DesignSpacing, DesignSpacingScope, DesignInput, DesignTapTargets and DesignTapTargetScope; this package does not. They are ui_core's, in package:ui_core/ui_core.dart, which a look's barrel passes on.

Fixed since ui_core 0.2.1's checks #

  • DesignRowCheck leaves out a control another surface covers, wholly or in part: a window in front of it, a later layer of a Stack or an Overlay. 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.checkList reads a list's edges against the page under it. A list drawn in a repaint boundary of its own size (a DesignAnchoredOverlay'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).
  • DesignRowCheck reads 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.
  • DesignRowCheck reads 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.checkList reads a field drawn in a repaint boundary its own size (a padded ListView'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.
  • DesignWidthCheck leaves 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, so DesignCursorCheck and 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.
  • DesignLabelCheck reads 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 where DesignCapCenter gave 25.2, by where the chip stood.
0
likes
160
points
--
downloads

Documentation

API reference

Publisher

verified publisherwenkaifan.com

Weekly Downloads

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.

Homepage
Repository (GitHub)
View/report issues

Topics

#design-system #testing #widget

License

BSD-3-Clause (license)

Dependencies

flutter, ui_core

More

Packages that depend on ui_core_test