-
Notifications
You must be signed in to change notification settings - Fork 307
[BugFix] Fix for Null Check Operator Used on a Null Value Exception in UiSizes Class #291
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
[BugFix] Fix for Null Check Operator Used on a Null Value Exception in UiSizes Class #291
Conversation
|
please let me know your feedback. @chandansgowda |
|
Great job @AyaNady17 |
|
Also, have you upgraded flutter to latest version ? |
done @chandansgowda |
until now I'm working on the Flutter 3.16.5 version. |
|
Question: Instead of using |
if we declared sizes without using the late keyword, we must initialize it with a specific value. Otherwise, we’ll encounter an error. So, I think late keyword is essential for safely accessing context-related properties once they are fully available. |
|
Great Job @AyaNady17
Let's upgrade before merging this PR. |
…Tags widget due to the latest updates on the package
done, upgraded to the latest stable version with no errors. @chandansgowda |
|
Due to the upgrade one of the packages (text field tags) updated to latest version where one of its attributes have changed and I refactored it to fit with the update so there's some changes in Ui file and pubspec.Yaml but now everything works well with the latest versions. |
|
Thanks for contributing @AyaNady17 |
Description
This PR addresses the issue where a
Null check operator used on a null valueexception is thrown when trying to accessGet.widthandGet.heightin theUiSizesclass before theBuildContextis available.The solution involves refactoring the
UiSizesclass to uselatekeyword for the size variables and initializing them in a newinitmethod which is called after theBuildContextis available. 'MediaQuery' is used to get the screen sizes.Fixes #288
Changes:
UiSizesclass to uselatekeyword for the size variables.initmethod inUiSizesclass to initialize the size variables usingMediaQuery.UiSizes.init()in thebuildmethod of the main widget.How Has This Been Tested?
Null check operator used on a null valueexception.https://github.com/AOSSIE-Org/Resonate/assets/144162711/57346fcb-7e5e-4e6b-9fd5-ed527b031c0a

Checklist:
Maintainer Checklist