Skip to content

Crashes when swiping before first or past last value #134

@dhust

Description

@dhust

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
══════════════════════════════════════════════════════════════════════

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions