dart:core
庫中Null
類的用法介紹如下。
保留字null
表示一個對象,它是該類的唯一實例。
Null
類是唯一沒有實現 Object
的類。類嘗試擴展或實現 Null 是編譯時錯誤。
該語言包含許多用於處理null
值的專用運算符。例子:
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.
相關用法
- Dart NumberList.last用法及代碼示例
- Dart NumberList.elementAt用法及代碼示例
- Dart NumberList.length用法及代碼示例
- Dart NumberList.clear用法及代碼示例
- Dart NumberList.first用法及代碼示例
- Dart NodeList.last用法及代碼示例
- Dart NodeList.first用法及代碼示例
- Dart NodeList.elementAt用法及代碼示例
- Dart NodeList.length用法及代碼示例
- Dart Navigator.getUserMedia用法及代碼示例
- Dart NativeApi.newNativePort用法及代碼示例
- Dart MapMixin.containsKey用法及代碼示例
- Dart Iterator用法及代碼示例
- Dart AttributeClassSet.intersection用法及代碼示例
- Dart num.sign用法及代碼示例
- Dart TransformList.last用法及代碼示例
- Dart FileList.first用法及代碼示例
- Dart CanvasRenderingContext2D.drawImageScaledFromSource用法及代碼示例
- Dart FileList.length用法及代碼示例
- Dart Iterable.takeWhile用法及代碼示例
- Dart LinkedHashMap用法及代碼示例
- Dart RegExp.pattern用法及代碼示例
- Dart StreamTransformer構造函數用法及代碼示例
- Dart JsArray.removeAt用法及代碼示例
- Dart ListMixin.expand用法及代碼示例
注:本文由純淨天空篩選整理自dart.dev大神的英文原創作品 Null class。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。