Dart comes with an operator ?.and ??for zero verification.
You can do the following:
var result = _contact?.email ?? ""
You can also do
if (t?.creationDate?.millisecond != null) {
...
}
Which is equivalent:
if (t && t.creationDate && t.creationDate.millisecond) {
...
}
source
share