toDart()
toDart(
x):any
Converts a JavaScript object to its Dart representation.
Conversion rules (checked in order):
null/undefined-> passed throughdayjsobject -> DartDateTime- Object with
toDart()method -> callsx.toDart() - Object with
dartproperty -> returnsx.dart - Plain object
{}-> DartMap - JavaScript
BigInt-> DartBigInt - Everything else -> passed through unchanged
Parameters
| Parameter | Type | Description |
|---|---|---|
x | any | JavaScript object to convert |
Returns
any
Dart object handle
See
- toJs for the reverse operation
- ./dart-interop.md for full documentation