number_inc_dec 0.8.0 number_inc_dec: ^0.8.0 copied to clipboard
A flutter widget which accepts numeric values with buttons to increment and decrement.
[0.8.0-null-safety] - 22June2021 #
- Migrated to null safety
[0.7.0] - 19June2021 #
-
autovalidate
has been replaced withautovalidateMode
. More details in TextFormField [docs](TextFormField class - material library - Dart API)-
In your code replace
autovalidate: true
toautovalidateMode: AutovalidateMode.always
-
In your code replace
autovalidate: false
toautovalidateMode: AutovalidateMode.disabled
-
-
autovalidateMode
is by default set toalways
. The morale behind this is to perform validations similar to html's<input type='number'>
tag kind validation performed in chrome. Its not up to the specification but at least mimics to its best. -
New attribute
enableMinMaxClamping
is created to and handles the behavior of clamping the values tomin
andmax
when provided. For example ifmin
is -2 and user enter -5 this is auto-corrected to -2. By default this is attribute is set totrue
. -
New attribute
onChanged
is introduced which when provided will be called whenever the user edits the value. Note this callback will not be called if any validation error exists. -
By default the numbers will be validated for stepped increments like in browser and suggest valid nearest possible values. The intention is to mimic the behavior of number field in Chrome.
-
Fixes the following bugs.
- "autovalidate" is deprecated. Use "autovalidateMode" parameter instead.
- Validation errors causes inc/dec button decoration to displace
- Entering negative numbers when text editing is not possible
- ClampAndUpdate inconsistent while editing.
- NumberInputPrefabbed class unnecessarily re-declares attributes
- onSubmitted callback doesn't update the controller
- While editing the numbers manually the incDecFactor is not considered.
- NumberInputPrefabbed.roundedEdgeButtons doesn't allow overriding the numberFieldDecoration property.
[0.6.6] - 25August2020 #
- Improve code coverage
- Add missing documentation
- Merged pull request which enables
onSubmitted
for the widget.- Thank you Andy Bulka 🥇 😄.
[0.6.5] - 19August2020 #
- increased test coverage.
- fixed lot of typo errors in documentation and code.
- Added
enable
andstyle
attribute to the widgets. - Replace deprecated WhiteListingTextFormatter with FilteringTextInputFormatter.
[0.6.0+3] - 02August2020 #
[0.6.0+2] - 24June2020 #
-
Added 5 different prefabbed widgets for ease of use and as example.
-
Added scale factors for width and height.
-
Provided more options such as icon size, background color and decoration.
-
Added options for call back on Increment and Decrement
-
Added options for different layouts of the increment decrement buttons.