Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/otp_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ class OTPTextField extends StatefulWidget {

/// The style to use for the text being edited.
final double outlineBorderRadius;


/// The cursorColor of the text field (Default is set to Blue).
final Color cursorColor;

/// Text Field Alignment
/// default: MainAxisAlignment.spaceBetween [MainAxisAlignment]
Expand Down Expand Up @@ -58,6 +62,7 @@ class OTPTextField extends StatefulWidget {
this.keyboardType = TextInputType.number,
this.style = const TextStyle(),
this.outlineBorderRadius: 10,
this.cursorColor = Colors.blue,
this.textFieldAlignment = MainAxisAlignment.spaceBetween,
this.obscureText = false,
this.fieldStyle = FieldStyle.underline,
Expand Down Expand Up @@ -139,6 +144,7 @@ class _OTPTextFieldState extends State<OTPTextField> {
color: _otpFieldStyle.backgroundColor,
borderRadius: BorderRadius.circular(widget.outlineBorderRadius)),
child: TextField(
cursorColor: widget.cursorColor,
controller: _textControllers[i],
keyboardType: widget.keyboardType,
textAlign: TextAlign.center,
Expand Down