From e4b69a689cee3880dd50772d01931099732a2fec Mon Sep 17 00:00:00 2001 From: darkang3lz92 Date: Sun, 27 Dec 2020 21:57:35 +0800 Subject: [PATCH] add fallback color for cursorColor --- lib/src/pin_code_fields.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/src/pin_code_fields.dart b/lib/src/pin_code_fields.dart index e50bd953..f9200814 100644 --- a/lib/src/pin_code_fields.dart +++ b/lib/src/pin_code_fields.dart @@ -419,7 +419,8 @@ class _PinCodeTextFieldState extends State _focusNode.hasFocus && widget.showCursor) { final cursorColor = widget.cursorColor ?? - Theme.of(widget.appContext).textSelectionTheme.cursorColor; + Theme.of(widget.appContext).textSelectionTheme?.cursorColor ?? + Theme.of(context).accentColor; final cursorHeight = widget.cursorHeight ?? widget.textStyle.fontSize + 8; if ((_selectedIndex == index + 1 && index + 1 == widget.length)) {