Skip to content

Commit 5a4ee48

Browse files
Merge pull request #1417 from RepliedSage11/main
feat: #1416 Added missing TextField properties to FormBuilderTextField
2 parents 6a92730 + 94a69cb commit 5a4ee48

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed

lib/src/fields/form_builder_text_field.dart

+91
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,73 @@ class FormBuilderTextField extends FormBuilderFieldDecoration<String> {
294294
/// configuration, then [materialMisspelledTextStyle] is used by default.
295295
final SpellCheckConfiguration? spellCheckConfiguration;
296296

297+
/// {@macro flutter.material.Material.clipBehavior}
298+
///
299+
/// Defaults to [Clip.hardEdge].
300+
final Clip clipBehavior;
301+
302+
/// Determine whether this text field can request the primary focus.
303+
///
304+
/// Defaults to true. If false, the text field will not request focus
305+
/// when tapped, or when its context menu is displayed. If false it will not
306+
/// be possible to move the focus to the text field with tab key.
307+
final bool canRequestFocus;
308+
309+
/// The color of the cursor when the [InputDecorator] is showing an error.
310+
///
311+
/// If this is null it will default to [TextStyle.color] of
312+
/// [InputDecoration.errorStyle]. If that is null, it will use
313+
/// [ColorScheme.error] of [ThemeData.colorScheme].
314+
final Color? cursorErrorColor;
315+
316+
/// {@macro flutter.widgets.editableText.cursorOpacityAnimates}
317+
final bool? cursorOpacityAnimates;
318+
319+
/// {@macro flutter.services.TextInputConfiguration.enableIMEPersonalizedLearning}
320+
final bool enableIMEPersonalizedLearning;
321+
322+
/// {@macro flutter.widgets.editableText.groupId}
323+
final Object groupId;
324+
325+
/// {@macro flutter.widgets.editableText.onAppPrivateCommand}
326+
final AppPrivateCommandCallback? onAppPrivateCommand;
327+
328+
/// Whether [onTap] should be called for every tap.
329+
///
330+
/// Defaults to false, so [onTap] is only called for each distinct tap. When
331+
/// enabled, [onTap] is called for every tap including consecutive taps.
332+
final bool onTapAlwaysCalled;
333+
334+
/// {@macro flutter.widgets.editableText.scribbleEnabled}
335+
final bool scribbleEnabled;
336+
337+
/// {@macro flutter.widgets.editableText.selectionControls}
338+
final TextSelectionControls? selectionControls;
339+
340+
/// Represents the interactive "state" of this widget in terms of a set of
341+
/// [WidgetState]s, including [WidgetState.disabled], [WidgetState.hovered],
342+
/// [WidgetState.error], and [WidgetState.focused].
343+
///
344+
/// Classes based on this one can provide their own
345+
/// [WidgetStatesController] to which they've added listeners.
346+
/// They can also update the controller's [WidgetStatesController.value]
347+
/// however, this may only be done when it's safe to call
348+
/// [State.setState], like in an event handler.
349+
///
350+
/// The controller's [WidgetStatesController.value] represents the set of
351+
/// states that a widget's visual properties, typically [WidgetStateProperty]
352+
/// values, are resolved against. It is _not_ the intrinsic state of the widget.
353+
/// The widget is responsible for ensuring that the controller's
354+
/// [WidgetStatesController.value] tracks its intrinsic state. For example
355+
/// one cannot request the keyboard focus for a widget by adding [WidgetState.focused]
356+
/// to its controller. When the widget gains the or loses the focus it will
357+
/// [WidgetStatesController.update] its controller's [WidgetStatesController.value]
358+
/// and notify listeners of the change.
359+
final WidgetStatesController? statesController;
360+
361+
/// {@macro flutter.widgets.undoHistory.controller}
362+
final UndoHistoryController? undoController;
363+
297364
/// Creates a Material Design text field input.
298365
FormBuilderTextField({
299366
super.key,
@@ -356,6 +423,18 @@ class FormBuilderTextField extends FormBuilderFieldDecoration<String> {
356423
this.magnifierConfiguration,
357424
this.contentInsertionConfiguration,
358425
this.spellCheckConfiguration,
426+
this.clipBehavior = Clip.hardEdge,
427+
this.canRequestFocus = true,
428+
this.cursorErrorColor,
429+
this.cursorOpacityAnimates,
430+
this.enableIMEPersonalizedLearning = true,
431+
this.groupId = EditableText,
432+
this.onAppPrivateCommand,
433+
this.onTapAlwaysCalled = false,
434+
this.scribbleEnabled = true,
435+
this.selectionControls,
436+
this.statesController,
437+
this.undoController,
359438
}) : assert(initialValue == null || controller == null),
360439
assert(minLines == null || minLines > 0),
361440
assert(maxLines == null || maxLines > 0),
@@ -427,6 +506,18 @@ class FormBuilderTextField extends FormBuilderFieldDecoration<String> {
427506
magnifierConfiguration: magnifierConfiguration,
428507
contentInsertionConfiguration: contentInsertionConfiguration,
429508
spellCheckConfiguration: spellCheckConfiguration,
509+
clipBehavior: clipBehavior,
510+
canRequestFocus: canRequestFocus,
511+
cursorErrorColor: cursorErrorColor,
512+
cursorOpacityAnimates: cursorOpacityAnimates,
513+
enableIMEPersonalizedLearning: enableIMEPersonalizedLearning,
514+
groupId: groupId,
515+
onAppPrivateCommand: onAppPrivateCommand,
516+
onTapAlwaysCalled: onTapAlwaysCalled,
517+
scribbleEnabled: scribbleEnabled,
518+
selectionControls: selectionControls,
519+
statesController: statesController,
520+
undoController: undoController,
430521
);
431522
},
432523
);

0 commit comments

Comments
 (0)