Channel name
一个Flutter应用中可能存在多个Channel,每个Channel在创建时必须指定一个独一无二的name,Channel之间使用name来区分彼此。当有消息从Flutter端发送到Platform端时,会根据其传递过来的channel name找到该Channel对应的Handler(消息处理器)。
下表显示了如何在宿主上接收Dart值,反之亦然:
DartAndroidiOSnullnullnil (NSNull when nested)booljava.lang.BooleanNSNumber numberWithBool:intjava.lang.IntegerNSNumber numberWithInt:int, if 32 bits not enoughjava.lang.LongNSNumber numberWithLong:int, if 64 bits not enoughjava.math.BigIntegerFlutterStandardBigIntegerdoublejava.lang.DoubleNSNumber numberWithDouble:String java.lang.StringNSStringUint8Listbyte[]FlutterStandardTypedData typedDataWithBytes:Int32Listint[]FlutterStandardTypedData typedDataWithInt32:Int64Listlong[]FlutterStandardTypedData typedDataWithInt64:Float64Listdouble[]FlutterStandardTypedData typedDataWithFloat64:Listjava.util.ArrayListNSArrayMapjava.util.HashMapNSDictionary总结