Skip to content

Assert issue when starting from negative value #19

@vadrian89

Description

@vadrian89

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions