Closed cormalenv closed 4 years ago
Thetypedef
for onIncrement
and onDecrement
callback is DiffIncDecCallBack
as in here. The call back should be a void
method which wont return any value and should accept a parameter of type num
which will be passed with the incremented or decremented value depending on the scenario. Following is an example.
NumberInputWithIncrementDecrement(
controller: myTEC,
min: 1,
max: 10,
initialValue: 5,
onIncrement: (num newValue){
print('Newly incremented value is $newValue')
},
onDecrement: (num newValue){
print('Newly decremented value is $newValue');
},
)
Please check if this helps in your case. I will try to add some more documentation for the relevant section in the upcoming release.
Thanks very much @Abhilash-Chandran!
Glad it helped @cormalenv. Thanks for filing and closing the issue. Let me know if you need any other information. I am working on the documentation for the same.
Unable to add any statement to
onIncrement
oronDecrement
Simple examples
onIncrement: () {var myInt = 1}
oronIncrement: () => myMethod(),
results in
The argument type 'Null Function()' can't be assigned to the parameter type 'void Function(num)'.
andThe argument type 'dynamic Function()' can't be assigned to the parameter type 'void Function(num)'.
Can we get an example of how to use?? Is this right?