Null class
The reserved word null
denotes an object that is the sole instance of this class.
The Null
class is the only class which does not implement Object
. It is a compile-time error for a class to attempt to extend or implement Null.
The language contains a number of specialized operators for working with null
value. Examples:
e1! // Throws if e1 is null. e2 ?? e3 // Same as e2, unless e2 is null, then use value of e3 x ??= e4 // Same as x unless x is null, then same as `x = e4`. e5?.foo() // call `foo` on e5, unless e5 is null. [...? e6] // spreads e6 into the list literal, unless e6 is null.
Properties
- hashCode → int read-only, override
- The hash code for this object. [...]
- runtimeType → Type read-only, inherited
- A representation of the runtime type of the object.
Methods
- noSuchMethod(
Invocation invocation) → dynamic inherited - Invoked when a non-existent method or property is accessed. [...]
- toString(
) → String override - Returns the string
"null"
.
Operators
- operator ==(
Object other) → bool inherited - The equality operator. [...]
© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.13.0/dart-core/Null-class.html