moarch 2.5.0
moarch: ^2.5.0 copied to clipboard
Flutter CLI — scaffold Clean Architecture projects with Riverpod, FVM and your own conventions.
2.5.0 #
Features #
AppAsyncView(moarch create widget async-view, generated byinit) — takes oneAsyncValueand draws the four states it can be in: a shimmered shape while the first load runs,ErrorViewwith a retry,EmptyViewwhen the screen says its data counts as empty, and your body when there is something to show. A reload over existing data leaves that data on screen rather than replacing a list mid-read with a spinner, and an error carrying no message of its own shows no detail instead of a stringified exception.ref.listenAction(...)(moarch create widget action-listener, generated byinit) — surfaces the one-shoterror/successfields a generated state already carries as anAppToast. PassonError/onSuccessto navigate or log instead; providing one replaces the toast for that outcome rather than adding to it, and a single action only ever reports one of the two.- The generated feature view is built on both.
moarch create featureused to write a.when(...)mapping by hand and leave// SHOW UI ERRORand// SHOW UI SUCCESSas comments in every feature. It now wires the two widgets up, passes its own body as the skeleton shape, and offers the retryErrorViewdraws a button for. It also writes both widgets if the project predates them, so the view it generates always compiles. AppMultiSelectInput(moarch create widget multi-select) —AppDropdownInput's plural: the same id/label entity list, any number selected, ticked in the search sheet with a per-row checkbox and a Done button. Shows its picks as removable chips, as labels, or as "3 selected"; enforcesrequired,minSelectedandmaxSelected, and stops the unticked rows at the ceiling rather than letting the form refuse the pick afterwards.SearchPickerSheet.showMulti(...)— the multi-select half of the sheet the dropdown and the country picker already open. It works on its own copy of the selection, so a dismissed sheet changes nothing and an empty result is a deliberate "none of them".AppDateRangeInput(moarch create widget date-range-input) — a read-only field holding a start and an end date, with amaxDaysrule the picker itself cannot express. It holds aDateTimeRangerather than the text of one.AppFilePickerField(moarch create widget file-input) — an attachment field: an area that opens whichever picker the app already uses, and a row per file with a thumbnail, a readable size and a remove button. It imports no picker package, so it costs the project no dependency it had not already chosen.AppRating(moarch create widget rating) — stars both ways round: tappable withonChanged, a read-only score without it. Halves come from tapping the left half of a star, and a display-only rating stays out ofForm.validate().AppTabs/AppTabBar(moarch create widget tabs) —AppTabsowns the controller and puts the views under the bar, replacing it when the tab count changes;AppTabBaris thePreferredSizeWidgethalf that drops intoAppAppBar'sbottomslot. Underline or pill indicator.AppDrawer(moarch create widget drawer) — the side menu, readingAppBottomNav's destination list, with header and footer slots. It closes itself after a pick, and does nothing when the same widget is pinned beside the content instead.AppNavRailandAppAdaptiveNav(moarch create widget nav-rail) — the vertical navigation a tablet shows instead of a bottom bar, and the scaffold that picks between them off the 600dp short-side breakpoint. All three nav widgets read oneAppNavDestinationlist.AppFab(moarch create widget fab) — the screen's floating action, circular or extended off one parameter, wearingAppButtonVariant/AppButtonTyperather than a vocabulary of its own.isLoadingswaps the icon for a spinner without resizing the button, andheroTagis exposed for the two-FABs-on-one-screen case.AppTimeline(moarch create widget timeline) — a vertical sequence of events joined by a connector, with done/current/pending/failed nodes.AppTimeline.entryBuilderhands you one row for a lazy list.AppCarousel(moarch create widget carousel) — swipeable pages with stretching dots, optional peek and auto-advance. The timer stops for good on the first swipe and never starts when the platform asks for reduced motion;AppCarouselDotsis usable on its own.
Improvements #
- The design-system preview covers
AppPhoneInputandAppAsyncView— the phone field has been in the kit since 2.4.0 without a preview, and the async view's four states are steppable in it. A new test fails if a widget joins the catalog without either a preview section or an explicit, reasoned exemption, so the screen can no longer fall behind the kit unnoticed. moarch create featurerecords what it writes intoshared/widgets/in.moarch.yaml, somoarch updatecan tell those files apart from ones you have since edited.