Dart数据类型与iOS/Android转换关系表

 

The following table shows how Dart values are received on the platform side and vice versa:

Dart Java Kotlin Obj-C Swift
null null null nil (NSNull when nested) nil
bool java.lang.Boolean Boolean NSNumber numberWithBool: NSNumber(value: Bool)
int java.lang.Integer Int NSNumber numberWithInt: NSNumber(value: Int32)
int, if 32 bits not enough java.lang.Long Long NSNumber numberWithLong: NSNumber(value: Int)
double java.lang.Double Double NSNumber numberWithDouble: NSNumber(value: Double)
String java.lang.String String NSString String
Uint8List byte[] ByteArray FlutterStandardTypedData typedDataWithBytes: FlutterStandardTypedData(bytes: Data)
Int32List int[] IntArray FlutterStandardTypedData typedDataWithInt32: FlutterStandardTypedData(int32: Data)
Int64List long[] LongArray FlutterStandardTypedData typedDataWithInt64: FlutterStandardTypedData(int64: Data)
Float64List double[] DoubleArray FlutterStandardTypedData typedDataWithFloat64: FlutterStandardTypedData(float64: Data)
List java.util.ArrayList List NSArray Array
Map java.util.HashMap HashMap NSDictionary Dictionary

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-05
  • 2021-11-24
  • 2021-05-13
  • 2021-12-10
  • 2021-09-19
猜你喜欢
  • 2021-07-02
  • 2022-12-23
  • 2022-01-03
  • 2022-01-19
  • 2022-12-23
  • 2021-11-14
  • 2022-03-03
相关资源
相似解决方案