Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow decoration: null #11

Open
LizDresserDev opened this issue Dec 16, 2020 · 2 comments
Open

Allow decoration: null #11

LizDresserDev opened this issue Dec 16, 2020 · 2 comments
Labels

Comments

@LizDresserDev
Copy link

I started converting some of our TextField() widgets into AutoSizeTextField() widgets. In our TextField() widgets, we allowed for a null decoration like this:

                Flexible(
                  child: TextField(
                    controller: _dateOrTaskNameController,
                    decoration: null,
                  ),
                ),

Simple conversion to AutoSizeTextField() looks like this:

                Flexible(
                  child: AutoSizeTextField(
                    controller: _dateOrTaskNameController,
                    decoration: null,
                  ),
                ),

The exception is below:

I/flutter ( 6673): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter ( 6673): The following NoSuchMethodError was thrown building LayoutBuilder:
I/flutter ( 6673): The getter 'prefixText' was called on null.
I/flutter ( 6673): Receiver: null
I/flutter ( 6673): Tried calling: prefixText
I/flutter ( 6673):
I/flutter ( 6673): The relevant error-causing widget was:
I/flutter ( 6673): AutoSizeTextField lib\dependency\dependency_form.dart
I/flutter ( 6673):
I/flutter ( 6673): When the exception was thrown, this was the stack:
I/flutter ( 6673): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
I/flutter ( 6673): #1 _AutoSizeTextFieldState._checkTextFits package:auto_size_text_field/src/auto_size_text_field.dart:752

Could we get the AutoSizeTextField widget to have the same decoration handling as the TextField widget?

@lzhuor
Copy link
Owner

lzhuor commented Dec 19, 2020

Thanks @LizDW I will need to dig more into the issue. Keep you posted. It will be good if you can help dig into the source code and take look as well.

@lzhuor lzhuor added the enhancement New feature or request label Dec 15, 2021
@lzhuor
Copy link
Owner

lzhuor commented Dec 15, 2021

Working in progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants