ledger_ui 0.3.1
ledger_ui: ^0.3.1 copied to clipboard
A Flutter design system kept in ink: warm paper, ink rules where other looks draw boxes, dot leaders, engraved figures and mono amounts, by day and by lamplight.
0.3.1 #
LedgerTabs.childrendisplays swipeable pages and gives each panel its tab's accessible name. The Selection example includes Entries, Notes and Files panels.LedgerStepper.formatformats quantities and their screen-reader values. The default still displays whole dollars. The Copies example counts in single units.LedgerStepper(size: LedgerStepperSize.field)is a form's number field. The number sits on a text field's rule at the same height, with its label above and help or error text below, and the minus and plus buttons sit at the end of the line. It accepts typed numbers withinminandmaxand shows an error while a typed number is out of range. Up and Down step the value, and Page Up and Page Down move ten steps. The newmaxalso stops both sizes' plus button at that value. The default size is still the budget's large figure.- Inline search accepts taps across the field’s height and supports keyboard and screen-reader input. One-time codes and selects announce their label once, and a multi-select's tags can be reached separately from its text field.
- Standalone navigation destinations can be focused and activated with the keyboard.
- Field captions and compact date pickers make room for long labels. Step counts keep the current step first in right-to-left layouts.
- Month charts place overlapping first-day and current-day labels on separate lines. Pie chart legends wrap their amounts and percentages below the labels when space is tight.
- The refresh prompt stays inside its visible area during short drags. Segmented controls follow their outer corners when the theme uses a small radius. The clear button sits evenly inside the search field.
- A segmented control in a wider slot keeps its ring to its segments, at the slot's start. Its keyboard focus rule spans the focused segment and touches it.
- In a sheet, the date picker's month, arrows and closing rule span the sheet, so a tablet's date sheet no longer leaves an empty column beside the calendar.
- The date picker speaks the app's language. Outside English, its pills, calendar and wheels use ui_core's words, date order and digits: an Arabic due date reads ٢٠ نوفمبر ٢٠٢٦ at ٠٩:٣٠, and a German one 20. Nov. 2026 at 21:05. Its wheels use a 24-hour clock where the language does, and weeks still start on Monday. English reads as before. Each pill is named by the picker's label, with its date or time as the value. At large text sizes the month's name wraps instead of being cut. Outside English, the stepper field's range error shows the range in the language's digits (٥–٤٨٠).
- Tables keep amounts and whole words readable. When columns are too narrow, each record shows its remaining fields below the name with their column labels. Swipe actions size their solid backgrounds to fit their labels. Calendar dates and weekday labels grow with the system text size.
- Validation messages use higher-contrast red text. Page titles can use the full width beside the back button when there are no actions.
- At large text sizes, two-word tab bar names such as New entry wrap onto a second line instead of shrinking every name to fit the longest on one line. At twice the text size, the names in a five-column phone bar grow to about 1.6 times their normal size.
LedgerNavBar.bandInaccepts the names and the bar's width to reserve room for the second line. - In Quill, the example app, saved entries appear in the register, its search and Home. Amounts entered with a decimal comma keep their cents. Validation errors update as the fields are corrected. Signing out hides the account, register and receipts until you sign in again. Profile changes are kept when you leave Settings. The register count includes only entries the register contains. Settings shows the currency as US dollar because Ledger formats amounts in dollars.
0.3.0 #
Needs ui_core 0.3.0. Ledger's behaviours move onto ui_core's: Ledger keeps its paper, its ink and its motion, and ui_core runs the keys, the focus, the gestures and what a screen reader hears. No public name is removed or renamed; the changes in behaviour are listed at the end.
- Dialogs and sheets (
LedgerDialog.show,LedgerSheet.show,LedgerSheet.pageRoute) ride ui_core'sDesignDialogRouteandDesignBottomSheetRoute: they move on ui_core's springs (a short fade under Reduce Motion), keep Tab inside them and give the focus back to what opened them, Escape closes them, and a phone's sheet follows a drag and lets go on a drag down or a fling. A raisedLedgerDialogopens with the focus on its safe act: Cancel beside a destructive confirm, the confirm otherwise. - Tabs (
LedgerTabs) are ui_core'sDesignTabBar: one tab stop, the arrows (mirrored right to left, wrapping) and Home and End moving the choice, the change on a spring, the rule drawn out under the old tab as it is drawn in under the new. Each tab says its count and its place ("Entries, 12, Tab 2 of 3"). - The navigation frame (
LedgerNavigationFrame) is ui_core'sDesignAdaptiveShellat Ledger's widths, painted byLedgerNavBarandLedgerSideBar: the destinations are one tab stop that the arrows move along, Enter or Space choosing; F6 moves between the navigation and the page; the phone's bar is a tab bar to a screen reader, its act a button beside it, and the side bar is the navigation menu. The phone's tabs gain the keyboard and a focus rule. The page keeps its state as the window crosses a width. - The split button's menu keeps one current act through ui_core's
highlightFollowsPointer: the hovered act while the pointer moved last, the focused one while the keys did, none in a menu a click opened (Down lights the first act, Up the last). - The tooltip (
LedgerTooltip) is ui_core'sDesignTooltipround Ledger's slip: it also shows while the keys hold its anchor, the pointer may move onto it, Escape hides it, and one shows at a time after a warm-up. - Wheels (
LedgerDatePicker's wheel presentation) turn on ui_core'sDesignWheelPicker: Page Up and Down, Home and End and typing join the arrows, a fling settles on a row, and the keyboard's focus draws Ledger's double rule under the wheel. - Searching:
LedgerComboboxtakes asearch(and adebounceDuration) in place ofoptionsand paints ui_core's loading and failed states on its paper, with a "Try again" line the keys reach. - Shortcut keys:
LedgerKbd.shortcutprints aSingleActivatoras the platform writes it (⌘K on Apple's platforms, Ctrl+K elsewhere) and spells it for a screen reader. - Surfaces beside the side bar: a menu, list, popover or tooltip opened in a page beside a side bar of
Ledger's keeps clear of the bar through ui_core's
DesignOverlayPadding. - Right to left: the preview frame's side bar stood at the left in RTL while its pages stood beside it at the reading start; it stands at the start now.
- Symbols in a figure: Instrument Serif has no ±, arrows, fractions, ≈ ≤ ≥ or ₹ ₩ ₽; a figure, a title or a monogram now sets them in Inter Tight, which ships with Ledger, rather than in the platform's fallback face.
- Updated the installation example to use
material_uiandcupertino_uion Flutter 3.50.
Changes in behaviour:
- Enter in a split button's menu that a click opened presses nothing until an act is lit (it pressed the first).
LedgerTabsis one tab stop rather than one per tab, and its arrows wrap from the last tab to the first.- Under
LedgerNavigationFramethe page stands above the tab bar and beside the rail or the side bar rather than under them, soShellInsets.ofreads 0 there and a page pads for neither. - A sheet or dialog's motion is ui_core's spring;
LedgerSheet.motionOfstill gives Ledger's timed motion for an app's own transitions. LedgerDatePickerreports a wheel's value once the wheel comes to rest, not at every row it passes.LedgerPreview's app stands in a semantics container of its own, so a screen reader still reads the page round the preview (a route's barrier hid what was painted before it). The example gallery's Navigator and nested apps do the same; on material_ui'sMaterialAppthe side bar's destinations were missing from the semantics tree.- A phone's sheet opened with
LedgerSheet.pageRoutenames its scrim to a screen reader ("Dismiss"), which closes the sheet; it was silent.
0.2.1 #
Needs ui_core 0.2.1.
- Reduce Motion on iOS calms Ledger too. Flutter puts iOS's Reduce Motion in dart:ui's
AccessibilityFeatures.reduceMotion, not inMediaQuery.disableAnimationsOf, which was all Ledger read, so on an iPhone with Reduce Motion on, Ledger's eases, sheets and loops still ran.LedgerMotion.isReducednow reads ui_core'sdesignReduceMotionOf, which also covers Android's Remove animations and the web'sprefers-reduced-motion, soLedgerMotion.ofandLedgerSheet.motionOfgive cuts under any of them. The progress bar, the progress ring, the skeleton and the loading state's leader stop looping, and when the setting changes while one runs, it stops or starts at once. - Counted words take their plural form. A text area's count of what is left says Material's words ("1 character
remaining", "No characters remaining"), in the app's language with its plural forms; it said "1 characters left".
LedgerVisitRuler's own label says "1 payment this month". LedgerDisclosureopens and closes at once under Reduce Motion. At a zero duration its size animation re-dirtied its own layout, an assertion in debug builds, on Android's Remove animations as on iOS's Reduce Motion.- 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.
0.2.0 #
- The ordinary parts, in Ledger's hand. Ledger now carries a part for every row of ui_core's inventory of the
controls a design system is expected to have (
ledgerInventory, shown whole byLedgerInventoryGallery; a row it leaves out says why). New:- fields:
LedgerPasswordField(its reveal on ui_core's),LedgerTextArea(a ruled memo with a count),LedgerCombobox(suggestions as you type),LedgerMultiSelect,LedgerCodeField,LedgerInputGroup(a sign or a unit beside the words),LedgerRangeSlider,LedgerFileUploadandLedgerDateRangePicker; - wayfinding:
LedgerBreadcrumb,LedgerPagination,LedgerStepProgress,LedgerPageDotsandLedgerCommandPalette; - in the margins:
LedgerDivider,LedgerBadge,LedgerDisclosure,LedgerTimeline,LedgerMediaandLedgerKbd; - under way:
LedgerProgressBar,LedgerProgressRing,LedgerSkeleton,LedgerPieChartandLedgerSparkline; - over the page:
LedgerSideSheet,LedgerActionSheet,LedgerPopover,LedgerTooltipandLedgerBanner; - collections:
LedgerDataTable(sorted by its headings, rows chosen by a press),LedgerReorderableList,LedgerCarousel,LedgerScrollArea,LedgerPullToRefreshandLedgerSwipeActions(every act also a screen reader's action); - acts:
LedgerToggleGroupandLedgerSplitButton.
- fields:
LedgerHostis the whole install in one widget for an app'sbuilder:: the theme by day and by lamplight, the Material bridge under it and the toasts over the app.LedgerThemealone still works as before.- Your own look per part. The ordinary parts (the buttons, the icon button, the fields, the chip, the checkbox,
the switch, the segmented control, the toggle group and the filters, the badge, the banner, the tooltip, the
toast, the dialog and the slip) take a
style:, aLedgerStyle(ui_core'sDesignStyle, read as Material'sButtonStyleis), andLedgerThemeData.componentssets one per part across the app. A field's style keeps it written on a rule: it reads the rule's ink, the paper, the padding and the words, never a shape. The select, the radio, the slider, the rows, the tabs, the bars and the sheet take nostyle:yet; the theme's roles restyle them. - Paper keeps a paper's corners.
cardRadiusstands from 0 to 22,smallRadiusfrom 0 to 10 andsheetRadiusfrom 0 to 28 (LedgerThemeData.cardRadiusMost,smallRadiusMost,sheetRadiusMost), the range Ledger's own presets span, which keep their corners. A theme built or copied past them fails an assert in debug builds that says why: a slip rounded like a pill reads as plastic, not paper.controlRadiusstays free, round or square, and a theme animated on an overshooting curve holds its paper within the bounds. - The money tones are documented as meaning, not decoration.
moneyInis the accent's green,overthe vermilion for spending past a limit andmovea quiet ink.LedgerThemeData.fromand the presets keep them tied to the accent, the over colour and the ink; change the accent withfrom, sincecopyWith(accent:)changes the act alone and leaves money in green. - Any value in a segmented control or the filters.
LedgerSegmentedControl<T>andLedgerFilters<T>take values of any type, worded bylabelOf(theirtoString()when you give none), asLedgerSelect<T>does. Calls written with strings work unchanged. Breaking for a test that finds one by its type:find.byType(LedgerSegmentedControl)no longer matches aLedgerSegmentedControl<String>; usefind.byWidgetPredicate((w) => w is LedgerSegmentedControl). ALedgerFilterswhosevalueisnulland whose other arguments name no type needs it spelled:LedgerFilters<String>(...). - 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. An app on Flutter's
MaterialAppwithflutter_localizationsgives Flutter's own words, which a part built onmaterial_uicannot read: a text field and a sheet threw "No MaterialLocalizations found" in German, Arabic or any language but English. Ledger now loadsmaterial_ui's andcupertino_ui's own translations for the app's language (a text field's menu, Cut, Copy, Paste and Select all, on iOS too) whenever the app gives none of theirs, and English for a language they do not know. - 30 languages. The words a part says by itself come from ui_core's
DesignLocalizationsin 30 languages: addDesignLocalizations.delegateandsupportedLocales: DesignLocalizations.supportedLocalesto your app. Confirm, Try again and the toasts' region are among them now. - Touch. Every control's 44 point reach is ui_core's
DesignTapTarget, so what a screen reader outlines is what a finger reaches. A text field takes a tap anywhere on its line, its sign and margins too, and on its help or error under it; a memo anywhere on its ruled paper, its count's room too; a tag field and the command palette's search take one anywhere on their line; a code field is as wide as its cells. A sheet's close now stands on the card's column instead of hanging 6 points into its margin, so all of its target takes a tap (LedgerChromeMetrics.sheetCloseHangis deprecated).LedgerHitSlopis deprecated: useDesignTapTarget. - A field's list opens on its field. A select's options, a combobox's and a tag field's suggestions open at the field's width on its leading edge, wider only to fit the widest option (at most 320), at any window width and in either direction; their words stand 16 in from the field's, the rows' own inset. From 600 a select stands at a short entry's measure at the start of its slot instead of spanning a wide column.
- An open list shows its chosen option. In a select's, a combobox's and a menu's list the chosen option stands on
the menu's paper, its words semibold, the green tick at its end; it used to show the tick alone. A pointer
underlines an option's words, and the keyboard doubles the rule under them, both on the option's own row: the
keyboard's rule used to run under the whole row, past the rules between options, reading as a break in the list,
and a suggestion under the pointer used to take a wash a second choice could be taken for.
LedgerPressable.rulesFocus: falselets a face write focus in its own words. With nothing matching, a combobox's "No results" stands on paper the field's width, as its options do; it used to stand on a slip as wide as its words. - Typing goes on after Enter, in a browser too. The fields that keep the focus after Enter, the combobox's,
the tag field's (
LedgerMultiSelect), the command palette's search and the composer's, take Enter without restarting their text input. In a browser a restarted input took no more typing: after Enter took an option or added a tag the field still looked focused and the arrows worked, but letters and Backspace did nothing. The composer keeps the focus once it sends, for the next message.LedgerTextField'sonSubmittedandonEditingCompletesay which to use: a field that keeps the focus takes Enter inonEditingComplete, never both. - One current row in a menu. A split button's menu and the menu slip mark one row at a time, the one the pointer or the keys moved to last: the pointer's underline or the keyboard's double rule, under the words alone. The pointer moves the keys' place with it, so a pointer resting on one row and the keys on another no longer read as two current rows. A menu a click opened marks none until the pointer or the keys move (Down, Enter or Space then mark its first rather than pass it or press it unseen); one the keys opened marks its first. A split button's menu used to rule the keyboard's place across the whole row to the paper's edge, to light its first row however it was opened once a key had been pressed, and, beside the desktop's side bar, to slide under the bar; it now keeps to the room between the bar and its button's end, its words wrapping.
- A select from the keyboard. Down opens its list as Enter and Space do, and an open list puts the keyboard on the chosen option (the first while none is), however it was opened: the arrow keys move at once, round from the last to the first, Home and End go to its ends, a letter to the next option it starts, Enter chooses and closes, and Escape closes, the keyboard back on the field either way. It used to open on the first option.
- Toasts run on ui_core's toaster: a pointer or the keyboard over one holds it, F6 reaches it, Escape and a
swipe dismiss it, and a screen reader hears it.
LedgerToast.showis unchanged. - Spacing is LedgerSpacing's steps throughout, on a 2 point grid the host declares to ui_core. A few gaps move a point to land on it: the ends of a chip, a filter, a toggle group's pill and a quiet button are 12 (were 13), a focus ring stands 2 clear of what it rings (was 3), a row's second line stands 4 under its first (was 3), and a few rows grow a point or two (a key and value row is 44 tall).
- Ledger's page motion. A pushed page is a leaf laid down: it fades in as it rises 8 points, in 200 ms, and a pop
lifts it off the same way; under reduced motion it lands at once. Pages used to fly in by the platform's slide or
zoom.
LedgerThemeandLedgerHostset it (LedgerPageTransitions), so aLedgerPagetakes it (under the host it used to fly in still: the host's own Material theme left the motion out); Flutter's ownMaterialPageRoutereads your app'sThemeData, so give itledgerPageTransitionsthere, as the README's install does. A destination chosen in the side bar, the rail or the tab bar changes in place, and its mark lands in the same frame (it used to ease over 120 ms, so the new page showed under the old destination's mark). On iOS the swipe back from the screen's leading edge stays round the leaf (ledgerPageTransitionswraps its iOS entry in ui_core'sDesignSwipeBackPageTransitionsBuilder): the page follows the finger and goes past half way or on a fling. - Back closes what is open first. Android's back (any pop the app asks for) closes a select's list, a popover or a field's suggestions before it pops the page under them (ui_core 0.2.0); they used to go with the page. A sheet and a dialog are routes and closed first already.
- A tablet's page. Beside the rail (600 to 1023 wide) a pushed page heads itself with the crumb back, as at
desktop width; it had no way back there, the phone's bar not standing beside a rail. A bottom sheet stands at 640
at most (
LedgerLayout.sheetMeasure, Material's), centred, where it used to stretch across a tablet. - Buttons answer a pointer. Under a mouse a filled button lifts toward its words' colour, a ringed one takes a wash of the ink and a frameless one its underline, so a desktop sees what a click will reach.
- Right to left.
LedgerFormat.isolatedholds a figure left to right inside words of either direction, so a Hebrew or Arabic line prints "+$73.42" and "··4821" as written, never "$73.42+". - Fixes. A receipt's sum shrinks to fit beside its seal instead of running under it; a docked act keeps its shadow at the column's edge; at a large text size the phone tab bar's names set at one shared size, a checkbox's or a radio's words grow its line instead of being cut, and a day's date drops whole under the day instead of breaking mid-date. A perforation punches whole holes only, so none is sliced at a slip's notch, and the empty and error pages' ruling breaks round each block across the whole line instead of leaving stubs beside the words.
- Every public widget lists its settings in Flutter's inspector (
debugFillProperties), and out-of-range values (a negative count, a carousel's viewport past 1, a chart's empty month) fail an assert in debug builds. LedgerTheme.ofgives the default theme (quire, by day or by lamplight as the platform is) where noLedgerThemestands, as Material'sTheme.ofdoes, instead of throwing;LedgerTheme.maybeOfstill gives null.- Every example in the API docs is compiled and run by the package's tests, and the tests run with Flutter's leak tracking.
0.1.1 #
- A mouse over the slider now shows the pointing hand, on its track and on its knob, as it does over every other control; a slider that is off keeps the cursor of what it stands on.
- The tabs of the phone's tab bar, and its raised action, show the pointing hand too, and so does a select's label; a text field's label shows the text cursor, since a click on it puts the caret in the field.
0.1.0 #
- First release.
- The theme:
LedgerTheme(the whole install, under aMaterialApp, aCupertinoAppor aWidgetsApp),LedgerThemeDatawithcopyWithandlerp, five presets (quire, terracotta, indigo, verdigris, carbon) by day and by lamplight,LedgerThemeData.fromfor an app's own paper, ink and accent,AnimatedLedgerTheme, three densities (LedgerDensity) and the bundled faces (ledgerLoadFonts). The words a part says by itself come from ui_core'sDesignLocalizations. - The parts: buttons (
LedgerButtonwith.filled,.inkand.text,LedgerIconButton), fields, selects, checkboxes, radios, switches, the segmented control, chips, the stepper and the date picker; ruled rows with their dot leaders, section heads on their rules, slips, receipts, the engraved figure, the mono amount, the seal and the charts; the top bar, the tab bar, the rail and the side bar (LedgerNavigationFrame), dialogs, sheets and toasts. package:ledger_ui/ledger_parts.dart: everything the components are drawn with, for a component copied into an app.
