Skip to content

fix bug in LanguageToolTextField._textControllerListener - #100

Merged
solid-danylosafonov merged 3 commits into
mainfrom
_textControllerListener-bugfix
Jul 20, 2026
Merged

fix bug in LanguageToolTextField._textControllerListener#100
solid-danylosafonov merged 3 commits into
mainfrom
_textControllerListener-bugfix

Conversation

@solid-danylosafonov

Copy link
Copy Markdown
Collaborator

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the _textControllerListener method in LanguageToolTextField to check if _scrollController has active clients before accessing its offset, which prevents potential runtime errors. The reviewer suggests refactoring the ternary operator used for side effects into a standard if statement to align with Dart's idiomatic style and improve readability.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread lib/src/presentation/language_tool_text_field.dart Outdated
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@solid-danylosafonov

Copy link
Copy Markdown
Collaborator Author

/gemini review

@andrew-bekhiet-solid andrew-bekhiet-solid left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one small suggestion

Comment thread lib/src/presentation/language_tool_text_field.dart

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the _textControllerListener in LanguageToolTextField to check if _scrollController has active clients before accessing its offset. The reviewer noted that because this listener is not unregistered upon disposal, it can still trigger after the widget is disposed, leading to an exception when checking hasClients. A suggestion was made to add a mounted check at the start of the listener to prevent this crash.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread lib/src/presentation/language_tool_text_field.dart
@solid-danylosafonov
solid-danylosafonov merged commit 7a4c4f2 into main Jul 20, 2026
1 check passed
@solid-danylosafonov
solid-danylosafonov deleted the _textControllerListener-bugfix branch July 20, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants