jaumard/sms_autofill

Unable to change textborder for PinFieldAutoFill when global theme for textfield defined

kshkrao3 opened this issue ยท 14 comments

Hi,

I am using the PinFieldAutoFill widget for OTP functionality. But, because of the global theme, I defined it is effecting this Widget too.

Decoration Defined for InputDecoration

InputDecorationTheme inputDecorationTheme() {
  OutlineInputBorder outlineInputBorder = OutlineInputBorder(
    borderRadius: BorderRadius.circular(28),
    borderSide: BorderSide(color: bsTextColor),
    gapPadding: 10,
 );
 return InputDecorationTheme(
    contentPadding: const EdgeInsets.symmetric(
       horizontal: 42,
       vertical: 20,
    ),
    enabledBorder: outlineInputBorder,
    focusedBorder: outlineInputBorder,
    border: outlineInputBorder,
 );
}

Inside the MaterialApp I've defined it as following

theme: ThemeData(
    inputDecorationTheme: inputDecorationTheme(),
)

But this is effecting the PinFieldAutoFill widget with BoxLooseDecoration and causes something like below

image

See those grey lines above and below after each text box.. How can override the parent theme for this widget?

If you wrap the widget with a Theme widget you should be able to override the theme.

@jaumard Thanks for the info, but do you have any examples please?

No never have that issue, and this field is coming from pin_input_text_field package so you might want to ask them about this ^^

@jaumard Indeed.. I missed it. Let me check with them, but if they are exposing any options, it has to come via this widget itself right? ๐Ÿ˜… Just wondering..

Yep if they are supporting this I'll have to expose the options that allow that :) but not sure they already have something for that

Anyways, I will raise an Issue on their end and will keep posted on any updates.. :)

@jaumard .. There's been a fix by pin_input_text_field. Could you please check once and let me know if you can provide an update for this?

Ref - TinoGuo/pin_input_text_field#41

I'm using pin_input_text_field: ">=3.0.5 <4.0.0" so you can run pub update it should update to last available version :)

@jaumard .. Perfect.. Works Elegantly.. Thank you.. ๐Ÿ‘

@jaumard ... One more query. Did not want to raise a ticket for this.
I am getting

.pub-cache\hosted\pub.dartlang.org\sms_autofill-1.2.4\android\src\main\java\com\jaumard\smsautofill\AppSignatureHelper.java uses or overrides a deprecated API.

Anything you can look into from your end?

problem is that don't know what is deprecated :/ I don't manage to find the details of that warning :(

@jaumard .. Ah okay. No problem.. ๐Ÿ‘

If you manage to have more information somehow on what's deprecated I would gladly check that but so far no luck on my side

Sure. I will check from my end and let you know here if I get any leads..