You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[flutter_tools] boolArg() should be non-nullable, and throw if the flag doesn't exist #105263
@Jasguerrero I keep running into this pattern. Can we make boolArg return a nonnull bool to simplify the code, and have it throw an exception (not toolExit since it's a developer error) if the flag doesn't exist?
Actually, I guess I'm essentially proposing going back to the old behavior from before #101595
They make an assumption that the argument passed to them is valid therefore if the key is not found this methods raise an ArgumentError
That seems like the correct behavior in most cases? The key isn't there, so it should throw. There's no paper trail from #101595 to see what issue the proposed pattern was solving when the key wasn't present.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
christopherfujino commentedon Jun 2, 2022
WDYT @Jasguerrero ?
Jasguerrero commentedon Jun 2, 2022
SGTM
jmagman commentedon Sep 10, 2022
My comment from the discussion was:
Actually, I guess I'm essentially proposing going back to the old behavior from before #101595
That seems like the correct behavior in most cases? The key isn't there, so it should throw. There's no paper trail from #101595 to see what issue the proposed pattern was solving when the key wasn't present.
christopherfujino commentedon Mar 8, 2023
From a discussion in discord:
christopherfujino commentedon Mar 8, 2023
cc @bartekpacia
github-actions commentedon Mar 27, 2023
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.