今天我忽然发现只需要使用TextField组件就会发生异常,在将TextField组件单独拎出来之后这个问题还在。
然后我在搜索引擎搜索了一下,发现将断点中的 All Exceptions 取消勾选之后就正常了。
出现的情况:
报错信息如下:
出现异常。 _TypeError (type 'Null' is not a subtype of type 'Map<Object?, Object?>' in type cast)
异常堆栈如下:
DefaultProcessTextService.queryTextActions (/Users/bolin/development/flutter/packages/flutter/lib/src/services/process_text.dart:122) <asynchronous gap> (未知源:0) EditableTextState._initProcessTextActions (/Users/bolin/development/flutter/packages/flutter/lib/src/widgets/editable_text.dart:2856) <asynchronous gap> (未知源:0)
我是在Github的Flutter存储库的issues中找到这个解决办法的。
链接如下: