This fixes an error where _textInputConnection! was assumed non-null in RawEditorStateTextInputClientMixin._updateSizeAndTransform, but was producing an error because it in fact was null.
This seems to be because even though it checks hasConnection at the beginning of _updateSizeAndTransform function, before the post-frame callback actually executes the connection is lost and thus _textInputConnection is no longer guaranteed to be non-null when the ! is used. I think this is happening because in my own app where zefyrka is being used, when you navigate back tot the zefyrka page from somewhere else it is doing additional things using post-frame callbacks that take the focus off of the zefyrka editor. I'm not completelly sure what the exact chain of events is, but adding this additional check, although somewhat redundant, prevents the error from happening and does not have any side effects that I can see.
This fixes an error where
_textInputConnection!
was assumed non-null inRawEditorStateTextInputClientMixin._updateSizeAndTransform
, but was producing an error because it in fact was null.This seems to be because even though it checks
hasConnection
at the beginning of_updateSizeAndTransform
function, before the post-frame callback actually executes the connection is lost and thus_textInputConnection
is no longer guaranteed to be non-null when the ! is used. I think this is happening because in my own app where zefyrka is being used, when you navigate back tot the zefyrka page from somewhere else it is doing additional things using post-frame callbacks that take the focus off of the zefyrka editor. I'm not completelly sure what the exact chain of events is, but adding this additional check, although somewhat redundant, prevents the error from happening and does not have any side effects that I can see.