Skip to content

Commit

Permalink
Merge pull request #1185 from tsinis/main
Browse files Browse the repository at this point in the history
feat(ui)!: provide magnifier configuration parameter to form builder text field
  • Loading branch information
deandreamatias authored Feb 17, 2023
2 parents 9742864 + f2b71bc commit 8296f60
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
25 changes: 18 additions & 7 deletions lib/src/fields/form_builder_text_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,14 @@ class FormBuilderTextField extends FormBuilderField<String> {
/// {@macro flutter.widgets.editableText.expands}
final bool expands;

/// Configuration of toolbar options.
/// {@macro flutter.widgets.EditableText.contextMenuBuilder}
///
/// If not set, select all and paste will default to be enabled. Copy and cut
/// will be disabled if [obscureText] is true. If [readOnly] is true,
/// paste and cut will be disabled regardless.
final ToolbarOptions? toolbarOptions;
/// If not provided, will build a default menu based on the platform.
///
/// See also:
///
/// * [AdaptiveTextSelectionToolbar], which is built by default.
final EditableTextContextMenuBuilder? contextMenuBuilder;

/// {@macro flutter.widgets.editableText.showCursor}
final bool? showCursor;
Expand Down Expand Up @@ -284,6 +286,13 @@ class FormBuilderTextField extends FormBuilderField<String> {
/// {@macro flutter.services.autofill.autofillHints}
final Iterable<String>? autofillHints;

///{@macro flutter.widgets.text_selection.TextMagnifierConfiguration.intro}
///
///{@macro flutter.widgets.magnifier.intro}
///
///{@macro flutter.widgets.text_selection.TextMagnifierConfiguration.details}
final TextMagnifierConfiguration? magnifierConfiguration;

/// Creates a Material Design text field input.
FormBuilderTextField({
super.key,
Expand Down Expand Up @@ -336,11 +345,12 @@ class FormBuilderTextField extends FormBuilderField<String> {
this.selectionWidthStyle = ui.BoxWidthStyle.tight,
this.smartDashesType,
this.smartQuotesType,
this.toolbarOptions,
this.selectionHeightStyle = ui.BoxHeightStyle.tight,
this.autofillHints,
this.obscuringCharacter = '•',
this.mouseCursor,
this.contextMenuBuilder,
this.magnifierConfiguration,
}) : assert(initialValue == null || controller == null),
assert(minLines == null || minLines > 0),
assert(maxLines == null || maxLines > 0),
Expand Down Expand Up @@ -405,10 +415,11 @@ class FormBuilderTextField extends FormBuilderField<String> {
selectionWidthStyle: selectionWidthStyle,
smartDashesType: smartDashesType,
smartQuotesType: smartQuotesType,
toolbarOptions: toolbarOptions,
mouseCursor: mouseCursor,
contextMenuBuilder: contextMenuBuilder,
obscuringCharacter: obscuringCharacter,
autofillHints: autofillHints,
magnifierConfiguration: magnifierConfiguration,
);
},
);
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ repository: https://github.com/flutter-form-builder-ecosystem/flutter_form_build
issue_tracker: https://github.com/flutter-form-builder-ecosystem/flutter_form_builder/issues

environment:
sdk: ">=2.17.0 <3.0.0"
flutter: ">=3.0.0"
sdk: ">2.18.9 <3.0.0"
flutter: ">3.6.9"

dependencies:
flutter:
Expand Down

0 comments on commit 8296f60

Please sign in to comment.