NumberPicker icon indicating copy to clipboard operation
NumberPicker copied to clipboard

Crashes when swiping before first or past last value

Open dhust opened this issue 3 years ago • 1 comments

Works great if I turn infiniteLoop: true. Otherwise, it crashes if I try to swipe before the first or past the last item, but only when the axis is set to Axis.horizontal. It doesn't crash if it's set to Axis.vertical.

NumberPicker(
    value: playerPlaces[index],
    minValue: 1,
    maxValue: players.length,
    step: 1,
    onChanged: (value) {
      setState(() {
        playerPlaces[index] = value;
      });
    },
    axis: Axis.horizontal,
    itemWidth: 30,
    // infiniteLoop: true,
    
  ),

When I restart the app, this error shows:

════════ Exception caught by gesture ═══════════════════════════════════════════
'package:flutter/src/widgets/overscroll_indicator.dart': Failed assertion: line 243 pos 14: 'notification.metrics.axis == widget.axis': is not true.
package:flutter/…/widgets/overscroll_indicator.dart:243
══════════════════════════════════════════════════════════════════════

dhust avatar Jul 27 '22 01:07 dhust

Same problem here, crashes on Axis.horizontal and no infiniteLoop when going out of range

fodienne avatar Dec 06 '23 01:12 fodienne