Skip to content

Instantly share code, notes, and snippets.

@jodinathan
Created September 13, 2019 18:14
Show Gist options
  • Save jodinathan/38692eb9a3df223ac600a4890922abda to your computer and use it in GitHub Desktop.
Save jodinathan/38692eb9a3df223ac600a4890922abda to your computer and use it in GitHub Desktop.
checking named parameters
void foo({String bar = 'hi'}) {
print(bar);
}
void main() async {
bool s = true;
foo(bar: s ? 'hello' : null);
s = false;
foo(bar: s ? 'hello' : null);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment