sms_autofill
sms_autofill copied to clipboard
cannot change PinFieldAutoFill's background color
I'm using the sms_autofill package to create an SMS verification page. I use the PinFieldAutoFill widget to insert the sms code.
I want the background color of the widget to be white instead of grey:

How do I change it?
Here is my code:
PinFieldAutoFill(
autoFocus: autoFocus,
codeLength: smsCode.length,
currentCode: autoComplete ? smsCode : null,
decoration: BoxLooseDecoration(
strokeColorBuilder: PinListenColorBuilder(Colors.black, Colors.black26),
bgColorBuilder: const FixedColorBuilder(Colors.white),
strokeWidth: 1.2,
),
onCodeChanged: (p0) {
if (p0?.length == smsCode.length && !autoComplete) {
context.read<LoginBloc>().add(LoginEventSubmitSmsCode(p0!));
}
},
);
Is this package deprecated? Can anyone help here please?
Hi @CartmanGD you can use this package : https://pub.dev/packages/otp_pin_field
you can surround PinFieldAutoFill with a theme widget like so:
Theme(
data: Theme.of(context).copyWith(
inputDecorationTheme: Theme.of(context).inputDecorationTheme.copyWith(
fillColor: Colors.transparent,
filled: true,
),
),
child: PinFieldAutoFill(
onCodeChanged: (code) {},
),
)