@@ -259,6 +259,52 @@ class FormBuilderTypeAhead<T> extends FormBuilderFieldDecoration<T> {
259
259
260
260
final ScrollController ? scrollController;
261
261
262
+ final IndexedWidgetBuilder ? itemSeparatorBuilder;
263
+
264
+ /// By default, we render the suggestions in a ListView, using
265
+ /// the `itemBuilder` to construct each element of the list. Specify
266
+ /// your own `layoutArchitecture` if you want to be responsible
267
+ /// for layinng out the widgets using some other system (like a grid).
268
+ final LayoutArchitecture ? layoutArchitecture;
269
+
270
+ /// Used to overcome [Flutter issue 98507] (https://github.com/flutter/flutter/issues/98507)
271
+ /// Most commonly experienced when placing the [TypeAheadFormField] on a google map in Flutter Web.
272
+ final bool intercepting;
273
+
274
+ /// If set to false, suggestion list will not be reversed according to the
275
+ /// [autoFlipDirection] property.
276
+ ///
277
+ /// Defaults to true.
278
+ final bool autoFlipListDirection;
279
+
280
+ /// Minimum height below [autoFlipDirection] is triggered
281
+ ///
282
+ /// Defaults to 64.0.
283
+ final double autoFlipMinHeight;
284
+
285
+ /// The minimum number of characters which must be entered before
286
+ /// [suggestionsCallback] is triggered.
287
+ ///
288
+ /// Defaults to 0.
289
+ final int minCharsForSuggestions;
290
+
291
+ /// If set to true and if the user scrolls through the suggestion list, hide the keyboard automatically.
292
+ /// If set to false, the keyboard remains visible.
293
+ /// Throws an exception, if hideKeyboardOnDrag and hideSuggestionsOnKeyboardHide are both set to true as
294
+ /// they are mutual exclusive.
295
+ ///
296
+ /// Defaults to false
297
+ final bool hideKeyboardOnDrag;
298
+
299
+ /// Allows a bypass of a problem on Flutter 3.7+ with the accessibility through Overlay
300
+ /// that prevents flutter_typeahead to register a click on the list of suggestions properly.
301
+ ///
302
+ /// Defaults to false
303
+ final bool ignoreAccessibleNavigation;
304
+
305
+ // Adds a callback for the suggestion box opening or closing
306
+ final void Function (bool )? onSuggestionsBoxToggle;
307
+
262
308
/// Creates text field that auto-completes user input from a list of items
263
309
FormBuilderTypeAhead ({
264
310
super .key,
@@ -300,6 +346,15 @@ class FormBuilderTypeAhead<T> extends FormBuilderFieldDecoration<T> {
300
346
this .suggestionsBoxVerticalOffset = 5.0 ,
301
347
this .textFieldConfiguration = const TextFieldConfiguration (),
302
348
this .transitionBuilder,
349
+ this .autoFlipListDirection = true ,
350
+ this .autoFlipMinHeight = 64.0 ,
351
+ this .hideKeyboardOnDrag = false ,
352
+ this .ignoreAccessibleNavigation = false ,
353
+ this .intercepting = false ,
354
+ this .itemSeparatorBuilder,
355
+ this .layoutArchitecture,
356
+ this .minCharsForSuggestions = 0 ,
357
+ this .onSuggestionsBoxToggle,
303
358
}) : assert (T == String || selectionToTextTransformer != null ),
304
359
super (
305
360
builder: (FormFieldState <T ?> field) {
@@ -318,6 +373,15 @@ class FormBuilderTypeAhead<T> extends FormBuilderFieldDecoration<T> {
318
373
focusNode: state.effectiveFocusNode,
319
374
decoration: state.decoration,
320
375
),
376
+ autoFlipListDirection: autoFlipListDirection,
377
+ autoFlipMinHeight: autoFlipMinHeight,
378
+ hideKeyboardOnDrag: hideKeyboardOnDrag,
379
+ ignoreAccessibleNavigation: ignoreAccessibleNavigation,
380
+ intercepting: intercepting,
381
+ itemSeparatorBuilder: itemSeparatorBuilder,
382
+ layoutArchitecture: layoutArchitecture,
383
+ minCharsForSuggestions: minCharsForSuggestions,
384
+ onSuggestionsBoxToggle: onSuggestionsBoxToggle,
321
385
// TODO HACK to satisfy strictness
322
386
suggestionsCallback: suggestionsCallback,
323
387
itemBuilder: itemBuilder,
0 commit comments