Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assert issue when starting from negative value #19

Closed
vadrian89 opened this issue Feb 26, 2021 · 2 comments
Closed

Assert issue when starting from negative value #19

vadrian89 opened this issue Feb 26, 2021 · 2 comments

Comments

@vadrian89
Copy link

Hello,
First of, thank you for your package!

My issue is that whenever I increment to negative value to 0 (-1 -> 0/ -0.1 -> 0.0) I get this exception:

The following assertion was thrown while handling a gesture:
Assertion failed: org-dartlang-sdk:///flutter_web_sdk/lib/ui/src/ui/text.dart:458:16
start != null && start >= -1
is not true

This is how I initialise the object:

SpinBox(
spacing: 0,
min: min,
max: max,
step: step,
value: value,
decimals: decimals,
onChanged: onChanged,
)

Example of how I use it:

_spinbox(
label: "Max stock",
min: -1,
value: _maxStock,
onChanged: (val) => context.read<ReportsGeneratorCubit>().updateStock(max: val),
),

The issue seem to happen if the field isn't focused.
Any ideea how I can solve it?

@jpnurmi
Copy link
Collaborator

jpnurmi commented Mar 7, 2021

I'm not able to reproduce the issue with a negative value. Could you help me to reproduce the issue? I would need a minimal reproducible example. Something standalone that I can actually run.

@vadrian89
Copy link
Author

Hi, sorry for the late reply I forgot to answer.
I've built my own Spinner widget for the purpose I needed at the time so I deleted the code the app.

@jpnurmi jpnurmi closed this as completed Apr 29, 2021
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

No branches or pull requests

2 participants