moarch 2.5.1 copy "moarch: ^2.5.1" to clipboard
moarch: ^2.5.1 copied to clipboard

Flutter CLI — scaffold Clean Architecture projects with Riverpod, FVM and your own conventions.

2.5.1 #

Features #

  • AppAsyncView (moarch create widget async-view, generated by init) — takes one AsyncValue and draws the four states it can be in: a shimmered shape while the first load runs, ErrorView with a retry, EmptyView when 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 by init) — surfaces the one-shot error / success fields a generated state already carries as an AppToast. Pass onError / onSuccess to 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 feature used to write a .when(...) mapping by hand and leave // SHOW UI ERROR and // SHOW UI SUCCESS as comments in every feature. It now wires the two widgets up, passes its own body as the skeleton shape, and offers the retry ErrorView draws 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"; enforces required, minSelected and maxSelected, 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 a maxDays rule the picker itself cannot express. It holds a DateTimeRange rather 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 with onChanged, a read-only score without it. Halves come from tapping the left half of a star, and a display-only rating stays out of Form.validate().
  • AppTabs / AppTabBar (moarch create widget tabs) — AppTabs owns the controller and puts the views under the bar, replacing it when the tab count changes; AppTabBar is the PreferredSizeWidget half that drops into AppAppBar's bottom slot. Underline or pill indicator.
  • AppDrawer (moarch create widget drawer) — the side menu, reading AppBottomNav'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.
  • AppNavRail and AppAdaptiveNav (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 one AppNavDestination list.
  • AppFab (moarch create widget fab) — the screen's floating action, circular or extended off one parameter, wearing AppButtonVariant / AppButtonType rather than a vocabulary of its own. isLoading swaps the icon for a spinner without resizing the button, and heroTag is 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.entryBuilder hands 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; AppCarouselDots is usable on its own.

Fixes #

  • moarch init never wrote its own lib/main.dart. flutter create leaves one behind and generated files are never clobbered, so on the documented quick start (flutter createmoarch init) the counter demo survived and the scaffold's main.dart — the one that installs ProviderScope and initialises the selected services — was silently skipped. Every scaffolded app was missing its provider root. The counter demo is now replaced, matched on the two private names only that template declares; a main.dart you wrote is still left alone, and init says so instead of passing over it in silence. The counter widget_test.dart that pumped it is replaced on the same terms, so flutter test passes on a fresh project.
  • file_picker resolved to 3.0.4 (2021) whenever the media service was selected, and 3.0.4 predates AGP's namespace requirement — so the Android build failed with "Namespace not specified" before the app could run. The entry was unversioned, and pub is free to resolve backwards: file_picker 11 wants win32 ^5, flutter_secure_storage_windows wants win32 ^6, and walking file_picker back to 3.0.4 settled that Windows-only conflict. It now carries a ^11.0.0 floor, and MediaService calls the static FilePicker.pickFiles that version moved to.
  • Three widgets used null-aware elements (?header), which need the project's pubspec to ask for Dart 3.8+ — not merely a recent SDK to be installed — so they failed to compile in a project scaffolded a while ago. Rewritten to constructs with no language-version floor, and a test now fails if a template reaches for one again.

Improvements #

  • AppToast was redrawn. It was a grey surfaceContainerHighest bar with a 4px accent stripe and an icon beside it — a Material 2 snackbar with a decoration. It is now a card: a surface tinted 7% with the status color, a status-colored outline, a soft shadow, and the icon in a tonal chip matching AppLeadingIcon's. The outline is what the old one could not have — a SnackBar takes a color and a shape but not a border — so the toast now draws its own card inside a transparent, unelevated SnackBar. It also gains a title over the detail line, an optional close button, a warning / info helper to go with success / error, AppToast.dismiss, a 480px ceiling so it stays a card rather than a banner on a tablet, and sideways swipe-to-dismiss. In dark themes it now sits on surfaceContainerHighest — an overlay has to be lighter than the page it covers, and the old bar was darker than the content behind it.
  • AppButton's hint moved inside the button, centered under the label, in the button's own foreground color; the button grows to fit it. It used to be a left-aligned line floating above the button, which read as a caption for whatever was above it rather than as part of the action.
  • The design-system preview covers AppPhoneInput and AppAsyncView — 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 feature records what it writes into shared/widgets/ in .moarch.yaml, so moarch update can tell those files apart from ones you have since edited.
2
likes
0
points
6.17k
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter CLI — scaffold Clean Architecture projects with Riverpod, FVM and your own conventions.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

args, mason_logger, path, yaml, yaml_edit

More

Packages that depend on moarch