I've seen this code and need an explanation for "??". I know ternary operators like "?" and then the true-condition and after ":" the false/else condition. But what means the double "??" ?
Thanks in advance
widget.secondaryImageTop ??
(widget.height / 2) - (widget.secondaryImageHeight / 2); ```
List of all dart operators
it's the coalesce operator.
a ?? b
means: if a is not null, it resolves to a
. if a
is null, it resolves to b
.
SQL and a few other languages have this operator.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With