Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ OTPTextField(
fontSize: 17
),
textFieldAlignment: MainAxisAlignment.spaceAround,
textCapitalization: TextCapitalization.characters,
fieldStyle: FieldStyle.underline,
onCompleted: (pin) {
print("Completed: " + pin);
Expand Down
5 changes: 5 additions & 0 deletions lib/otp_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import 'package:otp_text_field/style.dart';
class OTPTextField extends StatefulWidget {
/// TextField Controller
final OtpFieldController? controller;

/// TextCapitalization
final TextCapitalization? textCapitalization;

/// Number of the OTP Fields
final int length;
Expand Down Expand Up @@ -69,6 +72,7 @@ class OTPTextField extends StatefulWidget {
this.controller,
this.fieldWidth = 30,
this.spaceBetween = 0,
this.textCapitalization = TextCapitalization.none,
this.otpFieldStyle,
this.hasError = false,
this.keyboardType = TextInputType.number,
Expand Down Expand Up @@ -187,6 +191,7 @@ class _OTPTextFieldState extends State<OTPTextField> {
style: widget.style,
inputFormatters: widget.inputFormatter,
maxLength: 1,
textCapitalization: widget.textCapitalization!,
focusNode: _focusNodes[index],
obscureText: widget.obscureText,
decoration: InputDecoration(
Expand Down