dartrosa_flutter 0.2.1
dartrosa_flutter: ^0.2.1 copied to clipboard
Flutter renderer for DartRosa: shows ODK XForms as Material widgets, in a Collect-like pager or a single scrolling page.
0.2.1 #
- Read-only text and number questions with a value (a calculation, a default) show the value as text in place of the field, as ODK Collect does (new
ReadOnlyAnswer); a read-only text was treated as a note and showed only its label. Notes (read-only text without a value) stay label only; read-only numbers without a value show—; secrets stay masked. - Scroll mode creates the instances of
jr:countrepeats (on start and whenever a count goes up), as the pager does when it moves into them; it showed none and an add button.jr:countandjr:noAddRemoverepeats never show the add button. NewXFormController.createCountedRepeatInstances(). - Blocked Next and failed Finalize show the whole question in error (label, hint, field and error) before focusing it; the focused text field used to stop the scrolling with the label above the screen.
0.2.0 #
- Adaptive layout by window size class (new
XFormWindowSize): full width on phones; from 600dp a centered column, now capped by default atXFormTheme.defaultMaxContentWidth(720dp) whenmaxContentWidthisnull(double.infinityfills the width). - Form outline (groups, questions, answered / required / error state, current screen) to jump to any question: a side panel from 840dp, a bottom sheet elsewhere. New
XFormView.outline(XFormOutlineMode.adaptive,onRequest,none), publicXFormViewStatewithshowOutline(),hideOutline(),jumpTo(FormIndex)andisOutlinePanelVisible;XFormTheme.outlinePanelWidth. - Pager bottom bar: progress bar and position ("3 of 12", opening the outline), Back disabled on the first screen, Next with a trailing chevron, 48dp buttons on phones, icon buttons when labels don't fit; the end page sums up the answers.
- Keyboard: Page Down / Page Up and Alt+arrows move between pager screens, Enter in a one-line field moves to the next field or screen, Tab follows form order also for controls built later (image maps, lazy lists); image-map areas are focusable and selected with Enter / Space; rank questions get move up / down buttons.
- Errors: blocked Next and failed Finalize scroll to and focus the first question in error (a failed Finalize shows its whole
field-listscreen); text fields in error get a red outline; messages have an error icon. - Desktop and web: visible scroll bars, selectable text (
SelectionArea), time picker in input mode. - Material 3 look: filled group cards (no shadow) unless the app's
CardThemeorXFormThemesays otherwise, nested groups as sections, hints inbodyMedium/onSurfaceVariant,table-listrow dividers, short choices in columns on wide forms (XFormTheme.adaptiveChoiceColumns). - Removing a repeat instance asks for confirmation.
- Non-Gregorian date dialog: the month gets its own line on narrow screens with large text, and the content scrolls.
XFormController.formChanges: notified on every change, for form-wide summaries.- Allows
xml7.x (was 6.x only). - Docs: an illustrated widget catalog (
docs/widgets/in the repository) with a page per control family (XLSForm and XForm for every appearance, states, keyboard and accessibility notes, theXFormDelegateseach needs, theming), 137 screenshots and 8 GIFs rendered by widget tests from purpose-built forms (test/screenshots/); a pub.flutter-io.cn screenshot gallery and a visual tour in the README.
0.1.0 #
- Initial release: Flutter renderer for DartRosa.
XFormViewin pager (Collect-like) and scroll modes, widgets for every ODK control type and the Collect appearances listed in the README.- Platform features through
XFormDelegates;widgetOverrides,XFormTheme,XFormLocalizations, accessibility and RTL support. - Image-map areas are selectable by screen readers (
SvgImageMap.areaBounds); theminimaldropdown is named after its question. - Answer rows move their buttons below the answer when the row doesn't fit (narrow screens, large text); pager pages scroll.
- Error text uses
XFormTheme.errorColoreverywhere. - Non-Gregorian date dialog: day and year spinners sized to their values, so the year isn't cut off on phones.
XFormTheme.maxContentWidth(defaultnull, full width): caps the form's content and centers it on wide screens, in pager and scroll modes.- Answering a question rebuilds only that question and the nodes whose relevance, read-only or required state it changes (previously every visible question rebuilt on any relevance or constraint check); scroll mode keeps the other questions when one is shown or hidden.
- Image maps reuse the highlighted SVG while the selection is unchanged.
- Tests run with Flutter's leak tracker; the example app disposes its workspace.
