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

Remove Null Checker #197

Merged
merged 2 commits into from
Dec 24, 2024
Merged

Remove Null Checker #197

merged 2 commits into from
Dec 24, 2024

Conversation

Noslin22
Copy link
Contributor

Just removed the null check, now the field can be cleared by defining the selectedValue to null.

Before, if you tried to clear the selected value, you would get this error:

════════ Exception caught by widgets library ═══════════════════════════════════
The following _TypeError was thrown building SearchCitiesField(dependencies: [_LocalizationsScope-[GlobalKey#93cef]]):
Null check operator used on a null value

The relevant error-causing widget was:
    SearchCitiesField SearchCitiesField:file:///D:/Projects/Flutter/Fun%20Projects/planner_app/lib/ui/register/widgets/information_card.dart:78:38

When the exception was thrown, this was the stack:
#0      _SearchFieldState.didUpdateWidget (package:searchfield/src/searchfield.dart:678:52)
searchfield.dart:678
#1      StatefulElement.update (package:flutter/src/widgets/framework.dart:5803:55)
framework.dart:5803
#2      Element.updateChild (package:flutter/src/widgets/framework.dart:3941:15)
framework.dart:3941
#3      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5656:16)
framework.dart:5656
#4      Element.rebuild (package:flutter/src/widgets/framework.dart:5347:7)
framework.dart:5347
...

But now it works perfectly.

@maheshj01
Copy link
Owner

maheshj01 commented Dec 23, 2024

@Noslin22 thanks for the PR, I have pushed some updates to master branch please rebase the branch which should fix the test failure for this PR.

@maheshj01 maheshj01 merged commit 7047ebe into maheshj01:master Dec 24, 2024
2 checks passed
@maheshj01
Copy link
Owner

maheshj01 commented Dec 24, 2024

Thanks for the PR @Noslin22

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

Successfully merging this pull request may close these issues.

2 participants