From 25c9f9aa92219030126f42a2795242201db73957 Mon Sep 17 00:00:00 2001 From: Matias de Andrea Date: Sun, 11 Aug 2024 11:06:26 +0200 Subject: [PATCH 1/2] feat: upgrade dependencies version --- example/pubspec.lock | 76 ++-- example/pubspec.yaml | 8 +- lib/src/fields/form_builder_typeahead.dart | 496 +++++++-------------- pubspec.lock | 72 ++- pubspec.yaml | 15 +- 5 files changed, 274 insertions(+), 393 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index 11e28b8..10757e3 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: archive - sha256: "6bd38d335f0954f5fad9c79e614604fbf03a0e5b975923dd001b6ea965ef5b4b" + sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d url: "https://pub.dev" source: hosted - version: "3.6.0" + version: "3.6.1" args: dependency: transitive description: @@ -98,18 +98,18 @@ packages: dependency: "direct main" description: name: flutter_form_builder - sha256: "447f8808f68070f7df968e8063aada3c9d2e90e789b5b70f3b44e4b315212656" + sha256: ba557c8933bef822fe5469f9267579379f362faf60c7a776c93bfa79cdda0446 url: "https://pub.dev" source: hosted - version: "9.3.0" + version: "9.4.0" flutter_keyboard_visibility: dependency: transitive description: name: flutter_keyboard_visibility - sha256: "4983655c26ab5b959252ee204c2fffa4afeb4413cd030455194ec0caa3b8e7cb" + sha256: "98664be7be0e3ffca00de50f7f6a287ab62c763fc8c762e0a21584584a3ff4f8" url: "https://pub.dev" source: hosted - version: "5.4.1" + version: "6.0.0" flutter_keyboard_visibility_linux: dependency: transitive description: @@ -188,10 +188,10 @@ packages: dependency: transitive description: name: flutter_typeahead - sha256: b9942bd5b7611a6ec3f0730c477146cffa4cd4b051077983ba67ddfc9e7ee818 + sha256: d64712c65db240b1057559b952398ebb6e498077baeebf9b0731dade62438a6d url: "https://pub.dev" source: hosted - version: "4.8.0" + version: "5.2.0" flutter_web_plugins: dependency: transitive description: flutter @@ -208,10 +208,10 @@ packages: dependency: "direct main" description: name: form_builder_validators - sha256: "475853a177bfc832ec12551f752fd0001278358a6d42d2364681ff15f48f67cf" + sha256: c61ed7b1deecf0e1ebe49e2fa79e3283937c5a21c7e48e3ed9856a4a14e1191a url: "https://pub.dev" source: hosted - version: "10.0.1" + version: "11.0.0" http: dependency: transitive description: @@ -248,18 +248,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" url: "https://pub.dev" source: hosted - version: "10.0.4" + version: "10.0.5" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.5" leak_tracker_testing: dependency: transitive description: @@ -288,18 +288,18 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.15.0" path: dependency: transitive description: @@ -336,10 +336,34 @@ packages: dependency: transitive description: name: pointer_interceptor - sha256: adf7a637f97c077041d36801b43be08559fd4322d2127b3f20bb7be1b9eebc22 + sha256: "57210410680379aea8b1b7ed6ae0c3ad349bfd56fe845b8ea934a53344b9d523" + url: "https://pub.dev" + source: hosted + version: "0.10.1+2" + pointer_interceptor_ios: + dependency: transitive + description: + name: pointer_interceptor_ios + sha256: a6906772b3205b42c44614fcea28f818b1e5fdad73a4ca742a7bd49818d9c917 + url: "https://pub.dev" + source: hosted + version: "0.10.1" + pointer_interceptor_platform_interface: + dependency: transitive + description: + name: pointer_interceptor_platform_interface + sha256: "0597b0560e14354baeb23f8375cd612e8bd4841bf8306ecb71fcd0bb78552506" + url: "https://pub.dev" + source: hosted + version: "0.10.0+1" + pointer_interceptor_web: + dependency: transitive + description: + name: pointer_interceptor_web + sha256: "7a7087782110f8c1827170660b09f8aa893e0e9a61431dbbe2ac3fc482e8c044" url: "https://pub.dev" source: hosted - version: "0.9.3+7" + version: "0.10.2+1" signature: dependency: transitive description: @@ -397,10 +421,10 @@ packages: dependency: transitive description: name: test_api - sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.7.0" + version: "0.7.2" typed_data: dependency: transitive description: @@ -445,10 +469,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc url: "https://pub.dev" source: hosted - version: "14.2.1" + version: "14.2.4" web: dependency: transitive description: @@ -466,5 +490,5 @@ packages: source: hosted version: "6.5.0" sdks: - dart: ">=3.4.0 <4.0.0" - flutter: ">=3.22.0" + dart: ">=3.5.0 <4.0.0" + flutter: ">=3.24.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 51eb1cd..b23abc8 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -5,18 +5,18 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ">=3.5.0 <4.0.0" + flutter: ">=3.24.0" dependencies: flutter: sdk: flutter - flutter_form_builder: ^9.3.0 + flutter_form_builder: ^9.4.0 flutter_localizations: sdk: flutter form_builder_extra_fields: path: ../ - form_builder_validators: ^10.0.1 + form_builder_validators: ^11.0.0 dev_dependencies: flutter_lints: ^4.0.0 diff --git a/lib/src/fields/form_builder_typeahead.dart b/lib/src/fields/form_builder_typeahead.dart index e06f485..1b99b07 100644 --- a/lib/src/fields/form_builder_typeahead.dart +++ b/lib/src/fields/form_builder_typeahead.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:flutter/material.dart'; import 'package:flutter_form_builder/flutter_form_builder.dart'; import 'package:flutter_typeahead/flutter_typeahead.dart'; @@ -6,306 +8,51 @@ typedef SelectionToTextTransformer = String Function(T suggestion); /// Text field that auto-completes user input from a list of items class FormBuilderTypeAhead extends FormBuilderFieldDecoration { - /// Called with the search pattern to get the search suggestions. - /// - /// This callback must not be null. It is be called by the TypeAhead widget - /// and provided with the search pattern. It should return a [List](https://api.dartlang.org/stable/2.0.0/dart-core/List-class.html) - /// of suggestions either synchronously, or asynchronously (as the result of a - /// [Future](https://api.dartlang.org/stable/dart-async/Future-class.html)). - /// Typically, the list of suggestions should not contain more than 4 or 5 - /// entries. These entries will then be provided to [itemBuilder] to display - /// the suggestions. - /// - /// Example: - /// ```dart - /// suggestionsCallback: (pattern) async { - /// return await _getSuggestions(pattern); - /// } - /// ``` - final SuggestionsCallback suggestionsCallback; - - /// Called when a suggestion is tapped. - /// - /// This callback must not be null. It is called by the TypeAhead widget and - /// provided with the value of the tapped suggestion. - /// - /// For example, you might want to navigate to a specific view when the user - /// tabs a suggestion: - /// ```dart - /// onSuggestionSelected: (suggestion) { - /// Navigator.of(context).push(MaterialPageRoute( - /// builder: (context) => SearchResult( - /// searchItem: suggestion - /// ) - /// )); - /// } - /// ``` - /// - /// Or to set the value of the text field: - /// ```dart - /// onSuggestionSelected: (suggestion) { - /// _controller.text = suggestion['name']; - /// } - /// ``` - final SuggestionSelectionCallback? onSuggestionSelected; - - /// Called for each suggestion returned by [suggestionsCallback] to build the - /// corresponding widget. - /// - /// This callback must not be null. It is called by the TypeAhead widget for - /// each suggestion, and expected to build a widget to display this - /// suggestion's info. For example: - /// - /// ```dart - /// itemBuilder: (context, suggestion) { - /// return ListTile( - /// title: Text(suggestion['name']), - /// subtitle: Text('USD' + suggestion['price'].toString()) - /// ); - /// } - /// ``` - final ItemBuilder itemBuilder; - - /// The decoration of the material sheet that contains the suggestions. - /// - /// If null, default decoration with an elevation of 4.0 is used - final SuggestionsBoxDecoration suggestionsBoxDecoration; - - /// Used to control the `_SuggestionsBox`. Allows manual control to - /// open, close, toggle, or resize the `_SuggestionsBox`. - final SuggestionsBoxController? suggestionsBoxController; - - /// The duration to wait after the user stops typing before calling - /// [suggestionsCallback] - /// - /// This is useful, because, if not set, a request for suggestions will be - /// sent for every character that the user types. - /// - /// This duration is set by default to 300 milliseconds + final FutureOr?> Function(String) suggestionsCallback; + final void Function(T)? onSelected; + final Widget Function(BuildContext, T) itemBuilder; + final Widget Function(BuildContext, Widget)? decorationBuilder; + final SuggestionsController? suggestionsController; final Duration debounceDuration; - - /// Called when waiting for [suggestionsCallback] to return. - /// - /// It is expected to return a widget to display while waiting. - /// For example: - /// ```dart - /// (BuildContext context) { - /// return Text('Loading...'); - /// } - /// ``` - /// - /// If not specified, a [CircularProgressIndicator](https://docs.flutter.io/flutter/material/CircularProgressIndicator-class.html) is shown final WidgetBuilder? loadingBuilder; - - /// Called when [suggestionsCallback] returns an empty array. - /// - /// It is expected to return a widget to display when no suggestions are - /// available. - /// For example: - /// ```dart - /// (BuildContext context) { - /// return Text('No Items Found!'); - /// } - /// ``` - /// - /// If not specified, a simple text is shown - final WidgetBuilder? noItemsFoundBuilder; - - /// Called when [suggestionsCallback] throws an exception. - /// - /// It is called with the error object, and expected to return a widget to - /// display when an exception is thrown - /// For example: - /// ```dart - /// (BuildContext context, error) { - /// return Text('$error'); - /// } - /// ``` - /// - /// If not specified, the error is shown in [ThemeData.errorColor](https://docs.flutter.io/flutter/material/ThemeData/errorColor.html) - final ErrorBuilder? errorBuilder; - - /// Called to display animations when [suggestionsCallback] returns suggestions - /// - /// It is provided with the suggestions box instance and the animation - /// controller, and expected to return some animation that uses the controller - /// to display the suggestion box. - /// - /// For example: - /// ```dart - /// transitionBuilder: (context, suggestionsBox, animationController) { - /// return FadeTransition( - /// child: suggestionsBox, - /// opacity: CurvedAnimation( - /// parent: animationController, - /// curve: Curves.fastOutSlowIn - /// ), - /// ); - /// } - /// ``` - /// This argument is best used with [animationDuration] and [animationStart] - /// to fully control the animation. - /// - /// To fully remove the animation, just return `suggestionsBox` - /// - /// If not specified, a [SizeTransition](https://docs.flutter.io/flutter/widgets/SizeTransition-class.html) is shown. - final AnimationTransitionBuilder? transitionBuilder; - - /// The duration that [transitionBuilder] animation takes. - /// - /// This argument is best used with [transitionBuilder] and [animationStart] - /// to fully control the animation. - /// - /// Defaults to 500 milliseconds. + final WidgetBuilder? emptyBuilder; + final Widget Function(BuildContext, Object)? errorBuilder; + final Widget Function(BuildContext, Animation, Widget)? + transitionBuilder; final Duration animationDuration; + final VerticalDirection? direction; - /// Determine the [SuggestionBox]'s direction. - /// - /// If [AxisDirection.down], the [SuggestionBox] will be below the [TextField] - /// and the [_SuggestionsList] will grow **down**. - /// - /// If [AxisDirection.up], the [SuggestionBox] will be above the [TextField] - /// and the [_SuggestionsList] will grow **up**. - /// - /// [AxisDirection.left] and [AxisDirection.right] are not allowed. - final AxisDirection direction; - - /// The value at which the [transitionBuilder] animation starts. + /// Custom text field to use instead of the default [TextField] /// - /// This argument is best used with [transitionBuilder] and [animationDuration] - /// to fully control the animation. + /// When use this parameter, FormBuilderTypeAhead will be override the + /// following properties: /// - /// Defaults to 0.25. - final double animationStart; - - /// The configuration of the [TextField](https://docs.flutter.io/flutter/material/TextField-class.html) - /// that the TypeAhead widget displays - final TextFieldConfiguration textFieldConfiguration; - - /// How far below the text field should the suggestions box be - /// - /// Defaults to 5.0 - final double suggestionsBoxVerticalOffset; - - /// If set to true, suggestions will be fetched immediately when the field is - /// added to the view. - /// - /// But the suggestions box will only be shown when the field receives focus. - /// To make the field receive focus immediately, you can set the `autofocus` - /// property in the [textFieldConfiguration] to true - /// - /// Defaults to false - final bool getImmediateSuggestions; - - /// If set to true, no loading box will be shown while suggestions are - /// being fetched. [loadingBuilder] will also be ignored. - /// - /// Defaults to false. + /// - enabled + /// - decoration + /// - controller + /// - focusNode + /// - style.disabled + final TextField? customTextField; + final Offset? offset; final bool hideOnLoading; - - /// If set to true, nothing will be shown if there are no results. - /// [noItemsFoundBuilder] will also be ignored. - /// - /// Defaults to false. final bool hideOnEmpty; - - /// If set to true, nothing will be shown if there is an error. - /// [errorBuilder] will also be ignored. - /// - /// Defaults to false. final bool hideOnError; - - /// If set to false, the suggestions box will stay opened after - /// the keyboard is closed. - /// - /// Defaults to true. - final bool hideSuggestionsOnKeyboardHide; - - /// If set to false, the suggestions box will show a circular - /// progress indicator when retrieving suggestions. - /// - /// Defaults to true. - final bool keepSuggestionsOnLoading; - - /// If set to true, the suggestions box will remain opened even after - /// selecting a suggestion. - /// - /// Note that if this is enabled, the only way - /// to close the suggestions box is either manually via the - /// `SuggestionsBoxController` or when the user closes the software - /// keyboard if `hideSuggestionsOnKeyboardHide` is set to true. Users - /// with a physical keyboard will be unable to close the - /// box without a manual way via `SuggestionsBoxController`. - /// - /// Defaults to false. - final bool keepSuggestionsOnSuggestionSelected; - - /// If set to true, in the case where the suggestions box has less than - /// _SuggestionsBoxController.minOverlaySpace to grow in the desired [direction], the direction axis - /// will be temporarily flipped if there's more room available in the opposite - /// direction. - /// - /// Defaults to false + final bool hideWithKeyboard; + final bool retainOnLoading; + final bool hideOnSelect; final bool autoFlipDirection; - final SelectionToTextTransformer? selectionToTextTransformer; - - /// Controls the text being edited. - /// - /// If null, this widget will create its own [TextEditingController]. final TextEditingController? controller; - - final bool hideKeyboard; - + final bool hideOnUnfocus; final ScrollController? scrollController; - final IndexedWidgetBuilder? itemSeparatorBuilder; - - /// By default, we render the suggestions in a ListView, using - /// the `itemBuilder` to construct each element of the list. Specify - /// your own `layoutArchitecture` if you want to be responsible - /// for layinng out the widgets using some other system (like a grid). - final LayoutArchitecture? layoutArchitecture; - - /// Used to overcome [Flutter issue 98507](https://github.com/flutter/flutter/issues/98507) - /// Most commonly experienced when placing the [TypeAheadFormField] on a google map in Flutter Web. - final bool intercepting; - - /// If set to false, suggestion list will not be reversed according to the - /// [autoFlipDirection] property. - /// - /// Defaults to true. + final Widget Function(BuildContext, List)? listBuilder; final bool autoFlipListDirection; - - /// Minimum height below [autoFlipDirection] is triggered - /// - /// Defaults to 64.0. final double autoFlipMinHeight; - - /// The minimum number of characters which must be entered before - /// [suggestionsCallback] is triggered. - /// - /// Defaults to 0. - final int minCharsForSuggestions; - - /// If set to true and if the user scrolls through the suggestion list, hide the keyboard automatically. - /// If set to false, the keyboard remains visible. - /// Throws an exception, if hideKeyboardOnDrag and hideSuggestionsOnKeyboardHide are both set to true as - /// they are mutual exclusive. - /// - /// Defaults to false final bool hideKeyboardOnDrag; + final bool showOnFocus; + final BoxConstraints? constraints; - /// Allows a bypass of a problem on Flutter 3.7+ with the accessibility through Overlay - /// that prevents flutter_typeahead to register a click on the list of suggestions properly. - /// - /// Defaults to false - final bool ignoreAccessibleNavigation; - - // Adds a callback for the suggestion box opening or closing - final void Function(bool)? onSuggestionsBoxToggle; - - /// Creates text field that auto-completes user input from a list of items FormBuilderTypeAhead({ super.key, super.autovalidateMode, @@ -322,39 +69,35 @@ class FormBuilderTypeAhead extends FormBuilderFieldDecoration { required this.itemBuilder, required this.suggestionsCallback, this.animationDuration = const Duration(milliseconds: 500), - this.animationStart = 0.25, this.autoFlipDirection = false, this.controller, this.debounceDuration = const Duration(milliseconds: 300), - this.direction = AxisDirection.down, + this.direction, this.errorBuilder, - this.getImmediateSuggestions = false, - this.hideKeyboard = false, + this.hideOnUnfocus = true, this.hideOnEmpty = false, this.hideOnError = false, this.hideOnLoading = false, - this.hideSuggestionsOnKeyboardHide = true, - this.keepSuggestionsOnLoading = true, - this.keepSuggestionsOnSuggestionSelected = false, + this.hideWithKeyboard = true, + this.retainOnLoading = true, + this.hideOnSelect = true, this.loadingBuilder, - this.noItemsFoundBuilder, - this.onSuggestionSelected, + this.emptyBuilder, + this.onSelected, this.scrollController, this.selectionToTextTransformer, - this.suggestionsBoxController, - this.suggestionsBoxDecoration = const SuggestionsBoxDecoration(), - this.suggestionsBoxVerticalOffset = 5.0, - this.textFieldConfiguration = const TextFieldConfiguration(), + this.suggestionsController, + this.decorationBuilder, + this.offset, + this.customTextField, this.transitionBuilder, this.autoFlipListDirection = true, this.autoFlipMinHeight = 64.0, this.hideKeyboardOnDrag = false, - this.ignoreAccessibleNavigation = false, - this.intercepting = false, this.itemSeparatorBuilder, - this.layoutArchitecture, - this.minCharsForSuggestions = 0, - this.onSuggestionsBoxToggle, + this.listBuilder, + this.showOnFocus = true, + this.constraints, }) : assert(T == String || selectionToTextTransformer != null), super( builder: (FormFieldState field) { @@ -362,55 +105,63 @@ class FormBuilderTypeAhead extends FormBuilderFieldDecoration { final theme = Theme.of(state.context); return TypeAheadField( - textFieldConfiguration: textFieldConfiguration.copyWith( - enabled: state.enabled, - controller: state._typeAheadController, - style: state.enabled - ? textFieldConfiguration.style - : theme.textTheme.titleMedium!.copyWith( - color: theme.disabledColor, - ), - focusNode: state.effectiveFocusNode, - decoration: state.decoration, - ), - autoFlipListDirection: autoFlipListDirection, + controller: state._typeAheadController, + focusNode: state.effectiveFocusNode, + showOnFocus: showOnFocus, + constraints: constraints, + builder: (context, controller, focusNode) { + return customTextField != null + ? customTextField.copyWith( + enabled: state.enabled, + controller: controller, + focusNode: focusNode, + decoration: state.decoration, + style: state.enabled + ? customTextField.style + : theme.textTheme.titleMedium!.copyWith( + color: theme.disabledColor, + ), + ) + : TextField( + enabled: state.enabled, + controller: controller, + focusNode: focusNode, + decoration: state.decoration, + style: state.enabled + ? theme.textTheme.titleMedium + : theme.textTheme.titleMedium!.copyWith( + color: theme.disabledColor, + ), + ); + }, autoFlipMinHeight: autoFlipMinHeight, hideKeyboardOnDrag: hideKeyboardOnDrag, - ignoreAccessibleNavigation: ignoreAccessibleNavigation, - intercepting: intercepting, itemSeparatorBuilder: itemSeparatorBuilder, - layoutArchitecture: layoutArchitecture, - minCharsForSuggestions: minCharsForSuggestions, - onSuggestionsBoxToggle: onSuggestionsBoxToggle, - // TODO HACK to satisfy strictness + listBuilder: listBuilder, suggestionsCallback: suggestionsCallback, itemBuilder: itemBuilder, - transitionBuilder: (context, suggestionsBox, controller) => - suggestionsBox, - onSuggestionSelected: (T suggestion) { + transitionBuilder: (context, animation, child) => child, + onSelected: (T suggestion) { state.didChange(suggestion); - onSuggestionSelected?.call(suggestion); + onSelected?.call(suggestion); }, - getImmediateSuggestions: getImmediateSuggestions, errorBuilder: errorBuilder, - noItemsFoundBuilder: noItemsFoundBuilder, + emptyBuilder: emptyBuilder, loadingBuilder: loadingBuilder, debounceDuration: debounceDuration, - suggestionsBoxDecoration: suggestionsBoxDecoration, - suggestionsBoxVerticalOffset: suggestionsBoxVerticalOffset, + decorationBuilder: decorationBuilder, + offset: offset, animationDuration: animationDuration, - animationStart: animationStart, direction: direction, hideOnLoading: hideOnLoading, hideOnEmpty: hideOnEmpty, hideOnError: hideOnError, - hideSuggestionsOnKeyboardHide: hideSuggestionsOnKeyboardHide, - keepSuggestionsOnLoading: keepSuggestionsOnLoading, + hideWithKeyboard: hideWithKeyboard, + retainOnLoading: retainOnLoading, autoFlipDirection: autoFlipDirection, - suggestionsBoxController: suggestionsBoxController, - keepSuggestionsOnSuggestionSelected: - keepSuggestionsOnSuggestionSelected, - hideKeyboard: hideKeyboard, + suggestionsController: suggestionsController, + hideOnSelect: hideOnSelect, + hideOnUnfocus: hideOnUnfocus, scrollController: scrollController, ); }, @@ -465,3 +216,82 @@ class FormBuilderTypeAheadState return text; } } + +extension TextFiledCopy on TextField { + TextField copyWith({ + TextEditingController? controller, + TextStyle? style, + InputDecoration? decoration, + FocusNode? focusNode, + bool? enabled, + }) { + return TextField( + controller: controller ?? this.controller, + style: style ?? this.style, + decoration: decoration ?? this.decoration, + focusNode: focusNode ?? this.focusNode, + keyboardType: keyboardType, + textInputAction: textInputAction, + textCapitalization: textCapitalization, + textAlign: textAlign, + textAlignVertical: textAlignVertical, + textDirection: textDirection, + readOnly: readOnly, + showCursor: showCursor, + autofocus: autofocus, + obscureText: obscureText, + autocorrect: autocorrect, + smartDashesType: smartDashesType, + smartQuotesType: smartQuotesType, + enableSuggestions: enableSuggestions, + maxLines: maxLines, + minLines: minLines, + expands: expands, + maxLength: maxLength, + maxLengthEnforcement: maxLengthEnforcement, + onChanged: onChanged, + onEditingComplete: onEditingComplete, + onSubmitted: onSubmitted, + inputFormatters: inputFormatters, + enabled: enabled ?? this.enabled, + cursorWidth: cursorWidth, + cursorHeight: cursorHeight, + cursorRadius: cursorRadius, + cursorColor: cursorColor, + selectionHeightStyle: selectionHeightStyle, + selectionWidthStyle: selectionWidthStyle, + keyboardAppearance: keyboardAppearance, + scrollPadding: scrollPadding, + dragStartBehavior: dragStartBehavior, + enableInteractiveSelection: enableInteractiveSelection, + onTap: onTap, + buildCounter: buildCounter, + scrollController: scrollController, + scrollPhysics: scrollPhysics, + autofillHints: autofillHints, + restorationId: restorationId, + canRequestFocus: canRequestFocus, + clipBehavior: clipBehavior, + contentInsertionConfiguration: contentInsertionConfiguration, + contextMenuBuilder: contextMenuBuilder, + cursorErrorColor: cursorErrorColor, + cursorOpacityAnimates: cursorOpacityAnimates, + enableIMEPersonalizedLearning: enableIMEPersonalizedLearning, + groupId: groupId, + ignorePointers: ignorePointers, + mouseCursor: mouseCursor, + obscuringCharacter: obscuringCharacter, + key: key, + magnifierConfiguration: magnifierConfiguration, + selectionControls: selectionControls, + onAppPrivateCommand: onAppPrivateCommand, + onTapAlwaysCalled: onTapAlwaysCalled, + onTapOutside: onTapOutside, + scribbleEnabled: scribbleEnabled, + spellCheckConfiguration: spellCheckConfiguration, + statesController: statesController, + strutStyle: strutStyle, + undoController: undoController, + ); + } +} diff --git a/pubspec.lock b/pubspec.lock index f9fffb5..6a99dc1 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: archive - sha256: "6bd38d335f0954f5fad9c79e614604fbf03a0e5b975923dd001b6ea965ef5b4b" + sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d url: "https://pub.dev" source: hosted - version: "3.6.0" + version: "3.6.1" args: dependency: transitive description: @@ -98,18 +98,18 @@ packages: dependency: "direct main" description: name: flutter_form_builder - sha256: "447f8808f68070f7df968e8063aada3c9d2e90e789b5b70f3b44e4b315212656" + sha256: ba557c8933bef822fe5469f9267579379f362faf60c7a776c93bfa79cdda0446 url: "https://pub.dev" source: hosted - version: "9.3.0" + version: "9.4.0" flutter_keyboard_visibility: dependency: transitive description: name: flutter_keyboard_visibility - sha256: "4983655c26ab5b959252ee204c2fffa4afeb4413cd030455194ec0caa3b8e7cb" + sha256: "98664be7be0e3ffca00de50f7f6a287ab62c763fc8c762e0a21584584a3ff4f8" url: "https://pub.dev" source: hosted - version: "5.4.1" + version: "6.0.0" flutter_keyboard_visibility_linux: dependency: transitive description: @@ -183,10 +183,10 @@ packages: dependency: "direct main" description: name: flutter_typeahead - sha256: b9942bd5b7611a6ec3f0730c477146cffa4cd4b051077983ba67ddfc9e7ee818 + sha256: d64712c65db240b1057559b952398ebb6e498077baeebf9b0731dade62438a6d url: "https://pub.dev" source: hosted - version: "4.8.0" + version: "5.2.0" flutter_web_plugins: dependency: transitive description: flutter @@ -228,18 +228,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" url: "https://pub.dev" source: hosted - version: "10.0.4" + version: "10.0.5" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.5" leak_tracker_testing: dependency: transitive description: @@ -268,18 +268,18 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.15.0" path: dependency: transitive description: @@ -316,10 +316,34 @@ packages: dependency: transitive description: name: pointer_interceptor - sha256: adf7a637f97c077041d36801b43be08559fd4322d2127b3f20bb7be1b9eebc22 + sha256: "57210410680379aea8b1b7ed6ae0c3ad349bfd56fe845b8ea934a53344b9d523" + url: "https://pub.dev" + source: hosted + version: "0.10.1+2" + pointer_interceptor_ios: + dependency: transitive + description: + name: pointer_interceptor_ios + sha256: a6906772b3205b42c44614fcea28f818b1e5fdad73a4ca742a7bd49818d9c917 + url: "https://pub.dev" + source: hosted + version: "0.10.1" + pointer_interceptor_platform_interface: + dependency: transitive + description: + name: pointer_interceptor_platform_interface + sha256: "0597b0560e14354baeb23f8375cd612e8bd4841bf8306ecb71fcd0bb78552506" + url: "https://pub.dev" + source: hosted + version: "0.10.0+1" + pointer_interceptor_web: + dependency: transitive + description: + name: pointer_interceptor_web + sha256: "7a7087782110f8c1827170660b09f8aa893e0e9a61431dbbe2ac3fc482e8c044" url: "https://pub.dev" source: hosted - version: "0.9.3+7" + version: "0.10.2+1" signature: dependency: "direct main" description: @@ -377,10 +401,10 @@ packages: dependency: transitive description: name: test_api - sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.7.0" + version: "0.7.2" typed_data: dependency: transitive description: @@ -425,10 +449,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc url: "https://pub.dev" source: hosted - version: "14.2.1" + version: "14.2.4" web: dependency: transitive description: @@ -446,5 +470,5 @@ packages: source: hosted version: "6.5.0" sdks: - dart: ">=3.4.0 <4.0.0" - flutter: ">=3.22.0" + dart: ">=3.5.0 <4.0.0" + flutter: ">=3.24.0" diff --git a/pubspec.yaml b/pubspec.yaml index 4bb2ffe..fa0b160 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,22 +4,25 @@ version: 10.2.0 issue_tracker: https://github.com/flutter-form-builder-ecosystem/form_builder_extra_fields/issues homepage: https://github.com/flutter-form-builder-ecosystem repository: https://github.com/flutter-form-builder-ecosystem/form_builder_extra_fields +topics: + - form + - forms funding: - https://opencollective.com/flutter-form-builder-ecosystem environment: - sdk: ">=3.4.0 <4.0.0" - flutter: ">=3.22.0" + sdk: ">=3.5.0 <4.0.0" + flutter: ">=3.24.0" dependencies: flutter: sdk: flutter - flutter_form_builder: ^9.3.0 - flutter_colorpicker: ^1.0.3 + flutter_form_builder: ^9.4.0 + flutter_colorpicker: ^1.1.0 dropdown_search: ^5.0.6 - signature: ^5.4.0 + signature: ^5.5.0 intl: ^0.19.0 - flutter_typeahead: ^4.7.0 + flutter_typeahead: ^5.2.0 flutter_rating_bar: ^4.0.1 dev_dependencies: From b45d1e9814fc346c86a6cc1bc75fd63437e6e82d Mon Sep 17 00:00:00 2001 From: Matias de Andrea Date: Sun, 11 Aug 2024 11:12:53 +0200 Subject: [PATCH 2/2] chore(release): 11.0.0 --- CHANGELOG.md | 58 +++++++++++++++++++++++++++++++--------------------- pubspec.yaml | 2 +- 2 files changed, 36 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 092972e..dcd1b77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,16 @@ -## [10.2.0] +## 11.0.0 + +### BREAKING CHANGE + +* `FormBuilderTypeAhead`: Update to use `flutter_typeahead` 5.x.x. Take a look how migrate on their [readme](https://pub.dev/packages/flutter_typeahead#from-4x-to-5x) + +### Features + +* Update android settings on example +* Set minimal Flutter version to 3.24.0 +* Set minimal Dart version to 3.5.0 + +## 10.2.0 * Update dependencies: * `intl` from ^0.18.1 to ^0.19.0 @@ -10,53 +22,53 @@ * Resolved deprecation warning. using super.key instead of super(key: key) https://dart.dev/tools/linter-rules/use_super_parameters * Migrate to applying Gradle Plugins with the declarative plugins block: https://docs.flutter.dev/release/breaking-changes/flutter-gradle-plugin-apply -## [10.1.0] +## 10.1.0 * `FormBuilderTypeAhead`: Add new properties * Update dependencies * Built with Flutter 3.13 -## [10.0.0] +## 10.0.0 ### BREAKING CHANGE * Update constraints to Dart 3 * Update constraints to Flutter 3.10 -* Update `flutter_form_builder` to 9.x.x. Take a look breaking changes on [there changelog](https://pub.dev/packages/flutter_form_builder/changelog#900) +* Update `flutter_form_builder` to 9.x.x. Take a look breaking changes on there changelog -## [10.0.0-dev.2] +## 10.0.0-dev.2 ### BREAKING CHANGE * Update constraints to Dart 3 -## [10.0.0-dev.1] +## 10.0.0-dev.1 ### BREAKING CHANGE * Update constraints to Flutter 3.10 * Update intl to 0.18 -## [9.0.0] +## 9.0.0 ### BREAKING CHANGE * Remove `FormBuilderChipsInput` field * Remove `FormBuilderCupertinoDateTimePicker` field -* Update `flutter_form_builder` to 8.x.x. Take a look breaking changes on [there changelog](https://pub.dev/packages/flutter_form_builder/changelog#800) +* Update `flutter_form_builder` to 8.x.x. Take a look breaking changes on there changelog ### Features * `FormBuilderColorPickerField`: Add `availableColors` property -## [8.5.0] +## 8.5.0 * Remove flutter_chips_input dependency * Remove touch_input dependency * Update dependencies * Built with Flutter 3.7 -## [8.4.0] - 28-Oct-2022 +## 8.4.0 * Set by default flex loose to `FormBuilderSearchableDropdown` * Set show search field by default @@ -66,63 +78,63 @@ * `dropdown_search` from 5.0.2 to 5.0.3 * Performance improvement on FormBuilderSignaturePad on Web -## [8.3.0] - 27-Jul-2022 +## 8.3.0 * Apply license BSD-3-clause * Update dependency dropdown_search from 4.0.1 to 5.0.2 * Refactor readme -## [8.2.0] - 12-Jul-2022 +## 8.2.0 * Moved repository -## [8.1.0] - 18-May-2022 +## 8.1.0 * Bump up `dropdown_search` package version * Export the whole `dropdown_search` package -## [8.0.1] - 17-May-2022 +## 8.0.1 * Add missing attributes for `FormBuilderSearchableDropdown` -## [8.0.0] - 16-May-2022 +## 8.0.0 * Flutter 3 compatibility -## [7.1.0] - 31-Jan-2022 +## 7.1.0 * Use `flutter_datetime_picker_bdaya` instead of the unmaintained `flutter_datetime_picker` * TypeAhead onReset uses `valueTransformer` * Export the class `TextFieldProps` - prevents importing from transitive dependency `dropdown_search` -## [7.0.0] - 27-Oct-2021 +## 7.0.0 * `flutter_form_builder` ^7.0.0 compatibility * Upgraded packages -## [7.0.0-alpha.6] - 10-Sep-2021 +## 7.0.0-alpha.6 * Upgraded `flutter_colorpicker` dependency - comes with improvements to `FormBuilderColorPicker` field * Upgraded `dropdown_search` dependency - comes with improvements to `FormBuilderDropdownSearch` field * **Breaking Changes**: comes with breaking changes in `FormBuilderColorPicker` modes -## [7.0.0-alpha.5] - 02-Sep-2021 +## 7.0.0-alpha.5 * Upgrade form_builder to v7.0.0-alpha.3 -## [7.0.0-alpha.4] - 25-May-2021 +## 7.0.0-alpha.4 * Use null-safe version of `flutter_chips_input` * Rename `InputType` to `CupertinoDateTimePickerInputType` - avoids name clash with `form_builder_fields` -## [7.0.0-alpha.3] - 17-May-2021 +## 7.0.0-alpha.3 * Replaced `rating_bar` packge with a popular, better maintained and null-safe `flutter_rating_bar` -## [7.0.0-alpha.2] - 17-May-2021 +## 7.0.0-alpha.2 * Improvements to package documentation and example -## [7.0.0-alpha.1] - 16-May-2021 +## 7.0.0-alpha.1 * Split into own package from `flutter_form_builder` diff --git a/pubspec.yaml b/pubspec.yaml index fa0b160..821ecbb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: form_builder_extra_fields description: Additional ready-made form input fields for flutter_form_builder package -version: 10.2.0 +version: 11.0.0 issue_tracker: https://github.com/flutter-form-builder-ecosystem/form_builder_extra_fields/issues homepage: https://github.com/flutter-form-builder-ecosystem repository: https://github.com/flutter-form-builder-ecosystem/form_builder_extra_fields