Overview
EncodableValue overrides conversion constructor from std::variant to avoid implicit conversion: https://github.com/flutter/engine/blob/93da4784765158a89e269cdea36b2ba7fab85a27/shell/platform/common/client_wrapper/include/flutter/encodable_value.h#L190-L199.
Although MSVC compiler chooses a different constructor, it seems reasonable to use the API the intended way, for example camera.cpp in camera_windows plugin: https://github.com/flutter/plugins/blob/5159d5ec00478950a8ce24945a73a9567e4b9aaa/packages/camera/camera_windows/windows/camera.cpp#L156-L161.
Proposal
Explicitly calling EncodableValue constructor in:
Fix to:
indent.writeln('flutter::EncodableValue(reply(wrapped));');
Fix to:
indent.writeln(
'WriteValue(flutter::EncodableValue(std::any_cast<${customClass.name}>(*custom_value).ToEncodableMap()), stream);');
Overview
EncodableValueoverrides conversion constructor fromstd::variantto avoid implicit conversion: https://github.com/flutter/engine/blob/93da4784765158a89e269cdea36b2ba7fab85a27/shell/platform/common/client_wrapper/include/flutter/encodable_value.h#L190-L199.Although MSVC compiler chooses a different constructor, it seems reasonable to use the API the intended way, for example
camera.cppincamera_windowsplugin: https://github.com/flutter/plugins/blob/5159d5ec00478950a8ce24945a73a9567e4b9aaa/packages/camera/camera_windows/windows/camera.cpp#L156-L161.Proposal
Explicitly calling EncodableValue constructor in:
Fix to:
Fix to: