Skip to content

Flutter 3.10.4 error on Apple Pencil double tap  #128762

Description

@MousyBusiness

Is there an existing issue for this?

Steps to reproduce

  1. Copy sample code
  2. Double tap Apple Pencil
  3. Observe error

Expected results

No error

Actual results

Gestures produces error

Code sample

Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  TextEditingController _controller = TextEditingController();

  @override
  void initState() {
    super.initState();

    _controller.text = """HELLO""";
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Container(
          height: 600,
          width: 600,
          color: Colors.yellowAccent,
          child: TextField(
            scrollPhysics: const NeverScrollableScrollPhysics(),
            scrollPadding: EdgeInsets.zero,
            controller: _controller,
            keyboardType: TextInputType.multiline,
            decoration: null,
            maxLines: null,
            enabled: true,
            onChanged: (t) {},
            readOnly: false,
            clipBehavior: Clip.none,
          ),
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
======== Exception caught by gestures library ======================================================
The following StateError was thrown while handling a pointer data packet:
Bad state: Unreachable

When the exception was thrown, this was the stack: 
#0      PointerEventConverter.expand.<anonymous closure> (package:flutter/src/gestures/converter.dart:282:15)
#1      MappedIterator.moveNext (dart:_internal/iterable.dart:393:20)
#2      WhereTypeIterator.moveNext (dart:_internal/iterable.dart:871:20)
#3      ListQueue.addAll (dart:collection/queue.dart:748:25)
#4      GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:291:29)
#5      _invoke1 (dart:ui/hooks.dart:158:13)
#6      PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:382:7)
#7      _dispatchPointerDataPacket (dart:ui/hooks.dart:91:31)
====================================================================================================

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.10.4, on macOS 13.2.1 22D68 darwin-arm64, locale en-NZ)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 2021.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2023.1)
[✓] VS Code (version 1.79.0)
[✓] Connected device (2 available)
[✓] Network resources

! Doctor found issues in 2 categories.

Activity

  1. MousyBusiness commented on Jun 13, 2023

    @MousyBusiness
    Author

    Note this is on an iPad Pro using Apple Pencil. Before upgrading flutter from 3.7.12 I have never seen this error

  2. added
    in triagePresently being triaged by the triage team
    on Jun 13, 2023
  3. huycozy commented on Jun 13, 2023

    @huycozy
    Member

    It seems there is an unfinished task as mentioned here:

    case ui.PointerSignalKind.unknown:
    default: // ignore: no_default_cases, to allow adding a new [PointerSignalKind] - PointerStylusAuxiliaryAction
    // TODO(louisehsu): remove after landing engine PR https://github.com/flutter/engine/pull/39637
    // This branch should already have 'unknown' filtered out, but
    // we don't want to return anything or miss if someone adds a new
    // enumeration to PointerSignalKind.
    throw StateError('Unreachable');

    Labeling the issue for more insights (I don't have Apple Pencil device to verify this, though)
    cc @LouiseHsu

  4. added
    c: crashStack traces logged to the console
    platform-iosiOS applications specifically
    frameworkflutter/packages/flutter repository. See also f: labels.
    engineflutter/engine related. See also e: labels.
    f: gesturesflutter/packages/flutter/gestures repository.
    and removed
    in triagePresently being triaged by the triage team
    engineflutter/engine related. See also e: labels.
    on Jun 13, 2023
  5. LouiseHsu commented on Jun 13, 2023

    @LouiseHsu
    Contributor

    Yeah that case needs to be removed, but since the double tap work ended up being scrapped there shouldn't be an unknown PointerSignalKind anyways. I dont have my pencil with me today but let me look into this.

  6. added
    P2Important issues not at the top of the work list
    on Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: crashStack traces logged to the consolef: gesturesflutter/packages/flutter/gestures repository.frameworkflutter/packages/flutter repository. See also f: labels.platform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions