colveor_ui 0.3.0
colveor_ui: ^0.3.0 copied to clipboard
Themed Flutter UI toolkit with widgets, light/dark theming, go_router routing and base screen classes. The UI layer of Colveor.
Changelog #
0.3.0 #
Breaking #
- Dashboard:
voDashboardControllerProvider,VoDashboardStateandVoDashboardNavigationSourceare removed, along withVoDashboardPane.configSignature,listConfigSignature,mergeRegistryandvalidateForSite. - Dashboard:
VoDashboardControlleris now aChangeNotifier. Pass one asVoDashboard(controller:)to drive the dashboard from outside, or read it fromcontext.dashboardScope.controller. - Dashboard:
VoDashboardScope's constructor changed. Its methods are unchanged:goTo,popShell,canPopShell, the drawer methods andhandleBack. VoPhoneInput:validator,onSavedandonSubmittedreceive the full E.164 number (+447700900123) instead of the typed digits.VoSelectCountryFieldno longer callsonChangedwith the starting country after its first frame, only when the user picks one. Its unusedvalidatorparameter is removed.
New #
VoGroupedViewandVoGroupedView.grid: a list or grid of items split into groups. It supports:- group headers and footers, with optional sticky headers
- sorting of groups and of items within a group
- a slide-in animation for items as they appear (
VoItemAnimation) - pagination (
hasMore/onLoadMore) and pull to refresh VoGroup.fromItemsgives the same grouping without the widget.
VoSelectCountryField,VoCountryandVoCountriesare exported fromwidgets/inputs.dart.VoCountries.searchmatches a country's name, ISO code or dial code.VoCountries.byPhonenow picks the longest matching dial code.e164DialCodegives a dial code without separators (+1268for+1-268).
- Dashboard:
keepPanesAlive,onPaneReselected(called when the current pane is tapped again) and an optionalcontroller. - Documentation now covers every public widget and API, with parameter tables and samples checked against the code. New page:
docs/extensions.md(context.vo, theme extensions,ref.setThemeMode,Color.darken/lighten). - The example app now covers the whole package: theming, routing guards, storage, the dashboard, a sign-in page flow, and a showcase screen for each widget group.
Changes #
VoPinInputno longer depends onpinput; it draws its own boxes over a hidden text field. Its parameters are unchanged.- It supports SMS code autofill, accepts digits only, and calls
onCompletedwhen the code is filled through a sharedcontroller. - A new error clears the code, but clearing the error no longer wipes what the user typed since.
- It no longer disposes a
focusNodepassed in by the caller, and aborderset withoutfocusBorderColororerrorBorderColorno longer crashes. VoPinInputThemeis exported fromwidgets/inputs.dart, so thethemeparameter can be used.
- It supports SMS code autofill, accepts digits only, and calls
- Dependencies:
go_router^18.1.2 (needs Flutter 3.44 / Dart 3.12) andflutter_secure_storage^11.2.0 (Android minSdk 24). Data saved withflutter_secure_storageversions before 10 can no longer be read; 0.2.0 already used 10. - Dashboard panes stay alive after they are first shown, so tabs keep their scroll position and data. Set
keepPanesAlive: falseto rebuild a pane each time it is shown. - Each dashboard has its own state. The nested
ProviderScopenever scoped the controller, so two dashboards shared one. - The dashboard shows its current pane on the first frame instead of after a loading frame.
loadingBuilderis deprecated and unused. - Dashboard back closes an open drawer, then returns to the previously visited pane, then lets the route pop, which supports predictive back. History holds each pane once, so back doesn't replay every tab switch and never lands on a "not found" page.
- Changing the dashboard's
initialPaneKeyshows that pane and keeps history, instead of resetting the dashboard. VoDashboard(style:)now applies itsspacerWidthto the dock.- The default dashboard pane transition is a fade with a slight upward slide. Pass
bodyAnimationBuilderto change it. - The country picker lists each country by flag, name and dial code (it showed
VoCountry(...)text). It can be searched, and lists favorites in the configured order. - A picked country stays selected; it used to snap back to the first country on the next rebuild.
VoPhoneInputparses the number for the selected country, so a national number with a trunk prefix (07700 900123) gives the right full number.VoPhoneInputappliesvalidatorandoverlayType.overlayTypenow defaults tobottomSheet. The olddialogdefault was ignored.
VoPhoneInputuses the phone keyboard.VoPhoneInputapplies these theme options:phoneHint,countryHint,overlayTitle,flagSize,flagShapeanddividerWidth.- A full phone
initialValueno longer loses digits that repeat the dial code. - Numbers such as
+1268…select the right country. - Overlay pickers close with
Navigator.popinstead ofGoRouter.pop, so they work without aGoRouterabove them. VoSelectFieldno longer resets its selection whenever its parent rebuilds.- New default look for overlays:
- Bottom sheets have rounded top corners, a soft upward shadow, a visible drag handle and the theme's barrier color.
- Titles use
typography.titleMedium. - List rows are rounded and inset from the edge. The selected row is tinted with the primary color and gets a check; turn the check off with
VoOverlayTileTheme(showSelectionIndicator: false). - Multi-select rows show a checkbox.
- Every value can still be overridden in
VoOverlayThemeandVoOverlayTileTheme. The new...Of(context)methods return the resolved defaults.
Fixes #
- Opening a bottom sheet with a
ListTilein custom content no longer throws "ListTile background color or ink splashes may be invisible". The sheet background is now painted by aMaterial. - Dialogs with list content no longer crash on intrinsic sizing.
- The bottom sheet drag handle now shows; it was hidden because the sheet controller wasn't attached on the first build.
VoOverlayTile.subtitleBuilderworks without also settingsubtitle.- Dialogs and modals no longer dispose a
scrollControllerpassed in by the caller. VoInputFieldappliesVoFieldOptions.readOnly; read-only fields could be edited.VoPasswordField's visibility icon now shows and hides the password. It also applies thedecorationpassed to it, which was ignored.- Divider and spacer panes have stable keys; rebuilds used to reset the dashboard's pane config.
- Divider panes no longer fill their background with the line color.
- Dashboard pane mistakes, such as a pane in the wrong list or duplicate keys, are reported by a debug assert that names the constructor to use. They used to throw an
ArgumentErrorin release builds.
0.2.0 #
- Added
VoStorage(package:colveor_ui/storage.dart), a key-value store backed by the secure storage colveor_ui already depends on, so apps and packages built on it don't need their own storage dependency. - The theme mode is saved through
VoStorageunder the sametheme_modekey, so saved themes still load. - Documentation now lives in
doc/and is published at colveor.dev. The README links to it.
0.1.0 #
Breaking #
- Removed
VoWidgetandVoConsumerWidget. They stored theBuildContexton the widget instance, so a widget mounted in more than one place (any reusedconstwidget) could read another copy's theme or a closed dialog's context from callbacks. This only showed up in profile and release builds. ExtendStatelessWidget/ConsumerWidgetand usecontext.vofor the helpers. context.voToolkitis nowcontext.vo.VoContextMixin.setToolkitContextis removed;voContextis now an abstract getter.
Changes #
ColveorApptakesdesignSize,minTextAdaptandsplitScreenMode. The design size used to be fixed at 360×690, which is still the default.- Country data now loads the first time
VoPhoneInputorVoSelectCountryFieldis built, not inVoBootstrap.initialize. PasspreloadCountries: trueto load it at startup. - Fixed the integrated
VoPhoneInputcountry label, which defaulted to "Country22". VoStateandVoConsumerStateare unchanged and still expose the helpers as members.context.colorSchemeadded to the theme extension.- Fixed
VoOverlayView's back button, which could pop using another copy's context. - README: install from pub.dev.
0.0.1 #
- Initial release, split out of
colveoras a standalone UI layer. - Widgets: buttons, inputs (text, phone, PIN, password, search, select), display, layout, overlays, feedback and toasts, page flows, dashboard.
- Theming with light/dark mode and overridable colors, sizes, typography and component themes.
go_routerrouting configured throughVoRoutingConfigwith redirect and init callbacks.ColveorApp,ColveorRef,VoBootstrap, andVoWidget/VoState/VoConsumerWidget/VoConsumerStatebase classes.- Utilities:
VoLogger,VoValidators, and date, number, phone and text formatters.