Skip to content

[Material] Switch widget crashes on desktop due to cast error on gesture #114542

@loic-sharma

Description

@loic-sharma

An internal Google team is getting _CastError: gesture exceptions in _MaterialSwitchState._handleDragEnd on macOS.

Internal Google link b/257491764.

Example crash: _CastError: gesture

#0 _MaterialSwitchState._handleDragEnd (package:flutter/src/material/switch.dart:696)
#1 DragGestureRecognizer._checkEnd.<anonymous closure> (package:flutter/src/gestures/monodrag.dart:521)
#2 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:253)
#3 DragGestureRecognizer._checkEnd (package:flutter/src/gestures/monodrag.dart:521)
#4 DragGestureRecognizer.didStopTrackingLastPointer (package:flutter/src/gestures/monodrag.dart:426)
#5 OneSequenceGestureRecognizer.stopTrackingPointer (package:flutter/src/gestures/recognizer.dart:446)
#6 DragGestureRecognizer._giveUpPointer (package:flutter/src/gestures/monodrag.dart:435)
#7 DragGestureRecognizer.handleEvent (package:flutter/src/gestures/monodrag.dart:354)
#8 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:98)
#9 PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:143)
#10 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:624)
#11 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:141)
#12 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:127)
#13 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:460)
#14 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:440)
#15 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:334)
#16 GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:395)
#17 GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:357)
#18 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:314)
#19 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:295)
#20 _invoke1 (dart:ui/hooks.dart:164)
#21 PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:361)
#22 _dispatchPointerDataPacket (dart:ui/hooks.dart:91)

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: desktopRunning on desktopc: crashStack traces logged to the consolecustomer: googleVarious Google teamsf: material designflutter/packages/flutter/material repository.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions