Add missing textfield properties and bump flutter version - #89
Add missing textfield properties and bump flutter version#89vovaklhdella wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Summary of Changes
Hello @vovaklhdella, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request primarily focuses on improving the flexibility and compatibility of the LanguageToolTextField widget by exposing a wide array of standard TextField properties. This allows developers to have more granular control over the appearance and behavior of the text field, making it more versatile for various use cases. Additionally, the project's dependencies have been updated to support newer Flutter and Dart SDK versions, ensuring ongoing compatibility and leveraging the latest platform features.
Highlights
- Enhanced TextField Properties: The
LanguageToolTextFieldwidget has been significantly enhanced by adding a comprehensive set of properties that mirror those available in Flutter's standardTextField. This includes properties for text styling, input behavior, cursor appearance, selection controls, and more, providing greater customization and flexibility. - Version and SDK Updates: The package version has been bumped to
1.0.0, indicating a major release. Concurrently, the minimum required Flutter SDK version has been updated to3.27.0and the Dart SDK to3.0.0, aligning the project with recent platform advancements and ensuring compatibility with modern Flutter environments.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request adds missing textfield properties to the LanguageToolTextField widget and bumps the Flutter version. The addition of these properties enhances the customizability of the text field, while the version bump ensures compatibility with newer Flutter features and improvements. Ensure all new properties are documented.
illia-romanenko
left a comment
There was a problem hiding this comment.
Thanks for the PR! I added couple questions comments - let me know what you think!
| this.textCapitalization = TextCapitalization.none, | ||
| this.showCursor, | ||
| this.obscureText = false, | ||
| this.smartDashesType, | ||
| this.smartQuotesType, | ||
| this.enableSuggestions = true, | ||
| this.maxLengthEnforcement, | ||
| this.maxLength, | ||
| this.onEditingComplete, | ||
| this.inputFormatters, | ||
| this.enabled, | ||
| this.cursorWidth = 2.0, | ||
| this.cursorHeight, | ||
| this.cursorRadius, | ||
| this.scrollPadding = const EdgeInsets.all(20.0), | ||
| this.scrollPhysics, | ||
| this.enableInteractiveSelection, | ||
| this.buildCounter, | ||
| this.autofillHints, | ||
| this.obscuringCharacter = '•', | ||
| this.dragStartBehavior = DragStartBehavior.start, | ||
| this.onAppPrivateCommand, | ||
| this.restorationId, | ||
| this.selectionControls, | ||
| this.selectionHeightStyle = ui.BoxHeightStyle.tight, | ||
| this.selectionWidthStyle = ui.BoxWidthStyle.tight, | ||
| this.clipBehavior = Clip.hardEdge, | ||
| this.enableIMEPersonalizedLearning = true, | ||
| this.magnifierConfiguration, | ||
| this.onTapAlwaysCalled = false, | ||
| this.ignorePointers, | ||
| this.stylusHandwritingEnabled = true, | ||
| this.contentInsertionConfiguration, | ||
| this.canRequestFocus = true, |
There was a problem hiding this comment.
Should we skip initializing default values and make fields nullable? Deferring to Flutter TextEdit field to set default values maybe give more compatibility if they were changed in the past or will be changed in the future. What do you think?
There was a problem hiding this comment.
Good point.
But if we make this fields nullable how we can pass it to TextField becuase this fields are required?
There was a problem hiding this comment.
You are right, if looks like there is an issue for that dart-lang/language#1639. Then let's leave it as is, however in some cases with some parameters we should copy default values more precisely?
Here is what it has in TextField:
this.stylusHandwritingEnabled = EditableText.defaultStylusHandwritingEnabled,
Can you double check it and fix where we can? If we can make a release in a non breaking way - that would be nicer.
There was a problem hiding this comment.
We discussed it with @solid-vovabeloded and he suggested that we can extend TextField:
class LanguageToolTextField extends TextField {
and then in constructor use:
super.stylusHandwritingEnabled,
+remove all fields that are duplicated from TextField. This should preserve default values and reduce our code.
Can you try this option instead?
| sdk: ">=3.0.0 <4.0.0" | ||
| flutter: ">=3.27.0" |
There was a problem hiding this comment.
Do you need any new fields that were introduced after 3.27? Or we can make the version lower to support more versions?
There was a problem hiding this comment.
Hi @illia-romanenko
The reason to set the minumum flutter version as 3.27 was to get rid of using deprecated "scribbleEnabled" property. But I can decrease version, add this property and Deprecated annotation.
What are you thoughts?
|
fixed in #90 |
No description provided.