From e39a78340541fd3fe53407a46a37076ca708a57d Mon Sep 17 00:00:00 2001 From: Joan Pablo Date: Fri, 20 Oct 2023 10:26:31 -0400 Subject: [PATCH 1/2] Add default context menu builder to reactive text field --- lib/src/widgets/reactive_text_field.dart | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/src/widgets/reactive_text_field.dart b/lib/src/widgets/reactive_text_field.dart index e682726..89fac18 100644 --- a/lib/src/widgets/reactive_text_field.dart +++ b/lib/src/widgets/reactive_text_field.dart @@ -19,6 +19,13 @@ import 'package:reactive_forms/reactive_forms.dart'; class ReactiveTextField extends ReactiveFormField { final TextEditingController? _textController; + static Widget _defaultContextMenuBuilder( + BuildContext context, EditableTextState editableTextState) { + return AdaptiveTextSelectionToolbar.editableText( + editableTextState: editableTextState, + ); + } + /// Creates a [ReactiveTextField] that contains a [TextField]. /// /// Can optionally provide a [formControl] to bind this widget to a control. @@ -101,7 +108,8 @@ class ReactiveTextField extends ReactiveFormField { TextAlignVertical? textAlignVertical, bool autofocus = false, bool readOnly = false, - EditableTextContextMenuBuilder? contextMenuBuilder, + EditableTextContextMenuBuilder? contextMenuBuilder = + _defaultContextMenuBuilder, bool? showCursor, bool obscureText = false, String obscuringCharacter = '•', From 145962fa9cdbaa0e1313bb545cfbbae8c6e8abe7 Mon Sep 17 00:00:00 2001 From: Joan Pablo Date: Fri, 20 Oct 2023 10:29:26 -0400 Subject: [PATCH 2/2] Release 16.1.1 --- CHANGELOG.md | 6 ++++++ README.md | 2 +- pubspec.yaml | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b87a41..f4276b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 16.1.1 + +## Fixes + +- Add default Context Menu to `ReactiveTextField`. + # 16.1.0 ## Features diff --git a/README.md b/README.md index 9b52429..631cb8a 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ dependencies: flutter: sdk: flutter - reactive_forms: ^16.1.0 + reactive_forms: ^16.1.1 ``` Then run the command `flutter packages get` on the console. diff --git a/pubspec.yaml b/pubspec.yaml index 081c17d..9977232 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: reactive_forms description: This is a model-driven approach to handling form inputs and validations, heavily inspired in Angular Reactive Forms. -version: 16.1.0 +version: 16.1.1 homepage: "https://github.com/joanpablo/reactive_forms" environment: