> For the complete documentation index, see [llms.txt](https://meulencv.gitbook.io/flutter-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://meulencv.gitbook.io/flutter-documentation/dart/if-else-in-one-line.md).

# If / Else in one line

```dart
myVar == null ? 0 : myVar
//If myVar is null then is 0, else then myVar
```
