Skip to content

[cannot repro] flutter_driver tap command fails with type cast error #174

@get6

Description

@get6
Image

Description

The flutter_driver tool's tap command fails with a type cast error when attempting to interact with widgets.

Steps to Reproduce

  1. Connect to a running Flutter app via DTD
  2. Execute the flutter_driver command with tap action
{
  "command": "tap",
  "finderType": "ByTooltipMessage",
  "text": "Settings",
  "timeout": 5000
}

Or with ByType:

  {
    "command": "tap",
    "finderType": "ByType",
    "type": "BottomNavigationBar",
    "timeout": 5000
  }

Error Message

  type 'int' is not a subtype of type 'String?' in type cast
  #0      DartToolingDaemonSupport._callFlutterDriver.<anonymous closure> (package:dart_mcp_server/src/mixins/dtd.dart:187)
  <asynchronous suspension>
  #1      DartToolingDaemonSupport._callOnVmService (package:dart_mcp_server/src/mixins/dtd.dart:667)
  <asynchronous suspension>
  #2      DartMCPServer.registerTool.<anonymous closure> (package:dart_mcp_server/src/server.dart:193)
  <asynchronous suspension>
  #3      ToolsSupport._callTool (package:dart_mcp/src/server/tools_support.dart:113)
  <asynchronous suspension>
  #4      Server._handleSingleRequest (package:json_rpc_2/src/server.dart:212)
  <asynchronous suspension>
  #5      Server._handleRequest (package:json_rpc_2/src/server.dart:187)
  <asynchronous suspension>

Environment

  • dart_mcp_server: latest (via npx)
  • Flutter: 3.38.4
  • Dart SDK: 3.9.2
  • OS: macOS

Expected Behavior

The tap command should successfully tap on the specified widget.

Actual Behavior

The command fails immediately with a type cast error, suggesting an issue in the response parsing at dtd.dart:187.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions