I agree that it would be better to not compare a null reference at all. A better option would be to return multiple values or have a tuple type and pattern matching.
Like I said, I'm not particularly a fan of Dart.
Like I said, I'm not particularly a fan of Dart.
ie. data Maybe a = Nothing | Just a data Either a b = Left a | Right b instead of (err,result) like in go