Skip to content

Another exception was thrown: 'package:flutter/src/gestures/monodrag.dart': Failed assertion: line 387 pos 12: '_initialButtons == kPrimaryButton': is not true. #37466

@kecson

Description

@kecson

Steps to Reproduce

1. build a page

  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
      length: 2,
      child: Scaffold(
          appBar: AppBar(
            title: Text('tabbar'),
            bottom: TabBar(
                tabs: Iterable.generate(2, (index) => Tab(text: 'tab$index'))
                    .toList()),
          ),
          body: TabBarView(children: [
            ListView.builder(
                itemCount: 20,
                itemBuilder: (context, index) => ListTile(
                      title: Text('tab 0 list: Item $index'),
                    )),
            ListView.builder(
                itemCount: 30,
                itemBuilder: (context, index) => ListTile(
                      title: Text('tab 1 list: Item $index'),
                    ))
          ])),
    );
  }

2. two fingers simultaneously click on ListView

Logs

I/HiTouch_PressGestureDetector: ACTION_POINTER_DOWN.
I/flutter: ══╡ EXCEPTION CAUGHT BY GESTURE LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter: The following assertion was thrown while dispatching a pointer event:
I/flutter: 'package:flutter/src/gestures/monodrag.dart': Failed assertion: line 357 pos 12: '_initialButtons ==
I/flutter: kPrimaryButton': is not true.
I/flutter: Either the assertion indicates an error in the framework itself, or we should provide substantially
I/flutter: more information in this error message to help you determine and fix the underlying cause.
I/flutter: In either case, please report this assertion by filing a bug on GitHub:
I/flutter:   https://github.com/flutter/flutter/issues/new?template=BUG.md
I/flutter: When the exception was thrown, this was the stack:
I/flutter: #2      DragGestureRecognizer._checkStart (package:flutter/src/gestures/monodrag.dart:357:12)
I/flutter: #3      DragGestureRecognizer.acceptGesture (package:flutter/src/gestures/monodrag.dart:298:7)
I/flutter: #4      GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156:27)
I/flutter: #5      _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:222:20)
I/flutter: #6      _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
I/flutter: #7      _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
I/flutter: #8      _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
I/flutter: #9      _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
I/flutter: #13     _invoke1 (dart:ui/hooks.dart:250:10)
I/flutter: #14     _dispatchPointerDataPacket (dart:ui/hooks.dart:159:5)
I/flutter: (elided 5 frames from class _AssertionError and package dart:async)
I/flutter: Event:
I/flutter:   PointerUpEvent#a8059(position: Offset(101.6, 324.5), timeStamp: 429:52:23.054000, pointer: 101,
I/flutter:   kind: touch, down: false, pressure: 0.1, pressureMin: 0.0)
I/flutter: Target:
I/flutter:   <WidgetsFlutterBinding>
I/flutter: ════════════════════════════════════════════════════════════════════════════════════════════════════
I/flutter: Another exception was thrown: 'package:flutter/src/gestures/monodrag.dart': Failed assertion: line 387 pos 12: '_initialButtons == kPrimaryButton': is not true.

Metadata

Metadata

Assignees

Labels

frameworkflutter/packages/flutter repository. See also f: labels.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions