@@ -199,6 +199,11 @@ class FluentThemeData with Diagnosticable {
199199 final Duration slowAnimationDuration;
200200 final Curve animationCurve;
201201
202+ /// See [EditableText.cursorOpacityAnimates] . Whether or not to have high
203+ /// fidelity animation for the opacity of the blinking text cursor, at the
204+ /// expense of higher CPU/GPU usage. Defaults to false (recommended).
205+ final bool cursorOpacityAnimates;
206+
202207 final Brightness brightness;
203208 final VisualDensity visualDensity;
204209
@@ -243,6 +248,7 @@ class FluentThemeData with Diagnosticable {
243248 Duration ? mediumAnimationDuration,
244249 Duration ? slowAnimationDuration,
245250 Curve ? animationCurve,
251+ bool ? cursorOpacityAnimates,
246252 BottomNavigationThemeData ? bottomNavigationTheme,
247253 ButtonThemeData ? buttonTheme,
248254 CheckboxThemeData ? checkboxTheme,
@@ -274,6 +280,7 @@ class FluentThemeData with Diagnosticable {
274280 ? const ResourceDictionary .light ()
275281 : const ResourceDictionary .dark ();
276282 animationCurve ?? = standardCurve;
283+ cursorOpacityAnimates ?? = false ;
277284 accentColor ?? = Colors .blue;
278285 activeColor ?? = Colors .white;
279286 inactiveColor ?? = isLight ? Colors .black : Colors .white;
@@ -325,6 +332,7 @@ class FluentThemeData with Diagnosticable {
325332 mediumAnimationDuration: mediumAnimationDuration,
326333 slowAnimationDuration: slowAnimationDuration,
327334 animationCurve: animationCurve,
335+ cursorOpacityAnimates: cursorOpacityAnimates,
328336 accentColor: accentColor,
329337 activeColor: activeColor,
330338 inactiveColor: inactiveColor,
@@ -369,6 +377,7 @@ class FluentThemeData with Diagnosticable {
369377 required this .mediumAnimationDuration,
370378 required this .slowAnimationDuration,
371379 required this .animationCurve,
380+ required this .cursorOpacityAnimates,
372381 required this .brightness,
373382 required this .visualDensity,
374383 required this .scaffoldBackgroundColor,
@@ -432,6 +441,8 @@ class FluentThemeData with Diagnosticable {
432441 slowAnimationDuration:
433442 lerpDuration (a.slowAnimationDuration, b.slowAnimationDuration, t),
434443 animationCurve: t < 0.5 ? a.animationCurve : b.animationCurve,
444+ cursorOpacityAnimates:
445+ t < 0.5 ? a.cursorOpacityAnimates : b.cursorOpacityAnimates,
435446 buttonTheme: ButtonThemeData .lerp (a.buttonTheme, b.buttonTheme, t),
436447 checkboxTheme:
437448 CheckboxThemeData .lerp (a.checkboxTheme, b.checkboxTheme, t),
@@ -499,6 +510,7 @@ class FluentThemeData with Diagnosticable {
499510 Duration ? mediumAnimationDuration,
500511 Duration ? slowAnimationDuration,
501512 Curve ? animationCurve,
513+ bool ? cursorOpacityAnimates,
502514 ButtonThemeData ? buttonTheme,
503515 BottomNavigationThemeData ? bottomNavigationTheme,
504516 CheckboxThemeData ? checkboxTheme,
@@ -546,6 +558,8 @@ class FluentThemeData with Diagnosticable {
546558 slowAnimationDuration:
547559 slowAnimationDuration ?? this .slowAnimationDuration,
548560 animationCurve: animationCurve ?? this .animationCurve,
561+ cursorOpacityAnimates:
562+ cursorOpacityAnimates ?? this .cursorOpacityAnimates,
549563 buttonTheme: this .buttonTheme.merge (buttonTheme),
550564 bottomNavigationTheme:
551565 this .bottomNavigationTheme.merge (bottomNavigationTheme),
@@ -590,6 +604,8 @@ class FluentThemeData with Diagnosticable {
590604 'fastAnimationDuration' , fastAnimationDuration))
591605 ..add (DiagnosticsProperty <Duration >(
592606 'fasterAnimationDuration' , fasterAnimationDuration))
593- ..add (DiagnosticsProperty <Curve >('animationCurve' , animationCurve));
607+ ..add (DiagnosticsProperty <Curve >('animationCurve' , animationCurve))
608+ ..add (DiagnosticsProperty <bool >(
609+ 'cursorOpacityAnimates' , cursorOpacityAnimates));
594610 }
595611}
0 commit comments