dart-lang / dart-lang/language
Request: calling a function only when a parameter is not null.
Open
request
- Dominant language
- TeX
- Stars
- 2.9k
- Forks
- 239
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 14
Description
It's awkward to call a function when a parameter is not null, such as:
```dart
String toPrint;
if (toPrint != null) {
print(toPrint);
}
```
This is significantly more work than calling a method when the target is not null:
```dart
Printer printer;
printer?.print(toPrint);
```
So naturally we developers have gotten privileged and want both :)
Contributor guide
Assessment
This issue has not been assessed yet.