comic_ui 0.3.2
comic_ui: ^0.3.2 copied to clipboard
A Flutter design system drawn as a printed comic page: inked panels, speech balloons and Ben-Day dots in flat inks, every change of state a quick cut or pop.
0.3.2 #
- Keyboard focus is Comic's own pop instead of an outline ring: the focused part lifts up and toward the start off a hard ink print of its outline, and its words stay on a plain fill. Rows, tabs and segments that stand edge to edge show the print inside their outline instead of lifting. A slider's knob grows and lifts off its print. The print's ink reaches 3:1 on the ground around it in every preset, by day and by night, and Reduce Motion shows it at once. A combobox's or multi-select's list starts on its field as the focus lifts it, its words on the field's.
comicEmanataLength,comicEmanataWeight,comicEmanataGapandcomicEmanataSpreadare deprecated: Comic no longer draws focus emanata.ComicSelectFieldtakes alabel, shown above its box in the field-label style, and asemanticLabel. A screen reader names the select by it and reads the value after the name; the menu still opens from the box.ComicSelect's label is its field's spoken name too.
0.3.1 #
- Hover and press give controls a plain ink tint, and a link's words darken under it to stay readable. Disabled buttons keep readable lettering on one solid fill. Panels, modal backdrops and lettering on illustrated covers keep patterns clear of words.
- Escape clears the inspected chart point even when another control has keyboard focus. Chart figures keep English and Arabic counts in reading order. A bar list's figures share one column, so a larger value never draws a shorter bar.
- Opening a page with a fixed tab strip keeps its initial scroll position.
- On a phone at twice the text size, the date picker shows all seven weekdays. Segments stack when their labels need more room, select values wrap, and bottom navigation leaves space between captions.
- The checkout and delivery examples validate the fields before confirming an order or saving details.
- Gallery buttons that open dialogs and sheets leave room for the keyboard focus outline when they wrap.
- Selected tags and message actions follow the corners of their enclosing field or bar with even spacing.
- Arabic gallery navigation, examples, chart data and dates use Arabic labels. Headings, card and sheet titles, menu bar items and action labels use a heavier fallback for Arabic and Hebrew lettering. Carousel cards grow to fit translated text.
- Pressable list tiles include the subtitle in their accessible name. Numeric range captions keep the lower price before the upper price in right-to-left layouts.
- In copied components, use
ComicScreened(muteFill: false)in place ofComicScreened(dots: false)to retain the original fill colour.
0.3.0 #
Needs ui_core 0.3.0. Comic's parts take their behaviour from ui_core now and keep their print: the same panels, inks and pops, with ui_core's keys, screen-reader words, focus and springs under them.
Breaking:
ComicWindowSizeClassis gone.ComicThemeData.windowis ui_core'sDesignWindowSizeClass, on the same Material breakpoints, except that from 1600 wide it isextraLarge(Comic'slargeran from 1200 up).ComicTabBarcallsonChangedonly when the tab changes. A press on the chosen tab, which called it again with the same index, does nothing now: ui_core'sDesignTabBarreports changes only.
Changes:
- Menus light one row. In a menu bar's or a split button's menu, ui_core 0.3.0 lights the row the pointer moved over last or the one the keys moved to, and none in a menu the pointer opened until one of them moves. Comic's own quiet menu, which did this before, is gone.
ComicTooltipis ui_core'sDesignTooltipin Comic's balloon. It still waits 400 ms and stands under its control. It now stays while the pointer moves onto it, closes on Escape, shows one at a time, and opens at once along a toolbar after the first.ComicKbd.shortcut(activator)andComicKbd.labelOf(context, activator)take a shortcut's keys from ui_core, in the platform's order and the reader's words. Comic spells them in words on a Mac too ("Shift+Command+N"), since its typefaces draw none of ⌃ ⌥ ⇧ ⌘.ComicComboboxtakessearchanddebounceDuration, andComicMultiSelecttakesdebounceDuration. While an app's search is on its way, both say "Loading"; when it fails, they say "Couldn't load results" and offer Try again, which the arrow keys reach.- Dialogs and bottom sheets ride ui_core's routes. They open and close on springs: a dialog still pops in with a
short bounce, and a sheet stops at its edge. A screen reader hears a dialog, and focus returns where it was. A
bottom sheet now follows a drag down and a fling puts it away, and a
ComicBottomSheethands its scroll over to that drag. Under Reduce Motion both still cut, never fade. The router's sheet page on a desktop now pops in as a dialog does; before, it faded. - The command palette keeps its field's focus when Enter runs a command, on the web too.
- A screen reader hears the page around a
ComicPreview. Its app now stands in a semantics container of its own: on material_ui'sMaterialApp, which puts none round its navigator, the preview's barrier hid what the page showed before it. ComicTabBaris ui_core'sDesignTabBarin Comic's trough. It has one tab stop, arrows (mirrored right to left), Home and End. A screen reader hears "Saved, Tab 2 of 3". The thumb moves on a spring.ComicWheelPickeris ui_core'sDesignWheelPickeron Comic's drum. Page Up and Page Down step five, typing jumps to a value, a snap springs, and each row that crosses the band ticks.ComicChartpicks, steps and reads its points through ui_core'sDesignChart. Up and Down move between series, Home and End go to the ends, and a screen reader steps point by point.- The review checks come from
ui_core_test, a dev dependency.
The pub.dev page opens with a picture of Comic, links to the live gallery, the API reference and the other looks, and a
quick start. The README's Material snippets stand on material_ui, Flutter's Material from 3.50, where ComicTheme
already gives a pushed MaterialPageRoute Comic's cut; the example and the tests import it too.
0.2.1 #
Needs ui_core 0.2.1.
- Reduce Motion on iOS calms Comic too. Flutter puts iOS's Reduce Motion in dart:ui's
AccessibilityFeatures.reduceMotion, not inMediaQuery.disableAnimationsOf, which was all Comic read, so on an iPhone with Reduce Motion on, Comic's presses, eases and loops still ran. Comic now reads ui_core'sdesignReduceMotionOf, which also covers Android's Remove animations and the web'sprefers-reduced-motion.ComicMotion.ofandComicMotion.durationOfgive cuts under any of them. The progress burst, the progress bar and the skeleton stop looping, and when the setting changes while one runs, it stops or starts at once. - From ui_core 0.2.1: a menu or popover its anchor opened gives the focus back to the anchor as it closes, and Home and End in a menu keep the row they reach in view.
- The tests run in tiers.
flutter test --exclude-tags goldens,sweepis the everyday run. It keeps a case of every matrix: each part, page and setting at least once, on a phone's touch and a desk's pointer. The rest of each matrix (every platform, width, mode, corner family and edition) is taggedsweep, andflutter testruns every tier. The behaviour checks are split into three files (the parts as drawn, the parts styled, the example pages), so they run side by side.
0.2.0 #
Comic draws its states in its own ink now: nothing on the page is see-through.
- Hovering a part lays Ben-Day dots on it and pressing swells them. A disabled part is screened, not faded: an ink fill (a filled or danger button, a ticked box, a chosen chip) becomes a Ben-Day screen of that same ink on the paper, a dot every 7 at every size, and its words, icons and lines stay solid in one screened ink that keeps 3:1 against the dots by day and by night. A part with no ink fill is screened back toward the paper, opaque.
- Buttons stand on a hard offset print and sink onto it when pressed: the filled and outlined buttons, the danger and split buttons, and icon buttons with a rim. Dialogs, snack bars and toasts stand on a plate.
- A dialog's, sheet's or side sheet's backdrop is a dot screen over the page that swells in as it opens. Give your own
modal routes the same with
ComicScreenedRoute, or draw it withComicScreenScrim. - The keyboard's focus ring goes round a part and its print, with emanata ticks at its corners.
ComicPageDotswithonChangedis one control: press a mark to go to its page, step with the arrow keys, Home and End for the ends; a screen reader adjusts it as a slider.- The split button's menu pops in instead of fading.
- In an open list (a select's, a menu's, a menu bar's, a combobox's) the chosen option is printed in the caption's flat yellow beside its check; 0.1.0 gave the yellow to the row the pointer or the keys were on and marked the chosen one with the check alone. That row, the one Enter takes, now wears the hover's light dots on the card, so it never reads as a second choice or a divider; on the chosen row the dots print in the caption's ink. A combobox checks the option it took while its field holds its words, and a tree's picked row keeps the yellow, without a check.
- A select takes the keys as a desktop select does. Down opens it, as Enter and Space do, on the chosen option (the first when none is). In the list the arrows wrap, Home and End go to the ends, and a typed letter jumps to the next option it starts (letters typed in a run spell the start). Enter chooses and Escape dismisses, and either way the focus goes back to the field, after a pointer opened it too. Its field tells a screen reader whether the list is open: expanded while it's up, collapsed otherwise.
- A combobox's and a tag input's list (ui_core 0.2.0's own keys): Down or Up on a closed list opens it without moving,
on a combobox's option taken (else the first), and shows every option until the words are edited, where 0.1.0's
combobox opened nothing on an empty field; the arrows wrap. A menu bar's menu jumps to a typed letter, as a select's
list does.
ComicCombobox.isOptionEnabledandComicMultiSelect.isOptionEnabledmark options that can't be taken: in the secondary ink, passed over by the keys, the pointer and Enter. Their list keeps one highlight, the pointer moving it and the keys going on from it (ui_core'shighlightFollowsPointer, on), as a native menu's does: the pointer's row and the keys' wear the same dots, and two would read as two current options. A long list opens with its value in view, and Android's back closes an open list or popover before it pops the page.ComicCombobox.maxOptionscaps the matches of typed words alone. Enter keeps the focus in a combobox and in a tag input, for the next tag, where Flutter's done dropped it (ComicBareEditor.onEditingCompletefor an editor of your own), and keeps the field's text input, so a browser goes on taking the typing after Enter (a field told of a submit restarts its input, and the web's restarted input took none: give an editor that keeps its focusonEditingComplete, notonSubmitted). A menu row's shortcut stands with its capitals on the row's middle. - Every open menu (a select's list, an overflow menu, a menu bar's menu, a split button's) has one current row. The pointer moves it: a row the pointer moves over takes the focus, and the keys go on from there, so the pointer's row and the keys' never read as two. A menu the pointer opened lights no row until the pointer moves over one or a key is pressed: the first Down, Home, Enter or Space lights the first row (a select's, its value) and does nothing else, where it moved past it or took it. A menu the keys opened (Enter, Space, Down) lights the first.
- A page change is a cut on every platform: a page pushed or popped stands in its place, whole, in its first frame,
where Flutter's default slid or zoomed it in from the side.
ComicThemegives it to the routes it reaches, Comic's own pages among them; givecomicPageTransitionsto yourMaterialApp'sPageTransitionsThemeand theMaterialPageRoutes you push cut too, as the example does (the README shows the line). comic_ui's own theme is material_ui's, which Flutter'sMaterialPageRoutenever reads; the one map fits both Materials. On iOS the edge swipe still takes a page back, the page following the finger: the map wraps the cut there in ui_core'sDesignSwipeBackPageTransitionsBuilder(ComicPageTransitionsBuilderalone takes no swipe). - A
ComicTierlays its panels across from 600 up, a tablet's width as a desk's, in the 16 gutter; 0.1.0 reflowed it as on a phone up to 1024, so a tablet showed a phone's stretched column. Itsphonelayout holds under 600 alone, as its documentation said, and a column under 130 still reflows. - Every control stands on the design kit's tap target: the box it takes in a layout, the area a tap reaches and the
box a screen reader outlines are now the same. Comic's floors stay 48 by 48 for a finger and 44 by 44 for a pointer;
declare others with a
DesignTapTargetScopeaboveComicTheme. A bare checkbox, the rating's stars, a month's arrows, the back button, a carousel's first arrow and the breadcrumb trail's first step keep their faces on the column's keyline, the target growing away from it (ComicIconButton.targetAlignmentfor your own). Breaking: an icon button or checkbox narrower than the floor now takes the floor's width in a row, where 0.1.0 let its target stand outward over its neighbours. Pick touch or pointer floors withDesignTapTargetScope, no longer with Material'smaterialTapTargetSize. ComicFormFieldround a group of choices or radios lets a screen reader reach each choice on its own; it read the whole group as one button.groupsays so for a group of your own.- A tap anywhere in a text field's frame focuses it, beside its words too, and a focus ring inside a panel keeps plain corners where the panel's edge would cut its ticks.
ComicSpace, the spacing scale on a 4-point grid. Every part takes its gaps and insets from it; a few moved by a point or two to sit on the grid.ComicBrandandComicNavItemlive in their own library, still exported fromcomic_ui.dart, so a bar copied out of the package keeps reading them.ComicStyleandComicStyleOfare now the design kit'sDesignStyleandDesignStyleOfunder Comic's names. The slots and calls are the same, so your code builds as it was, and a style made for another look on the same kit works here too.- Fields, sheets and menus no longer crash in apps set to a language other than English; their built-in labels now follow the app's language.
- The parts' shared words come in 30 languages. Add
DesignLocalizations.delegateto your app'slocalizationsDelegates, and itssupportedLocalesto yours, and they follow the reader's language. - The command palette's backdrop is the dot screen too; it was a flat dim.
- At large text sizes a button is never narrower than its longest word, and a timed row's time never breaks. On a phone, the cover's balloon moves under the burst rather than break a word, and the splash's note wraps before the burst. A note box's hint wraps over its lines.
- The example gallery reads in Arabic when it runs right to left, on every everyday screen.
- Comic's lettering falls back to its text face for a script the display face lacks, so Arabic and other scripts show instead of empty boxes. A tilted stamp takes the room its corners reach, and the cover's date box stacks under the issue and price at large text on a phone.
- On the web, lettering laid out before a fallback font arrived kept its empty boxes; it lays out again when the system's fonts change, as Flutter's own text does. Words in a right-to-left script are lettered in the text face, the burst's words over and under its number too: the display face's slanted "!" sat over the script's last letter.
- A burst keeps its words off its outline: they fit with a little of the fill between them and the star's edge, checked along each line and not only at its corners, where a valley between two spikes could cut in.
- By night the modal screen is printed in the night's cream line (
ComicColors.scrim): a reverse screen that knocks the black ground back, as black dots knock the paper back by day. Black dots on the night's black screened nothing but the cream words, and cut those into pieces. - By night
ComicTextField(onPaper: true)stands on the night card in cream, as every field does; it stayed on day paper with its cream rim lost in its fill. - A phone's tab bar whose tabs need more than its row (at large text) holds its rim at the row's ends and scrolls the tabs inside it, each at its own width, so the next tab shows, cut by the rim; the chosen tab is scrolled into view. The rim used to scroll away with the last tab, and nothing showed there was one.
- At large text on a phone, the cover's last box above the date runs to the row's end, where bare art showed through.
ComicTheme.ofgives Comic's default theme (Offset, by day) when noComicThemeis above, asTheme.ofdoes;ComicTheme.maybeOfstill answers null. Selecting text on iOS no longer throws when yourComicHostsits underhomerather than in the app'sbuilder.- Every part describes the values it was built with in Flutter's inspector and in a failing test's widget tree, its defaults hidden.
- A value out of its range now asserts in debug builds: a field of no lines, a number field that steps by nothing, progress past 1, a review of more than five stars, a badge or count below zero.
- Every example in the API docs is compiled and run by the package's tests.
comicInventory's calendar, data table, tree view and scroll area specimens dispose the controllers they make; they made a new one on every build and never disposed it.- The internal render boxes
ComicPressFace,RenderComicPressFace,RenderComicOutwardandRenderRowReachleftcomic_parts.dart, the copy-out parts library, which may change in any version. - Customising keeps Comic a comic. Deprecated, each still working until a later version removes it:
ComicShapes.roundedandComicThemeData.copyWith(shapes:): Comic is square, with only speech and heads round. Give one part its own corner through its style'sshape.ComicThemeData.copyWith(motion:): Comic's motion is a quick cut and a small pop. Reduce Motion still turns it into cuts (ComicMotion.still) by itself.ComicTypeface.scaleand thescale:of its constructors andcopyWith: the platform's text scaling serves readers without breaking the lettering.dart fix --applyremoves the argument.- Strokes come in two steps,
ComicStrokes.standard(the look's own contours, a theme's default) andComicStrokes.bold. TheComicStrokes(...)constructor with free widths andComicStrokes.copyWithare deprecated;ComicStrokes.lookis nowComicStrokes.standard, anddart fix --applyrenames it.
- A part whose style gives a see-through fill or overlay asserts in debug builds, naming law 1 (flat opaque inks). It is an assert, not a clamp: a release build draws the colour as given.
- Flutter's own widgets under Comic (a text field's selection, a Material part an app adds) set their words in the
theme's text face, so a
ComicTypefaceyou give reaches them. 0.1.0 always used Shantell Sans. - The example gallery's Customize panel no longer offers rounded corners or a type scale.
- The example gallery follows a link the browser pushes after it starts (an address you edit, or Back to the opening link) in place; it threw, having no named route for it. At a desk, the splash's cabin stands clear of its title.
- The 0.1.0 notes said every part takes a
style:. The parts that do are buttons, fields, choices, the pickers, surfaces, raised surfaces, avatars and badges, and the README lists them. The README no longer promisesWidgetslots beside theStringlabels.
0.1.0 #
First release of Comic: a Flutter design system that draws an app as a page of a printed comic.
- Five print editions (offset, reprint, newsstand, pulp, sunday), each with a day and a night issue, and
ComicThemeData.fromfor an edition in your own colours.ComicThemeinstalls under MaterialApp, CupertinoApp or WidgetsApp;AnimatedComicThememoves between themes. - Everyday parts:
ComicButton(outlined,.filled,.text, andisDestructiveActionon each), icon and send buttons, links, text fields, text areas, search, one-time codes, selects, comboboxes, checkboxes, radios, switches, sliders, segmented buttons, chips (ComicChip.filter, removable withonDeleted), steppers, date and time pickers, file upload. - Pages and navigation: scaffold, app bar, navigation bar, rail and drawer, tabs, breadcrumbs, pagination, carousel.
- Lists and containers: list sections and tiles, switch and check rows, cards, panels in tiers, data tables, disclosure groups.
- Raised surfaces: dialogs, bottom sheets, action sheets, menus, popovers, tooltips, snack bars and toasts, each with a
showComic...function that handles focus, dismissal and Escape. - Status and data: badges, tags, avatars and avatar groups, progress, skeletons, empty, loading and error states,
ratings; line, area and bar charts (
ComicChartType), pie charts, sparklines. - Comic's own: speech and thought balloons, captions, the burst, sound effects, Ben-Day dots, covers and splashes.
- Every change of a part's state animates in Comic's motion (a quick cut, a short pop): presses sink onto their print, fills, rims and words move to their new state, the focus ring inks in, and day turns to night. Reduced motion switches at once.
- Per-state styles (
ComicStyle) for every part, above its component theme. - Flutter's conventions:
valueandonChangedon every control (a null callback disables it), an optionalfocusNodeandautofocuson every part with one focus target, an optionalcontrolleron every field, and Flutter's names (initialValue,maxLines,firstDate,destinations,isError,waitDuration). - Keyboard focus and activation, screen-reader labels, roles and states, 48 by 48 touch targets, text scaling,
right-to-left layouts and English words through
ComicLocalizations. - Bundled Bangers and Shantell Sans;
ComicGlyphson Lucide icons. comic_parts.dart: the tokens, painters and helpers the parts are built from, for copying a part into your app.
