Skip to content

Add missing textfield properties and bump flutter version - #89

Closed
vovaklhdella wants to merge 2 commits into
solid-software:mainfrom
vovaklhdella:feat/missing-textfield-propertiens-and-bump
Closed

Add missing textfield properties and bump flutter version#89
vovaklhdella wants to merge 2 commits into
solid-software:mainfrom
vovaklhdella:feat/missing-textfield-propertiens-and-bump

Conversation

@vovaklhdella

Copy link
Copy Markdown

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.

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 LanguageToolTextField widget has been significantly enhanced by adding a comprehensive set of properties that mirror those available in Flutter's standard TextField. 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 to 3.27.0 and the Dart SDK to 3.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

  1. 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.

@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 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.

Comment thread lib/src/presentation/language_tool_text_field.dart

@illia-romanenko illia-romanenko 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.

Thanks for the PR! I added couple questions comments - let me know what you think!

Comment on lines +129 to +162
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,

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.

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?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good point.
But if we make this fields nullable how we can pass it to TextField becuase this fields are required?

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.

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.

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.

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?

Comment thread pubspec.yaml
Comment on lines +8 to +9
sdk: ">=3.0.0 <4.0.0"
flutter: ">=3.27.0"

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.

Do you need any new fields that were introduced after 3.27? Or we can make the version lower to support more versions?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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?

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.

Sounds great!

@illia-romanenko

Copy link
Copy Markdown
Contributor

fixed in #90

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.

2 participants