@@ -293,6 +293,7 @@ class TextField extends StatefulWidget {
293293 this .cursorWidth = 2.0 ,
294294 this .cursorHeight,
295295 this .cursorRadius,
296+ this .cursorOpacityAnimates,
296297 this .cursorColor,
297298 this .selectionHeightStyle = ui.BoxHeightStyle .tight,
298299 this .selectionWidthStyle = ui.BoxWidthStyle .tight,
@@ -581,6 +582,9 @@ class TextField extends StatefulWidget {
581582 /// {@macro flutter.widgets.editableText.cursorRadius}
582583 final Radius ? cursorRadius;
583584
585+ /// {@macro flutter.widgets.editableText.cursorOpacityAnimates}
586+ final bool ? cursorOpacityAnimates;
587+
584588 /// The color of the cursor.
585589 ///
586590 /// The cursor indicates the current location of text insertion point in
@@ -863,6 +867,7 @@ class TextField extends StatefulWidget {
863867 properties.add (DoubleProperty ('cursorWidth' , cursorWidth, defaultValue: 2.0 ));
864868 properties.add (DoubleProperty ('cursorHeight' , cursorHeight, defaultValue: null ));
865869 properties.add (DiagnosticsProperty <Radius >('cursorRadius' , cursorRadius, defaultValue: null ));
870+ properties.add (DiagnosticsProperty <bool >('cursorOpacityAnimates' , cursorOpacityAnimates, defaultValue: null ));
866871 properties.add (ColorProperty ('cursorColor' , cursorColor, defaultValue: null ));
867872 properties.add (DiagnosticsProperty <Brightness >('keyboardAppearance' , keyboardAppearance, defaultValue: null ));
868873 properties.add (DiagnosticsProperty <EdgeInsetsGeometry >('scrollPadding' , scrollPadding, defaultValue: const EdgeInsets .all (20.0 )));
@@ -1248,7 +1253,7 @@ class _TextFieldState extends State<TextField> with RestorationMixin implements
12481253
12491254 TextSelectionControls ? textSelectionControls = widget.selectionControls;
12501255 final bool paintCursorAboveText;
1251- final bool cursorOpacityAnimates;
1256+ bool ? cursorOpacityAnimates = widget. cursorOpacityAnimates;
12521257 Offset ? cursorOffset;
12531258 final Color cursorColor;
12541259 final Color selectionColor;
@@ -1262,7 +1267,7 @@ class _TextFieldState extends State<TextField> with RestorationMixin implements
12621267 forcePressEnabled = true ;
12631268 textSelectionControls ?? = cupertinoTextSelectionHandleControls;
12641269 paintCursorAboveText = true ;
1265- cursorOpacityAnimates = true ;
1270+ cursorOpacityAnimates ?? = true ;
12661271 cursorColor = _hasError ? _errorColor : widget.cursorColor ?? selectionStyle.cursorColor ?? cupertinoTheme.primaryColor;
12671272 selectionColor = selectionStyle.selectionColor ?? cupertinoTheme.primaryColor.withOpacity (0.40 );
12681273 cursorRadius ?? = const Radius .circular (2.0 );
@@ -1274,7 +1279,7 @@ class _TextFieldState extends State<TextField> with RestorationMixin implements
12741279 forcePressEnabled = false ;
12751280 textSelectionControls ?? = cupertinoDesktopTextSelectionHandleControls;
12761281 paintCursorAboveText = true ;
1277- cursorOpacityAnimates = false ;
1282+ cursorOpacityAnimates ?? = false ;
12781283 cursorColor = _hasError ? _errorColor : widget.cursorColor ?? selectionStyle.cursorColor ?? cupertinoTheme.primaryColor;
12791284 selectionColor = selectionStyle.selectionColor ?? cupertinoTheme.primaryColor.withOpacity (0.40 );
12801285 cursorRadius ?? = const Radius .circular (2.0 );
@@ -1291,23 +1296,23 @@ class _TextFieldState extends State<TextField> with RestorationMixin implements
12911296 forcePressEnabled = false ;
12921297 textSelectionControls ?? = materialTextSelectionHandleControls;
12931298 paintCursorAboveText = false ;
1294- cursorOpacityAnimates = false ;
1299+ cursorOpacityAnimates ?? = false ;
12951300 cursorColor = _hasError ? _errorColor : widget.cursorColor ?? selectionStyle.cursorColor ?? theme.colorScheme.primary;
12961301 selectionColor = selectionStyle.selectionColor ?? theme.colorScheme.primary.withOpacity (0.40 );
12971302
12981303 case TargetPlatform .linux:
12991304 forcePressEnabled = false ;
13001305 textSelectionControls ?? = desktopTextSelectionHandleControls;
13011306 paintCursorAboveText = false ;
1302- cursorOpacityAnimates = false ;
1307+ cursorOpacityAnimates ?? = false ;
13031308 cursorColor = _hasError ? _errorColor : widget.cursorColor ?? selectionStyle.cursorColor ?? theme.colorScheme.primary;
13041309 selectionColor = selectionStyle.selectionColor ?? theme.colorScheme.primary.withOpacity (0.40 );
13051310
13061311 case TargetPlatform .windows:
13071312 forcePressEnabled = false ;
13081313 textSelectionControls ?? = desktopTextSelectionHandleControls;
13091314 paintCursorAboveText = false ;
1310- cursorOpacityAnimates = false ;
1315+ cursorOpacityAnimates ?? = false ;
13111316 cursorColor = _hasError ? _errorColor : widget.cursorColor ?? selectionStyle.cursorColor ?? theme.colorScheme.primary;
13121317 selectionColor = selectionStyle.selectionColor ?? theme.colorScheme.primary.withOpacity (0.40 );
13131318 handleDidGainAccessibilityFocus = () {
0 commit comments