[doc] added dart type mapping in declaration comment (flutter/engine#25329)

This commit is contained in:
Harsh Bhikadia 2021-04-01 00:20:59 +05:30 committed by GitHub
parent dba2fa42ae
commit 20b6f2a4ea

View File

@ -144,6 +144,20 @@ using EncodableValueVariant = std::variant<std::monostate,
//
// The order/indexes of the variant types is part of the API surface, and is
// guaranteed not to change.
//
// The variant types are mapped with Dart types in following ways:
// std::monostate -> null
// bool -> bool
// int32_t -> int
// int64_t -> int
// double -> double
// std::string -> String
// std::vector<uint8_t> -> Uint8List
// std::vector<int32_t> -> Int32List
// std::vector<int64_t> -> Int64List
// std::vector<double> -> Float64List
// EncodableList -> List
// EncodableMap -> Map
class EncodableValue : public internal::EncodableValueVariant {
public:
// Rely on std::variant for most of the constructors/operators.