Skip to content

fix: ignore non-finite steps and steps rounded beyond the bounds - #109

Open
palmoni5 wants to merge 1 commit into
ubuntu-flutter-community:mainfrom
palmoni5:fix/setvalue-guards
Open

palmoni5 wants to merge 1 commit into
ubuntu-flutter-community:mainfrom
palmoni5:fix/setvalue-guards

Conversation

@palmoni5

@palmoni5 palmoni5 commented Nov 10, 2026 •

Copy link
Copy Markdown

Problem

setValue(NaN/±inf) wrote NaN into the field. Rounding to decimals could push a value past a fractional bound: max: 0.29 with one decimal accepted 0.3.

Fix

Ignore non-finite values. Round first, then reject a result outside [min, max].

Behavior

onSubmitted receives the rounded value, as before. With an inconsistent bound such as max: 0.29 and decimals: 1, the arrows stop at 0.2.

Tests

non-finite programmatic steps are ignored, step rounding never escapes fractional bounds.

#110 → #111 → #112 → #113 → #114 are stacked on this one, in that order.

CI on main currently fails in the Android example build and the publish dry-run; it goes green with #102.

setValue clamped the requested value and then formatted it with the
configured number of decimals. A NaN or infinite value was written into
the text field, and rounding could push a clamped value past a
fractional bound (max: 0.29 with decimals: 1 accepted 0.3).

Ignore non-finite values, round before validating, and drop a step whose
rounded value falls outside [min, max]. onSubmitted now receives the
already-rounded value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant