Abhilash-Chandran / number_inc_dec

A flutter widget to accept numeric inputs with button to increment and decrement.

Home Page:https://pub.dev/packages/number_inc_dec

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting Null error if numbers are removed from the tool

rmsmani opened this issue · comments

commented

Getting the below error if the number is removed from the widget, with the help of emulator keyboard
image.

If no value is available the above error is thrown _clampAndUpdate function in number_increment_decrement.dart file.

Am using the latest version.
Version details : number_inc_dec: ^0.8.0

my code

NumberInputPrefabbed.roundedButtons(
  controller: _noOfPagesController,
  min: 1,
  max: 1000,
  initialValue: 5,
  incDecBgColor: Colors.blueAccent,
  enableMinMaxClamping: true,
  autovalidateMode: AutovalidateMode.always,
  buttonArrangement: ButtonArrangement.incRightDecLeft,
  validator: (value) {
    if (value == null || value.isEmpty) {
      return "1";
    }
  },
),

Getting the below error even after including the validator function any thoughts to fix this
image