-
Notifications
You must be signed in to change notification settings - Fork 15
Add missing textfield properties and bump flutter version #89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,8 @@ | ||
| import 'dart:ui' as ui; | ||
|
|
||
| import 'package:flutter/gestures.dart'; | ||
| import 'package:flutter/material.dart'; | ||
| import 'package:flutter/services.dart'; | ||
| import 'package:languagetool_textfield/src/core/controllers/language_tool_controller.dart'; | ||
| import 'package:languagetool_textfield/src/utils/mistake_popup.dart'; | ||
| import 'package:languagetool_textfield/src/utils/popup_overlay_renderer.dart'; | ||
|
|
@@ -53,6 +57,46 @@ class LanguageToolTextField extends StatefulWidget { | |
| final bool readOnly; | ||
| final MouseCursor? mouseCursor; | ||
| final bool alignCenter; | ||
| final StrutStyle? strutStyle; | ||
| final TextAlignVertical? textAlignVertical; | ||
| final TextCapitalization textCapitalization; | ||
| final bool? showCursor; | ||
| final bool obscureText; | ||
| final SmartDashesType? smartDashesType; | ||
| final SmartQuotesType? smartQuotesType; | ||
| final bool enableSuggestions; | ||
| final MaxLengthEnforcement? maxLengthEnforcement; | ||
| final int? maxLength; | ||
| final VoidCallback? onEditingComplete; | ||
| final List<TextInputFormatter>? inputFormatters; | ||
| final bool? enabled; | ||
| final double cursorWidth; | ||
| final double? cursorHeight; | ||
| final Radius? cursorRadius; | ||
| final EdgeInsets scrollPadding; | ||
| final ScrollPhysics? scrollPhysics; | ||
| final bool? enableInteractiveSelection; | ||
| final InputCounterWidgetBuilder? buildCounter; | ||
| final Iterable<String>? autofillHints; | ||
| final String obscuringCharacter; | ||
| final DragStartBehavior dragStartBehavior; | ||
| final AppPrivateCommandCallback? onAppPrivateCommand; | ||
| final String? restorationId; | ||
| final TextSelectionControls? selectionControls; | ||
| final ui.BoxHeightStyle selectionHeightStyle; | ||
| final ui.BoxWidthStyle selectionWidthStyle; | ||
| final Clip clipBehavior; | ||
| final bool enableIMEPersonalizedLearning; | ||
| final TextMagnifierConfiguration? magnifierConfiguration; | ||
| final bool onTapAlwaysCalled; | ||
| final bool? ignorePointers; | ||
| final bool stylusHandwritingEnabled; | ||
| final ContentInsertionConfiguration? contentInsertionConfiguration; | ||
| final bool canRequestFocus; | ||
| final UndoHistoryController? undoController; | ||
| final Color? cursorErrorColor; | ||
| final WidgetStatesController? statesController; | ||
| final bool? cursorOpacityAnimates; | ||
|
|
||
| /// Creates a widget that checks grammar errors. | ||
| const LanguageToolTextField({ | ||
|
|
@@ -80,6 +124,46 @@ class LanguageToolTextField extends StatefulWidget { | |
| this.onTextChange, | ||
| this.onTextSubmitted, | ||
| this.alignCenter = true, | ||
| this.strutStyle, | ||
| this.textAlignVertical, | ||
| 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, | ||
|
Comment on lines
+129
to
+162
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
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.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
and then in constructor use:
+remove all fields that are duplicated from TextField. This should preserve default values and reduce our code. Can you try this option instead? |
||
| this.undoController, | ||
| this.cursorErrorColor, | ||
| this.statesController, | ||
| this.cursorOpacityAnimates, | ||
| super.key, | ||
| }); | ||
|
|
||
|
|
@@ -148,6 +232,46 @@ class _LanguageToolTextFieldState extends State<LanguageToolTextField> { | |
| onSubmitted: widget.onTextSubmitted, | ||
| onTap: widget.onTap, | ||
| onTapOutside: widget.onTapOutside, | ||
| strutStyle: widget.strutStyle, | ||
| textAlignVertical: widget.textAlignVertical, | ||
| textCapitalization: widget.textCapitalization, | ||
| showCursor: widget.showCursor, | ||
| smartDashesType: widget.smartDashesType, | ||
| smartQuotesType: widget.smartQuotesType, | ||
| enableSuggestions: widget.enableSuggestions, | ||
| obscureText: widget.obscureText, | ||
| maxLength: widget.maxLength, | ||
| maxLengthEnforcement: widget.maxLengthEnforcement, | ||
| onEditingComplete: widget.onEditingComplete, | ||
| inputFormatters: widget.inputFormatters, | ||
| enabled: widget.enabled, | ||
| cursorWidth: widget.cursorWidth, | ||
| cursorHeight: widget.cursorHeight, | ||
| cursorRadius: widget.cursorRadius, | ||
| scrollPadding: widget.scrollPadding, | ||
| scrollPhysics: widget.scrollPhysics, | ||
| enableInteractiveSelection: widget.enableInteractiveSelection, | ||
| buildCounter: widget.buildCounter, | ||
| autofillHints: widget.autofillHints, | ||
| obscuringCharacter: widget.obscuringCharacter, | ||
| dragStartBehavior: widget.dragStartBehavior, | ||
| onAppPrivateCommand: widget.onAppPrivateCommand, | ||
| restorationId: widget.restorationId, | ||
| selectionControls: widget.selectionControls, | ||
| selectionHeightStyle: widget.selectionHeightStyle, | ||
| selectionWidthStyle: widget.selectionWidthStyle, | ||
| clipBehavior: widget.clipBehavior, | ||
| enableIMEPersonalizedLearning: widget.enableIMEPersonalizedLearning, | ||
| magnifierConfiguration: widget.magnifierConfiguration, | ||
| onTapAlwaysCalled: widget.onTapAlwaysCalled, | ||
| ignorePointers: widget.ignorePointers, | ||
| stylusHandwritingEnabled: widget.stylusHandwritingEnabled, | ||
| contentInsertionConfiguration: widget.contentInsertionConfiguration, | ||
| canRequestFocus: widget.canRequestFocus, | ||
| undoController: widget.undoController, | ||
| cursorErrorColor: widget.cursorErrorColor, | ||
| statesController: widget.statesController, | ||
| cursorOpacityAnimates: widget.cursorOpacityAnimates, | ||
| ); | ||
|
|
||
| if (widget.alignCenter) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,12 @@ | ||
| name: languagetool_textfield | ||
| description: The LanguageTool TextField package is a spell-checker designed for Flutter apps. This is useful for apps that need text input like messaging, notes, and email. | ||
| version: 0.1.1 | ||
| version: 1.0.0 | ||
| homepage: https://github.com/solid-software/languagetool_textfield/ | ||
|
|
||
|
|
||
| environment: | ||
| sdk: '>=2.18.6 <4.0.0' | ||
| flutter: ">=1.17.0" | ||
| sdk: ">=3.0.0 <4.0.0" | ||
| flutter: ">=3.27.0" | ||
|
Comment on lines
+8
to
+9
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @illia-romanenko
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds great! |
||
|
|
||
| dependencies: | ||
| async: ^2.11.0 | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.