Skip to content

Conversation

@abdelrahmanelmarakby
Copy link

@abdelrahmanelmarakby abdelrahmanelmarakby commented Jun 4, 2023

fix widgets_binding_observer.dart:183:17: Error: A non-null value must be returned since the return type 'String' doesn't allow null. because switch returns String? not String because there is no default case

📜 Description

💡 Motivation and Context

💚 How did you test it?

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPii is enabled
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

🔮 Next steps

fix ```widgets_binding_observer.dart:183:17: Error: A non-null value must be returned since the return type 'String' doesn't allow null.``` because switch returns String? not String because there is no default case
@ueman
Copy link
Collaborator

ueman commented Jun 4, 2023

Apparently, there were more states added: https://master-api.flutter.dev/flutter/dart-ui/AppLifecycleState.html

@marandaneto
Copy link
Contributor

Makes sense @abdelrahmanelmarakby
Would you mind adding a changelog entry?

@codecov
Copy link

codecov bot commented Jun 4, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +2.70 🎉

Comparison is base (7e30648) 88.65% compared to head (fc43e6f) 91.35%.

❗ Current head fc43e6f differs from pull request most recent head 76d9af1. Consider uploading reports for the commit 76d9af1 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1503      +/-   ##
==========================================
+ Coverage   88.65%   91.35%   +2.70%     
==========================================
  Files         142      161      +19     
  Lines        4389     5150     +761     
==========================================
+ Hits         3891     4705     +814     
+ Misses        498      445      -53     
Impacted Files Coverage Δ
flutter/lib/src/widgets_binding_observer.dart 98.11% <100.00%> (ø)

... and 60 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@abdelrahmanelmarakby
Copy link
Author

@marandaneto will add the entry , any thing else to take in consideration?

@marandaneto
Copy link
Contributor

@abdelrahmanelmarakby thanks for the PR.
I will close this one in favor of #1506 because there are more places doing this and can break in the future, so I decided to fix the other cases as well in a single PR.
Will add the credits to the PR tho :)

@marandaneto marandaneto closed this Jun 5, 2023
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.

3 participants