Skip to content

Commit 6030284

Browse files
authored
Merge pull request #135 from darkang3lz92/add-fallback-selection-color
add fallback color for cursorColor
2 parents a92ca15 + e4b69a6 commit 6030284

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/src/pin_code_fields.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,8 @@ class _PinCodeTextFieldState extends State<PinCodeTextField>
419419
_focusNode.hasFocus &&
420420
widget.showCursor) {
421421
final cursorColor = widget.cursorColor ??
422-
Theme.of(widget.appContext).textSelectionTheme.cursorColor;
422+
Theme.of(widget.appContext).textSelectionTheme?.cursorColor ??
423+
Theme.of(context).accentColor;
423424
final cursorHeight = widget.cursorHeight ?? widget.textStyle.fontSize + 8;
424425

425426
if ((_selectedIndex == index + 1 && index + 1 == widget.length)) {

0 commit comments

Comments
 (0)