Container(
padding: EdgeInsets.symmetric(horizontal: 10),
child: PinCodeTextField(
length: 6,
obscureText: false,
autoFocus: true,
keyboardType:TextInputType.number,
animationType: AnimationType.fade,
shape: PinCodeFieldShape.box,
animationDuration: Duration(milliseconds: 300),
borderRadius: BorderRadius.circular(5),
fieldHeight: 50,
fieldWidth: 40,
cursorWidth: 1.5,
activeColor : UIColors.primaryColor,
inactiveColor: Colors.grey[500],
selectedColor: Colors.black,
textStyle: TextStyle(fontSize: 16, fontFamily: "JFFlat"),
onChanged: (value) {},
onCompleted: (val) {
bloc.setCode(val);
},
),
),
答案 0 :(得分:0)
尝试将所有内容都放在 boxDecoration
参数中
答案 1 :(得分:0)
PinCodeTextField 已更新,但您使用的是旧版本的代码 您已将这些属性包装在 PinTheme 中
PinCodeTextField(
length: 6,
obscureText: false,
autoFocus: true,
keyboardType:TextInputType.number,
animationType: AnimationType.fade,
pinTheme: PinTheme(
shape: PinCodeFieldShape.box,
borderRadius: BorderRadius.circular(5),
fieldHeight: 50,
fieldWidth: 40,
activeColor : UIColors.primaryColor,
inactiveColor: Colors.grey[500],
selectedColor: Colors.black,
),
animationDuration: Duration(milliseconds: 300),
cursorWidth: 1.5,
textStyle: TextStyle(fontSize: 16, fontFamily: "JFFlat"),
onChanged: (value) {},
onCompleted: (val) {
bloc.setCode(val);
},
),