question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jaumardcommented, Sep 2, 2020

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 😃

1reaction
jaumardcommented, Aug 28, 2020

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 ^^

Read more comments on GitHub >

github_iconTop Results From Across the Web

Not able to change TextField Border Color - Stack Overflow
The new way to do it is to use enabledBorder like this: new TextField( decoration: new InputDecoration( enabledBorder: const ...
Read more >
Change TextField Border Color in Flutter - RIGHT Way [2022]
You can change the TextField border color globally by defining the inputDecorationTheme and then adding the OutlineInputBorder widget.
Read more >
InputDecoration class - material library - Flutter - Dart API docs
This sample shows how to style a TextField using an InputDecorator . The TextField displays a "send message" icon to the left of...
Read more >
How to change border color of Material-UI TextField? - YouTube
Learn to change the border color of TextField component provided by Material-UI.You will learn about 2 components here TextField, ...
Read more >
How To Change TextField's/TextFormField's Border Colors
If you have ever wondered how to completely control and change the colors of any TextField or TextFormField, then this video is your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found