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

fix: add extension to change null address to new value #146

Merged
merged 2 commits into from
Aug 11, 2024

Conversation

kamilfedio
Copy link
Member

No description provided.

@kamilfedio kamilfedio self-assigned this Aug 7, 2024
Copy link
Member

@simon-the-shark simon-the-shark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one note :)

extension ChangeNullAdress on String? {
String? changeNull() {
if (this == null) {
return AppLocalizationsPl().no_address;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tbh, hardcoding here AppLocalizationsPl kills the purpose of localization. You should always get the locale from BuildContext to make it work as intended:

extension ChangeNullAdressX on BuildContext {
  String? changeNull(String? address) {
    return address ?? localize.no_address;
  }
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok done

@mikolaj-jalocha mikolaj-jalocha added the bug Something isn't working label Aug 8, 2024
@simon-the-shark simon-the-shark merged commit a5716b1 into main Aug 11, 2024
2 checks passed
@simon-the-shark simon-the-shark deleted the fix/remove-null-from-address branch August 11, 2024 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants