OTPTextField( length: 5, keyboardType: TextInputType.number, width: MediaQuery.of(context).size.width, fieldWidth: 30, style: TextStyle(fontSize: 17, color: gettcolor(context)), textFieldAlignment: MainAxisAlignment.spaceAround, fieldStyle: FieldStyle.box, onCompleted: (pin) { otp = pin; }, ),
在这里,无论我是否使用 otpfieldstyle 并将颜色设置为任何内容,它都保持不变
尝试设置以下属性:
OTPTextField(
otpFieldStyle: OtpFieldStyle(focusBorderColor: Colors.amber,),
borderColor: Colors.purple,
),