moarch 2.4.0
moarch: ^2.4.0 copied to clipboard
Flutter CLI — scaffold Clean Architecture projects with Riverpod, FVM and your own conventions.
2.4.0 #
Features #
AppPhoneInput(moarch create widget phone-input) — a phone field that masks what is typed for the country it is set to, with a searchable country picker in its prefix. The field holds only the national number, so the calling code cannot be typed twice or deleted; read the joined-up value fromAppPhoneNumber.e164. Changing country re-masks the existing digits rather than clearing them.AppCountry(moarch create widget country) — a table of 238 countries with ISO code, calling code and every mask their numbering plan allows. Plans with more than one shape are kept as a list, so the mask widens as the number grows (Hungary 8–9 digits, Germany 10–13), and validation holds a number to those exact lengths instead of a 7-to-15 range. Flags are derived from the ISO code, so no assets ship with it.SearchPickerSheet(moarch create widget search-sheet) — a bottom sheet that picks one row out of a long list, with a search field above it. Opens scrolled to the current selection.AppDropdownInput— swaps the menu for that sheet once the list passesAppInputConfig.searchableThreshold(30), whichsearchable: true/falseoverrules per field. Both forms now validate:required: trueis enforced byForm.validate()rather than only marking the label, andvalidator/autovalidateModework as they do onAppInput. Also gainsonSelected(the picked entity, not just its id),onCleared(which puts a clear button in the field), and the sheet'sleadingOf,trailingLabelOf,filterandemptyLabel.moarch update— refreshes generated UI-kit widgets against the current templates. Files you never touched are refreshed automatically; files you edited are listed, diffed and left alone unless you pass--force..moarch.yaml— a manifest written byinitandcreate widgetrecording the moarch version, the selected stack and a hash of every generated file. It is what letsupdatetell an untouched file from an edited one.moarch doctor --fix— applies the fixes that don't need a decision.
Fixes #
AppDateInput/AppTimeInputshowed nothing without a caller-supplied controller: every value,initialValueand each picked one alike, was written only towidget.controller?.text. They now own a controller when none is passed (and dispose it), so the simplest possible usage displays its value. A controller that already holds text is no longer overwritten byinitialValueeither — the caller's value wins, as it does onAppInput.required: trueonAppDateInputandAppTimeInputonly drew an asterisk;Form.validate()passed an empty field. Both now validate, and take avalidator/autovalidateModelike the rest of the family.AppLoadingActionOverlaystarted its message timers only on a false-to-true change, so a screen that mounted with a request already in flight showed a bare spinner forever. They now start ininitStatetoo.AppSegmentedandAppChoiceChipdrew their selected foreground incolorScheme.surface, which is only the right answer in a light theme. Both now use the newAppInputStyle.onAccentOf, whichAppCheckboxandAppSwitchshare.
Improvements #
-
Selection controls validate.
AppCheckboxLabel(required: true)is the "accept the terms" checkbox aFormcan enforce, andAppRadioGroup(required: true)refuses to validate until one option is chosen. Both render the error under the control through the newSelectionFormField, which is exposed for wrapping any control of your own. -
AppSegmentedandAppRadioGroupassert that the current selection is actually one of the options, instead of silently rendering with nothing highlighted. -
AppCheckboxLabel,AppRadioGroup,AppSegmentedandAppChoiceChipall take a null callback to disable themselves, matchingAppCheckbox,AppSwitch,AppSliderandAppStepper.AppDateInputandAppTimeInputgainenabledalongside their existingreadOnly. -
AppStepper's − and + carry tooltips and semantics, and meet the 48px minimum tap target. -
moarch doctornow checks what the scaffold actually depends on: whetherbuild_runnerhas generatedapp_env.g.dart, whether both localization approaches ended up installed, whether every generated widget's dependencies and pub packages are present, and whether router-dependent widgets have a router. Findings carry hints, and say which are fixable.