unified_fields 0.1.7
unified_fields: ^0.1.7 copied to clipboard
Unified Flutter form fields, phone input with country flags, pickers, Jalali/Gregorian date and time, Persian digits, and Form validate/save/reset.
0.1.7 #
Features #
UnifiedPhoneField— phone input with SVG country flag, optional dial-code section, national mask, and validation. Editable country code uses one field (++ dial + national via [UnifiedPhoneFullNumberFormatter]); fixed or read-only dial code uses a label + national field.UnifiedPhoneField— Persian digit mode viausePersianDigitsanddigitCalendarKind(Jalali): parses Persian/Arabic-Indic input, localizes display (including partial dial prefixes), and applies KookFaNum when active.UnifiedCountry— enum of ~250 countries (ISO, name, dial code). UseUnifiedCountry.ir,UnifiedCountries.byIso('DE'),UnifiedCountries.matchDialCode, etc. Regenerate fromtool/countries.jsonviadart run tool/generate_unified_countries.dart.UnifiedCountryWidget— public flag + optional name/dial row (showNamedefaults tofalse). [showUnifiedPhoneCountryPicker] for standalone country selection.UnifiedFlag— ISO or asset stem → bundled SVG; optionalsize,width,height,borderRadius; reads [UnifiedInputPhoneStyle] from theme.UnifiedInputPhoneStyle/UnifiedInputThemeData.phoneStyle— dial-code box chrome, flag dimensions, invalid dial-code display (messagevshighlightText).UnifiedPhoneFieldController—UnifiedPhoneNumbervalue, national/dial controllers,setCountry, unified single-field entry mode.UnifiedFieldLabelMode—labelInRow,labelInColumn, andfloatingLabel(default on [UnifiedBaseTextField]); set vialabelModeon fields or [UnifiedInputDecoration]. LegacylabelInRow: truestill maps to row mode.
Breaking changes #
UnifiedPhoneCountryremoved — use the [UnifiedCountry] enum (UnifiedCountry.ir, notUnifiedPhoneCountry(isoCode: …)). India:UnifiedCountry.countryIN.UnifiedPhoneCountriesdeprecated — use [UnifiedCountries].UnifiedCountryRowrenamed to [UnifiedCountryWidget].
Fixes #
- Placeholder / hint styling uses [UnifiedColors.hintColor] at 0.72 opacity by default.
- Placeholder no longer falls back to the label string on [UnifiedTextField] and [UnifiedNumberField].
- Phone layout: bounded row height, label modes on [UnifiedPhoneField],
height/widthsupport. - Static analysis:
dart analyzeclean onlib/(including vendoredscrollable_listdartdoc for pub.dev scoring).
0.1.6 #
Features #
UnifiedInputThemeScope— global field chrome viaUnifiedInputThemeData: disabled/locked label and field colors, placeholder, required icon, validation, suffix/clear/loading colors, picker sheet background, default suffix icons per field type.UnifiedInputPickerHeaderStyle— settable picker sheet headerpadding,backgroundColor,titleStyle, andclearButtonColor(sharedUnifiedPickerSheetHeaderfor single and multi pickers).UnifiedInputMultiPickerCheckboxStyle— settable multi-picker checkboxsize,borderRadius,fillColor,checkColor, andborderColor.UnifiedSuffixIconChrome— 32×32 aligned suffix slot so date/time/duration icons line up with picker dropdown and lock/clear affordances.- Custom duration columns —
pickerColumnswith fixed wheel ranges (year0…999, month0…11, week0…4); presets onUnifiedFieldsDurationColumnPresets. - Time / duration wheel pickers, Persian digits (KookFaNum), Jalali calendar and field display improvements (see 0.1.4–0.1.5 notes below).
API #
UnifiedFieldsContextX— prefixed getters (unifiedFieldsScreenWidth,unifiedFieldsUseDialogLayout, …); legacywidth/isDesktopdeprecated.UnifiedFieldsDateWheelStyle.forPicker— namedoverrides:and optionalcontext:for themed sheet background.unifiedFormatDuration/unifiedTryParseDuration— namedgranularity:, optionalpickerColumns:/calendarKind:.
Fixes #
- Picker sheets use theme scope for background color instead of hard-coded values.
- Static-analysis cleanup (
dart analyze libclean).
0.1.5 #
Features #
UnifiedInputThemeData— optional scope viaUnifiedInputThemeScope(onlychildrequired): brightness/palette; disabled & locked label/field colors and opacities; placeholder; required icon; validation/suffix/loading colors;pickerSheetBackgroundColor;UnifiedInputPickerHeaderStyle(header padding and colors);UnifiedInputMultiPickerCheckboxStyle(radius and colors);UnifiedInputDefaultSuffixIcons.UnifiedInputThemeResolver— helpers used by [UnifiedBaseTextField] (disabledLabelColor,disabledFieldColor,requiredIcon,placeholderStyle,validationColor, etc.) plus picker sheet background and default suffix icons.- Picker sheets and wheel chrome use scope sheet background when set; otherwise
Theme.bottomSheetTheme.backgroundColorthen palettesheetBackground.
API #
UnifiedFieldsContextXgetters renamed to avoid app extension clashes:unifiedFieldsScreenWidth,unifiedFieldsScreenHeight,unifiedFieldsUseDialogLayout,unifiedFieldsPrimaryColor(old names kept as@Deprecated).UnifiedFieldsDateWheelStyle.forPicker— optionalcontext:for themed sheet background; positionaloverridesreplaced with namedoverrides:.
Fixes #
- Static analysis: removed unnecessary imports, fixed
use_build_context_synchronouslyin async pickers,use_key_in_widget_constructorsonUnifiedDurationPickerSheet. - Duration calendar columns: year
0…999, month0…11, week0…4on wheels (not squeezed by smallmax).
0.1.4 #
Features and fixes #
- Time/duration wheel pickers, custom duration columns, Persian digits (KookFaNum), Jalali calendar/display fixes, and related APIs (see git history for full 0.1.4 scope).
0.1.3 #
- Field states on
UnifiedBaseTextField:loadingshows a suffix spinner (no full-field overlay or muted disabled chrome);interactionBlockedblocks taps/focus without looking disabled (date, async pickers).isDisabled/disabledshow placeholder and value together when both are set. labelInRow: one outer rounded border around label + body with a straight vertical divider (no inner radius on the body side).- Field controllers:
UnifiedPickerFieldController,UnifiedMultiPickerFieldController, async/date/time/duration/number variants, andUnifiedFormControllerfor imperativeopenPicker/requestFocusthat match tapping the bound field when mounted (attachUnifiedFieldHandlesinfield_controller_sync.dart). - Form + binding sync:
UnifiedForm…picker/date/time/async fields listen tobindingsobinding.clear()updates theFormFieldUI;syncFormFieldFromExternalValuehelpers for external writes. - Date field: uses
interactionBlockedinstead ofdisabled: trueso the picker opens without disabled styling. - Async pickers: removed full-field loading overlay; loading uses the base field suffix spinner.
- Dartdoc: documented remaining public controller APIs and
UnifiedDurationPickerSheetfields;public_member_api_docsis clean forlib/.
0.1.2 #
- Hoisted
isRequiredandplaceholderto the root constructor of every field. Decoration values (UnifiedInputDecoration.requiredField/UnifiedInputDecoration.placeholder) are still honored as a fallback for backwards compatibility, but field-level parameters now win. - Added
Form-aware wrappers for the customizable pickers:UnifiedFormCustomizablePickerField,UnifiedFormCustomizableMultiPickerField,UnifiedFormCustomizableAsyncPickerField. - Added
example/— runnable Flutter app demonstrating form validate/save/reset and theme scope. - Expanded dartdoc on public APIs;
public_member_api_docsenabled forlib/.
0.1.1 #
- Initial pub.dev release scaffolding.
0.1.0 #
- Initial release.