password_textfield.dart 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599
  1. import 'dart:ui' as ui show BoxHeightStyle, BoxWidthStyle;
  2. import 'package:flutter/gestures.dart';
  3. import 'package:flutter/material.dart';
  4. import 'package:flutter/services.dart';
  5. class PasswordTextField extends StatefulWidget {
  6. const PasswordTextField({
  7. super.key,
  8. this.visibleIcon = Icons.remove_red_eye_outlined,
  9. this.inVisibleIcon = Icons.remove_red_eye_outlined,
  10. this.initialObscurity = false,
  11. this.controller,
  12. this.focusNode,
  13. this.undoController,
  14. this.decoration = const InputDecoration(),
  15. this.keyboardType,
  16. this.textInputAction,
  17. this.textCapitalization = TextCapitalization.none,
  18. this.style,
  19. this.strutStyle,
  20. this.textAlign = TextAlign.start,
  21. this.textAlignVertical,
  22. this.textDirection,
  23. this.readOnly = false,
  24. this.showCursor,
  25. this.autofocus = false,
  26. this.obscuringCharacter = '•',
  27. this.autocorrect = true,
  28. this.enableSuggestions = true,
  29. this.maxLines = 1,
  30. this.minLines,
  31. this.expands = false,
  32. this.maxLength,
  33. this.maxLengthEnforcement,
  34. this.onChanged,
  35. this.onEditingComplete,
  36. this.onSubmitted,
  37. this.onAppPrivateCommand,
  38. this.inputFormatters,
  39. this.enabled,
  40. this.cursorWidth = 2.0,
  41. this.cursorHeight,
  42. this.cursorRadius,
  43. this.cursorOpacityAnimates,
  44. this.cursorColor,
  45. this.selectionHeightStyle = ui.BoxHeightStyle.tight,
  46. this.selectionWidthStyle = ui.BoxWidthStyle.tight,
  47. this.keyboardAppearance,
  48. this.scrollPadding = const EdgeInsets.all(20.0),
  49. this.dragStartBehavior = DragStartBehavior.start,
  50. this.enableInteractiveSelection = true,
  51. this.selectionControls,
  52. this.onTap,
  53. this.onTapOutside,
  54. this.mouseCursor,
  55. this.buildCounter,
  56. this.scrollController,
  57. this.scrollPhysics,
  58. this.autofillHints = const <String>[],
  59. this.contentInsertionConfiguration,
  60. this.clipBehavior = Clip.hardEdge,
  61. this.restorationId,
  62. this.scribbleEnabled = true,
  63. this.enableIMEPersonalizedLearning = true,
  64. this.contextMenuBuilder,
  65. this.canRequestFocus = true,
  66. this.spellCheckConfiguration,
  67. this.magnifierConfiguration,
  68. });
  69. /// Displaying toggle icon(show).
  70. ///
  71. /// Defaults is [Icons.visibility].
  72. final IconData visibleIcon;
  73. /// Displaying toggle icon(hide).
  74. ///
  75. /// Defaults is [Icons.visibility_off].
  76. final IconData inVisibleIcon;
  77. /// The obscure feature is enabled by default.
  78. ///
  79. /// Default is [false].
  80. final bool initialObscurity;
  81. /// {@macro flutter.widgets.magnifier.TextMagnifierConfiguration.intro}
  82. ///
  83. /// {@macro flutter.widgets.magnifier.intro}
  84. ///
  85. /// {@macro flutter.widgets.magnifier.TextMagnifierConfiguration.details}
  86. ///
  87. /// By default, builds a [CupertinoTextMagnifier] on iOS and [TextMagnifier]
  88. /// on Android, and builds nothing on all other platforms. If it is desired to
  89. /// suppress the magnifier, consider passing [TextMagnifierConfiguration.disabled].
  90. ///
  91. /// {@tool dartpad}
  92. /// This sample demonstrates how to customize the magnifier that this text field uses.
  93. ///
  94. /// ** See code in examples/api/lib/widgets/text_magnifier/text_magnifier.0.dart **
  95. /// {@end-tool}
  96. final TextMagnifierConfiguration? magnifierConfiguration;
  97. /// Controls the text being edited.
  98. ///
  99. /// If null, this widget will create its own [TextEditingController].
  100. final TextEditingController? controller;
  101. /// Defines the keyboard focus for this widget.
  102. ///
  103. /// The [focusNode] is a long-lived object that's typically managed by a
  104. /// [StatefulWidget] parent. See [FocusNode] for more information.
  105. ///
  106. /// To give the keyboard focus to this widget, provide a [focusNode] and then
  107. /// use the current [FocusScope] to request the focus:
  108. ///
  109. /// ```dart
  110. /// FocusScope.of(context).requestFocus(myFocusNode);
  111. /// ```
  112. ///
  113. /// This happens automatically when the widget is tapped.
  114. ///
  115. /// To be notified when the widget gains or loses the focus, add a listener
  116. /// to the [focusNode]:
  117. ///
  118. /// ```dart
  119. /// myFocusNode.addListener(() { print(myFocusNode.hasFocus); });
  120. /// ```
  121. ///
  122. /// If null, this widget will create its own [FocusNode].
  123. ///
  124. /// ## Keyboard
  125. ///
  126. /// Requesting the focus will typically cause the keyboard to be shown
  127. /// if it's not showing already.
  128. ///
  129. /// On Android, the user can hide the keyboard - without changing the focus -
  130. /// with the system back button. They can restore the keyboard's visibility
  131. /// by tapping on a text field. The user might hide the keyboard and
  132. /// switch to a physical keyboard, or they might just need to get it
  133. /// out of the way for a moment, to expose something it's
  134. /// obscuring. In this case requesting the focus again will not
  135. /// cause the focus to change, and will not make the keyboard visible.
  136. ///
  137. /// This widget builds an [EditableText] and will ensure that the keyboard is
  138. /// showing when it is tapped by calling [EditableTextState.requestKeyboard()].
  139. final FocusNode? focusNode;
  140. /// The decoration to show around the text field.
  141. ///
  142. /// By default, draws a horizontal line under the text field but can be
  143. /// configured to show an icon, label, hint text, and error text.
  144. ///
  145. /// Specify null to remove the decoration entirely (including the
  146. /// extra padding introduced by the decoration to save space for the labels).
  147. final InputDecoration decoration;
  148. /// {@macro flutter.widgets.editableText.keyboardType}
  149. final TextInputType? keyboardType;
  150. /// The type of action button to use for the keyboard.
  151. ///
  152. /// Defaults to [TextInputAction.newline] if [keyboardType] is
  153. /// [TextInputType.multiline] and [TextInputAction.done] otherwise.
  154. final TextInputAction? textInputAction;
  155. /// {@macro flutter.widgets.editableText.textCapitalization}
  156. final TextCapitalization textCapitalization;
  157. /// The style to use for the text being edited.
  158. ///
  159. /// This text style is also used as the base style for the [decoration].
  160. ///
  161. /// If null, defaults to the `titleMedium` text style from the current [Theme].
  162. final TextStyle? style;
  163. /// {@macro flutter.widgets.editableText.strutStyle}
  164. final StrutStyle? strutStyle;
  165. /// {@macro flutter.widgets.editableText.textAlign}
  166. final TextAlign textAlign;
  167. /// {@macro flutter.material.InputDecorator.textAlignVertical}
  168. final TextAlignVertical? textAlignVertical;
  169. /// {@macro flutter.widgets.editableText.textDirection}
  170. final TextDirection? textDirection;
  171. /// {@macro flutter.widgets.editableText.autofocus}
  172. final bool autofocus;
  173. /// {@macro flutter.widgets.editableText.obscuringCharacter}
  174. final String obscuringCharacter;
  175. /// {@macro flutter.widgets.editableText.autocorrect}
  176. final bool autocorrect;
  177. /// {@macro flutter.services.TextInputConfiguration.enableSuggestions}
  178. final bool enableSuggestions;
  179. /// {@macro flutter.widgets.editableText.maxLines}
  180. /// * [expands], which determines whether the field should fill the height of
  181. /// its parent.
  182. final int? maxLines;
  183. /// {@macro flutter.widgets.editableText.minLines}
  184. /// * [expands], which determines whether the field should fill the height of
  185. /// its parent.
  186. final int? minLines;
  187. /// {@macro flutter.widgets.editableText.expands}
  188. final bool expands;
  189. /// {@macro flutter.widgets.editableText.readOnly}
  190. final bool readOnly;
  191. /// {@macro flutter.widgets.editableText.showCursor}
  192. final bool? showCursor;
  193. /// The maximum number of characters (Unicode grapheme clusters) to allow in
  194. /// the text field.
  195. ///
  196. /// If set, a character counter will be displayed below the
  197. /// field showing how many characters have been entered. If set to a number
  198. /// greater than 0, it will also display the maximum number allowed. If set
  199. /// to [TextField.noMaxLength] then only the current character count is displayed.
  200. ///
  201. /// After [maxLength] characters have been input, additional input
  202. /// is ignored, unless [maxLengthEnforcement] is set to
  203. /// [MaxLengthEnforcement.none].
  204. ///
  205. /// The text field enforces the length with a [LengthLimitingTextInputFormatter],
  206. /// which is evaluated after the supplied [inputFormatters], if any.
  207. ///
  208. /// This value must be either null, [TextField.noMaxLength], or greater than 0.
  209. /// If null (the default) then there is no limit to the number of characters
  210. /// that can be entered. If set to [TextField.noMaxLength], then no limit will
  211. /// be enforced, but the number of characters entered will still be displayed.
  212. ///
  213. /// Whitespace characters (e.g. newline, space, tab) are included in the
  214. /// character count.
  215. ///
  216. /// If [maxLengthEnforcement] is [MaxLengthEnforcement.none], then more than
  217. /// [maxLength] characters may be entered, but the error counter and divider
  218. /// will switch to the [decoration]'s [InputDecoration.errorStyle] when the
  219. /// limit is exceeded.
  220. ///
  221. /// {@macro flutter.services.lengthLimitingTextInputFormatter.maxLength}
  222. final int? maxLength;
  223. /// Determines how the [maxLength] limit should be enforced.
  224. ///
  225. /// {@macro flutter.services.textFormatter.effectiveMaxLengthEnforcement}
  226. ///
  227. /// {@macro flutter.services.textFormatter.maxLengthEnforcement}
  228. final MaxLengthEnforcement? maxLengthEnforcement;
  229. /// {@macro flutter.widgets.editableText.onChanged}
  230. ///
  231. /// See also:
  232. ///
  233. /// * [inputFormatters], which are called before [onChanged]
  234. /// runs and can validate and change ("format") the input value.
  235. /// * [onEditingComplete], [onSubmitted]:
  236. /// which are more specialized input change notifications.
  237. final ValueChanged<String>? onChanged;
  238. /// {@macro flutter.widgets.editableText.onEditingComplete}
  239. final VoidCallback? onEditingComplete;
  240. /// {@macro flutter.widgets.editableText.onSubmitted}
  241. ///
  242. /// See also:
  243. ///
  244. /// * [TextInputAction.next] and [TextInputAction.previous], which
  245. /// automatically shift the focus to the next/previous focusable item when
  246. /// the user is done editing.
  247. final ValueChanged<String>? onSubmitted;
  248. /// {@macro flutter.widgets.editableText.onAppPrivateCommand}
  249. final AppPrivateCommandCallback? onAppPrivateCommand;
  250. /// {@macro flutter.widgets.editableText.inputFormatters}
  251. final List<TextInputFormatter>? inputFormatters;
  252. /// If false the text field is "disabled": it ignores taps and its
  253. /// [decoration] is rendered in grey.
  254. ///
  255. /// If non-null this property overrides the [decoration]'s
  256. /// [InputDecoration.enabled] property.
  257. final bool? enabled;
  258. /// {@macro flutter.widgets.editableText.cursorWidth}
  259. final double cursorWidth;
  260. /// {@macro flutter.widgets.editableText.cursorHeight}
  261. final double? cursorHeight;
  262. /// {@macro flutter.widgets.editableText.cursorRadius}
  263. final Radius? cursorRadius;
  264. /// {@macro flutter.widgets.editableText.cursorOpacityAnimates}
  265. final bool? cursorOpacityAnimates;
  266. /// The color of the cursor.
  267. ///
  268. /// The cursor indicates the current location of text insertion point in
  269. /// the field.
  270. ///
  271. /// If this is null it will default to the ambient
  272. /// [DefaultSelectionStyle.cursorColor]. If that is null, and the
  273. /// [ThemeData.platform] is [TargetPlatform.iOS] or [TargetPlatform.macOS]
  274. /// it will use [CupertinoThemeData.primaryColor]. Otherwise it will use
  275. /// the value of [ColorScheme.primary] of [ThemeData.colorScheme].
  276. final Color? cursorColor;
  277. /// Controls how tall the selection highlight boxes are computed to be.
  278. ///
  279. /// See [ui.BoxHeightStyle] for details on available styles.
  280. final ui.BoxHeightStyle selectionHeightStyle;
  281. /// Controls how wide the selection highlight boxes are computed to be.
  282. ///
  283. /// See [ui.BoxWidthStyle] for details on available styles.
  284. final ui.BoxWidthStyle selectionWidthStyle;
  285. /// The appearance of the keyboard.
  286. ///
  287. /// This setting is only honored on iOS devices.
  288. ///
  289. /// If unset, defaults to [ThemeData.brightness].
  290. final Brightness? keyboardAppearance;
  291. /// {@macro flutter.widgets.editableText.scrollPadding}
  292. final EdgeInsets scrollPadding;
  293. /// {@macro flutter.widgets.editableText.enableInteractiveSelection}
  294. final bool enableInteractiveSelection;
  295. /// {@macro flutter.widgets.editableText.selectionControls}
  296. final TextSelectionControls? selectionControls;
  297. /// {@macro flutter.widgets.scrollable.dragStartBehavior}
  298. final DragStartBehavior dragStartBehavior;
  299. /// {@macro flutter.widgets.editableText.selectionEnabled}
  300. bool get selectionEnabled => enableInteractiveSelection;
  301. /// {@template flutter.material.textfield.onTap}
  302. /// Called for each distinct tap except for every second tap of a double tap.
  303. ///
  304. /// The text field builds a [GestureDetector] to handle input events like tap,
  305. /// to trigger focus requests, to move the caret, adjust the selection, etc.
  306. /// Handling some of those events by wrapping the text field with a competing
  307. /// GestureDetector is problematic.
  308. ///
  309. /// To unconditionally handle taps, without interfering with the text field's
  310. /// internal gesture detector, provide this callback.
  311. ///
  312. /// If the text field is created with [enabled] false, taps will not be
  313. /// recognized.
  314. ///
  315. /// To be notified when the text field gains or loses the focus, provide a
  316. /// [focusNode] and add a listener to that.
  317. ///
  318. /// To listen to arbitrary pointer events without competing with the
  319. /// text field's internal gesture detector, use a [Listener].
  320. /// {@endtemplate}
  321. final GestureTapCallback? onTap;
  322. /// {@macro flutter.widgets.editableText.onTapOutside}
  323. ///
  324. /// {@tool dartpad}
  325. /// This example shows how to use a `TextFieldTapRegion` to wrap a set of
  326. /// "spinner" buttons that increment and decrement a value in the [TextField]
  327. /// without causing the text field to lose keyboard focus.
  328. ///
  329. /// This example includes a generic `SpinnerField<T>` class that you can copy
  330. /// into your own project and customize.
  331. ///
  332. /// ** See code in examples/api/lib/widgets/tap_region/text_field_tap_region.0.dart **
  333. /// {@end-tool}
  334. ///
  335. /// See also:
  336. ///
  337. /// * [TapRegion] for how the region group is determined.
  338. final TapRegionCallback? onTapOutside;
  339. /// The cursor for a mouse pointer when it enters or is hovering over the
  340. /// widget.
  341. ///
  342. /// If [mouseCursor] is a [MaterialStateProperty<MouseCursor>],
  343. /// [MaterialStateProperty.resolve] is used for the following [MaterialState]s:
  344. ///
  345. /// * [MaterialState.error].
  346. /// * [MaterialState.hovered].
  347. /// * [MaterialState.focused].
  348. /// * [MaterialState.disabled].
  349. ///
  350. /// If this property is null, [MaterialStateMouseCursor.textable] will be used.
  351. ///
  352. /// The [mouseCursor] is the only property of [TextField] that controls the
  353. /// appearance of the mouse pointer. All other properties related to "cursor"
  354. /// stand for the text cursor, which is usually a blinking vertical line at
  355. /// the editing position.
  356. final MouseCursor? mouseCursor;
  357. /// Callback that generates a custom [InputDecoration.counter] widget.
  358. ///
  359. /// See [InputCounterWidgetBuilder] for an explanation of the passed in
  360. /// arguments. The returned widget will be placed below the line in place of
  361. /// the default widget built when [InputDecoration.counterText] is specified.
  362. ///
  363. /// The returned widget will be wrapped in a [Semantics] widget for
  364. /// accessibility, but it also needs to be accessible itself. For example,
  365. /// if returning a Text widget, set the [Text.semanticsLabel] property.
  366. ///
  367. /// {@tool snippet}
  368. /// ```dart
  369. /// Widget counter(
  370. /// BuildContext context,
  371. /// {
  372. /// required int currentLength,
  373. /// required int? maxLength,
  374. /// required bool isFocused,
  375. /// }
  376. /// ) {
  377. /// return Text(
  378. /// '$currentLength of $maxLength characters',
  379. /// semanticsLabel: 'character count',
  380. /// );
  381. /// }
  382. /// ```
  383. /// {@end-tool}
  384. ///
  385. /// If buildCounter returns null, then no counter and no Semantics widget will
  386. /// be created at all.
  387. final InputCounterWidgetBuilder? buildCounter;
  388. /// {@macro flutter.widgets.editableText.scrollPhysics}
  389. final ScrollPhysics? scrollPhysics;
  390. /// {@macro flutter.widgets.editableText.scrollController}
  391. final ScrollController? scrollController;
  392. /// {@macro flutter.widgets.editableText.autofillHints}
  393. /// {@macro flutter.services.AutofillConfiguration.autofillHints}
  394. final Iterable<String>? autofillHints;
  395. /// {@macro flutter.material.Material.clipBehavior}
  396. ///
  397. /// Defaults to [Clip.hardEdge].
  398. final Clip clipBehavior;
  399. /// {@template flutter.material.textfield.restorationId}
  400. /// Restoration ID to save and restore the state of the text field.
  401. ///
  402. /// If non-null, the text field will persist and restore its current scroll
  403. /// offset and - if no [controller] has been provided - the content of the
  404. /// text field. If a [controller] has been provided, it is the responsibility
  405. /// of the owner of that controller to persist and restore it, e.g. by using
  406. /// a [RestorableTextEditingController].
  407. ///
  408. /// The state of this widget is persisted in a [RestorationBucket] claimed
  409. /// from the surrounding [RestorationScope] using the provided restoration ID.
  410. ///
  411. /// See also:
  412. ///
  413. /// * [RestorationManager], which explains how state restoration works in
  414. /// Flutter.
  415. /// {@endtemplate}
  416. final String? restorationId;
  417. /// {@macro flutter.widgets.editableText.scribbleEnabled}
  418. final bool scribbleEnabled;
  419. /// {@macro flutter.services.TextInputConfiguration.enableIMEPersonalizedLearning}
  420. final bool enableIMEPersonalizedLearning;
  421. /// {@macro flutter.widgets.editableText.contentInsertionConfiguration}
  422. final ContentInsertionConfiguration? contentInsertionConfiguration;
  423. /// {@macro flutter.widgets.EditableText.contextMenuBuilder}
  424. ///
  425. /// If not provided, will build a default menu based on the platform.
  426. ///
  427. /// See also:
  428. ///
  429. /// * [AdaptiveTextSelectionToolbar], which is built by default.
  430. final EditableTextContextMenuBuilder? contextMenuBuilder;
  431. /// Determine whether this text field can request the primary focus.
  432. ///
  433. /// Defaults to true. If false, the text field will not request focus
  434. /// when tapped, or when its context menu is displayed. If false it will not
  435. /// be possible to move the focus to the text field with tab key.
  436. final bool canRequestFocus;
  437. /// {@macro flutter.widgets.undoHistory.controller}
  438. final UndoHistoryController? undoController;
  439. /// {@macro flutter.widgets.EditableText.spellCheckConfiguration}
  440. ///
  441. /// If [SpellCheckConfiguration.misspelledTextStyle] is not specified in this
  442. /// configuration, then [materialMisspelledTextStyle] is used by default.
  443. final SpellCheckConfiguration? spellCheckConfiguration;
  444. @override
  445. State<PasswordTextField> createState() => _PasswordTextFieldState();
  446. }
  447. class _PasswordTextFieldState extends State<PasswordTextField> {
  448. late bool _obscure;
  449. @override
  450. void initState() {
  451. _obscure = widget.initialObscurity;
  452. super.initState();
  453. }
  454. @override
  455. Widget build(BuildContext context) {
  456. return TextField(
  457. obscureText: _obscure,
  458. decoration: widget.decoration.copyWith(
  459. suffixIcon: IconButton(
  460. icon: Icon(
  461. _obscure ? widget.inVisibleIcon : widget.visibleIcon,
  462. size: 18, color: const Color(0xFFBBBBBB)
  463. ),
  464. onPressed: () {
  465. setState(() {
  466. _obscure = !_obscure;
  467. });
  468. },
  469. ),
  470. ),
  471. controller: widget.controller,
  472. focusNode: widget.focusNode,
  473. undoController: widget.undoController,
  474. keyboardType: widget.keyboardType,
  475. textInputAction: widget.textInputAction,
  476. textCapitalization: widget.textCapitalization,
  477. style: widget.style,
  478. strutStyle: widget.strutStyle,
  479. textAlign: widget.textAlign,
  480. textAlignVertical: widget.textAlignVertical,
  481. textDirection: widget.textDirection,
  482. readOnly: widget.readOnly,
  483. showCursor: widget.showCursor,
  484. autofocus: widget.autofocus,
  485. obscuringCharacter: widget.obscuringCharacter,
  486. autocorrect: widget.autocorrect,
  487. enableSuggestions: widget.enableSuggestions,
  488. maxLines: widget.maxLines,
  489. minLines: widget.minLines,
  490. expands: widget.expands,
  491. maxLength: widget.maxLength,
  492. maxLengthEnforcement: widget.maxLengthEnforcement,
  493. onChanged: widget.onChanged,
  494. onEditingComplete: widget.onEditingComplete,
  495. onSubmitted: widget.onSubmitted,
  496. onAppPrivateCommand: widget.onAppPrivateCommand,
  497. inputFormatters: widget.inputFormatters,
  498. enabled: widget.enabled,
  499. cursorWidth: widget.cursorWidth,
  500. cursorHeight: widget.cursorHeight,
  501. cursorRadius: widget.cursorRadius,
  502. cursorOpacityAnimates: widget.cursorOpacityAnimates,
  503. cursorColor: widget.cursorColor,
  504. selectionHeightStyle: widget.selectionHeightStyle,
  505. selectionWidthStyle: widget.selectionWidthStyle,
  506. keyboardAppearance: widget.keyboardAppearance,
  507. scrollPadding: widget.scrollPadding,
  508. dragStartBehavior: widget.dragStartBehavior,
  509. enableInteractiveSelection: widget.enableInteractiveSelection,
  510. selectionControls: widget.selectionControls,
  511. onTap: widget.onTap,
  512. onTapOutside: widget.onTapOutside,
  513. mouseCursor: widget.mouseCursor,
  514. buildCounter: widget.buildCounter,
  515. scrollController: widget.scrollController,
  516. scrollPhysics: widget.scrollPhysics,
  517. autofillHints: widget.autofillHints,
  518. contentInsertionConfiguration: widget.contentInsertionConfiguration,
  519. clipBehavior: widget.clipBehavior,
  520. restorationId: widget.restorationId,
  521. scribbleEnabled: widget.scribbleEnabled,
  522. enableIMEPersonalizedLearning: widget.enableIMEPersonalizedLearning,
  523. contextMenuBuilder: widget.contextMenuBuilder,
  524. canRequestFocus: widget.canRequestFocus,
  525. spellCheckConfiguration: widget.spellCheckConfiguration,
  526. magnifierConfiguration: widget.magnifierConfiguration,
  527. );
  528. }
  529. }