From e773490dc1351c8e3048e1a6ceb9f0bce10ddce1 Mon Sep 17 00:00:00 2001 From: amancc17 <141010386+amancc17@users.noreply.github.com> Date: Tue, 1 Aug 2023 12:23:49 +0000 Subject: [PATCH] Cursor color added --- lib/otp_field.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/otp_field.dart b/lib/otp_field.dart index 279571d..51b3e34 100644 --- a/lib/otp_field.dart +++ b/lib/otp_field.dart @@ -27,6 +27,7 @@ class OTPTextField extends StatefulWidget { /// show the error border or not final bool hasError; + final Color cursorColor; final TextCapitalization textCapitalization; @@ -70,6 +71,7 @@ class OTPTextField extends StatefulWidget { this.fieldWidth = 30, this.spaceBetween = 0, this.otpFieldStyle, + this.cursorColor, this.hasError = false, this.keyboardType = TextInputType.number, this.style = const TextStyle(), @@ -180,6 +182,7 @@ class _OTPTextFieldState extends State { right: isLast ? 0 : widget.spaceBetween, ), child: TextField( + cursorColor : widget.cursorColor, controller: _textControllers[index], keyboardType: widget.keyboardType, textCapitalization: widget.textCapitalization,