camouflage_core 0.2.0
camouflage_core: ^0.2.0 copied to clipboard
Camouflage core: the components, the Theme and the Skin contract. Visually neutral, no Material.
0.2.0 #
- Third-party skins must add two renderers. The skin contract grows from 52 to 54:
CamoSkinnow requiressplitPane(CamoSplitPaneRenderer) andscrollbar(CamoScrollbarRenderer). The five Camouflage skins ship both in 0.2.0; a skin of your own needs them before it compiles against this version (ADR-45). Nothing else in the contract changed. - Fixed:
CamoPagedListannounced "loading more" with an announcement event, which Android has deprecated (a warning in the log). It now says it through the list's live region, so TalkBack still hears it. - Skin-drawn scrollbars:
CamoScrollArea(child:)puts a thin overlay bar over a scrollable, in the skin's colors: a thumb that grows under the pointer, dragged to scroll, a click on the track pages a viewport, and it shows while scrolling (or always, per skin and theme). It reads the scroll position from the child's notifications, so the child needs no controller. It appears automatically in the tree, data table, paged list, menus and the select's list, only with pointer input on desktop and the web; touch platforms keep their native indicators. It takes no focus and is hidden from screen readers; wheel events go to the content. The skin contract grows by one more required renderer,scrollbar(CamoScrollbarRenderer), so every skin, including your own, must add it (ADR-45). - Split panes:
CamoSplitPane(axis:, panes:, state:)lays out two or more panes side by side or stacked with a draggable divider between each pair. The layout is the app'sCamoSplitState(pane sizes as fractions, so a saved layout restores on any window size, and which panes are collapsed;snapshot()andapply()to persist it); aCamoPanehasminSizeandmaxSizeand can becollapsible. A divider is focusable and adjustable by a screen reader ("Resize panel, 35 percent"); arrow keys resize (Shift for a larger step), Home and End go to a limit, Enter collapses or restores, a double tap resets, and right to left mirrors a horizontal split. The skin contract grows by one renderer,splitPane(CamoSplitPaneRenderer), so every skin, including your own, must add it (ADR-45). - Resizable, hideable and reorderable table columns: pass
columnState: CamoColumnState(ids)toCamoDataTableand the user can drag a header's edge to resize (a double-tap fits the content, usingCamoColumn.text, or goes back to the column's own width), drag a header or press Alt+Left/Right to reorder, press Ctrl+Left/Right to resize, and right-click a header to hide columns, choose the visible ones or reset the widths. Screen readers get the same as custom actions on the header (Widen, Narrow, Move earlier or later, Hide). The state is the app's (order,widths,hidden,snapshot()andapply()to save the layout); the last visible column can't be hidden.CamoColumngainsminWidth,resizable,hideable,reorderableandtext. Without acolumnStatethe table is unchanged; no new renderer. - Speed search: type in a focused tree, data table or menu to filter it, with the matches highlighted and no search field.
CamoTree(speedSearch: CamoSpeedSearchState())keeps the ancestors of matches and opens them;CamoDataTable(speedSearch:)filters rows by the columns that give theirtext;CamoMenuAnchor(speedSearch: true)replaces the type-ahead with a filter. Up and Down move between matches in a tree, Backspace edits, Esc clears before it closes anything, and a live region says "3 matches" or "No matches".SpeedSearchMode.jumpkeeps every item and only moves focus.CamoMatcher.match(query, text, kind:)matches by prefix, substring or camel-hump (fLogfindsfeatureLogin) or fuzzily, ignoring case and accents, and returns the ranges;CamoHighlightedText(text, ranges)draws them incomponents.speedSearch's colors, for your own lists.TreeNodeSlots.highlightandMenuItemState.highlightcarry the ranges to a skin's renderer (the five skins draw them; a third-party skin should draw its label withCamoHighlightedText). No new renderer. - Document tabs:
CamoDocumentTabs(documents:, selected:, onSelect:, onClose:, state:)is an editor-style tab row: a close button on hover and on the selected tab (a dot whileCamoDocument.modified), middle-click to close, drag with a mouse or Alt+Left and Alt+Right on a focused tab to reorder (they follow the screen's left and right in right-to-left), pinned tabs kept at the start, and a row that scrolls with a "show all tabs" menu (searchable by typing) once the tabs don't fit. The app owns the documents, the selection and closing (onClosesays the user asked; it picks the next tab);CamoDocumentTabsStateholds the order and pins (snapshot()andapply()to save them) and adds new documents at the end.onContextMenureturns a tab's right-click entries. Screen readers get Close, Move earlier, Move later and Pin actions on each tab and "modified" and "pinned" in its value. It is drawn by the skin's existing tab bar, so it needs no new renderer.CamoTabItemgainssemanticsValueandcustomSemanticsActions,CamoTabsContainergainsonOverflowChanged, and the roving focus used by tab bars and radio groups now ignores arrows pressed with Alt, Ctrl or Cmd. A touch drag scrolls the row, so reorder on touch goes through the screen reader actions or a keyboard; dragging to the edge doesn't scroll the row yet. - Command palette:
CamoCommandPalette(state:, sources:)is a popup at the top of the window for "Find action" and "Search everywhere": one field, results grouped by source, keyboard first. Show it from your own shortcut withCamoCommandPaletteState.show()(the double-Shift or Ctrl+K trigger is the app's). ACamoCommandSource(title:, search:)answers asynchronously; the answer to an older query is dropped, a slow source shows a loading row while the others appear at once, andCamoCommandSource.of(title:, items:)scores an in-memory list (ten thousand items filter as you type). Rows show the title with matches highlighted, an icon and a shortcut hint (CamoCommandItem.shortcut); with nothing typed each group lists what was run before first (state.recent,snapshot()to save it). Up and Down move through all rows, Tab and Shift+Tab jump between groups, Enter runs the active row after the palette has closed, Esc clears the query and then closes; focus stays in the field and screen readers hear the active row ("Close File, Actions, 2 of 5").CamoMatcher.score(query, text)ranks a fuzzy match (prefix, then substring, then camel-hump, then scattered letters) and returnsCamoMatch(ranges, score).CamoMenuItemRowgainshighlight,active,reserveIcon,hint,focusableandasOption.CamoSearchFieldnow lets Esc go on to its parents when there is nothing to clear. No new renderer: the palette is the skin's popup panel, search field and menu rows. - Menu submenus:
CamoMenuSubmenu(text:, items:)is a newCamoMenuEntry: a row that opens a nested menu beside it (Reset ▸ Soft, Mixed, Hard). Hover opens it after 250 ms, a tap, Enter and the arrow toward the child open it at once and focus its first item; the arrow back and Esc close only the submenu, and a leaf closes every level. It flips to the start side near the edge and mirrors in right-to-left.MenuItemStategainshasSubmenuandsubmenuOpen. - Dock layout:
CamoDockLayout(state:, toolWindows:, center:)puts IDE-style tool windows around the center: docks on the left, right and bottom that open from icon stripes on the window's edges. A stripe button toggles its tool window; several open windows on one edge stack in a split of their own; docks resize through the split pane's divider (keys and screen reader included). A window's header has a "Move to" menu (left, right or bottom), maximize or restore (the other docks and the center hide, the stripes stay) and hide. The app ownsCamoDockState(the edge and stripe place of eachCamoToolWindow, which are open, the sizes as fractions of the window and the maximized one;snapshot()andapply()to save the layout);state.focus(id)opens a window and moves keyboard focus into it for the app's shortcuts, and Esc inside a window returns focus to the center. Left and right mean start and end, so a layout swaps in right-to-left. It is drawn by the split pane, icon buttons and menus, so it needs no new renderer. Floating windows, tabs inside a dock, dragging a window to another edge and the sizes of stacked windows in a snapshot come later.CamoContextMenuAreagainsexcludeFromSemantics.
0.1.3 #
- Accessibility: a sortable data table header keeps a 48 touch target in its semantics, so it passes Flutter's tap-target guideline.
- New
CamoPhysicalShape: aPhysicalShapethat clips only what is painted, so a small control with a larger touch target (a chip's remove button) is not cut off in the semantics.
0.1.1 #
- A full README (features, getting started, usage, themes, other skins) and an example for pub.dev; topics and the documentation link in the pubspec.
- Screenshots on pub.dev, generated by
example/test/screenshots_test.dart. - Accessibility:
CamoTouchSemanticsgives small controls (buttons, icon buttons, field actions, segments, tabs, navigation items, button-group buttons, split-button parts) 48 x 48 semantics without changing layout or painting; icon-only navigation items carry their label; table rows are named; the select-all box has a full-size target. - New
CamoClipRRect: aClipRRectthat clips only what is painted, so enlarged touch targets inside a rounded container are not cut off.
0.1.0 #
- First release.
