#include <method_channel.h>
template<typename T = EncodableValue>
class flutter::MethodChannel< T >
Definition at line 34 of file method_channel.h.
◆ MethodChannel() [1/2]
template<typename T = EncodableValue>
Definition at line 38 of file method_channel.h.
41 : messenger_(messenger), name_(name), codec_(codec) {}
◆ ~MethodChannel()
template<typename T = EncodableValue>
◆ MethodChannel() [2/2]
template<typename T = EncodableValue>
◆ InvokeMethod()
template<typename T = EncodableValue>
Definition at line 53 of file method_channel.h.
56 MethodCall<T> method_call(method, std::move(arguments));
57 std::unique_ptr<std::vector<uint8_t>> message =
58 codec_->EncodeMethodCall(method_call);
60 messenger_->
Send(name_, message->data(), message->size(),
nullptr);
67 std::shared_ptr<MethodResult<T>> shared_result(result.release());
68 const auto* codec = codec_;
69 std::string channel_name = name_;
70 BinaryReply reply_handler = [shared_result, codec, channel_name](
71 const uint8_t* reply,
size_t reply_size) {
72 if (reply_size == 0) {
73 shared_result->NotImplemented();
78 bool decoded = codec->DecodeAndProcessResponseEnvelope(
79 reply, reply_size, shared_result.get());
81 std::cerr <<
"Unable to decode reply to method "
82 "invocation on channel "
83 << channel_name << std::endl;
84 shared_result->NotImplemented();
88 messenger_->
Send(name_, message->data(), message->size(),
89 std::move(reply_handler));
References flutter::BinaryMessenger::Send().
Referenced by flutter::TEST().
◆ operator=()
template<typename T = EncodableValue>
◆ Resize()
template<typename T = EncodableValue>
◆ SetMethodCallHandler()
template<typename T = EncodableValue>
Definition at line 99 of file method_channel.h.
104 const auto* codec = codec_;
105 std::string channel_name = name_;
107 const uint8_t* message,
112 std::make_unique<EngineMethodResult<T>>(std::move(reply), codec);
113 std::unique_ptr<MethodCall<T>> method_call =
114 codec->DecodeMethodCall(message, message_size);
116 std::cerr <<
"Unable to construct method call from message on channel "
117 << channel_name << std::endl;
118 result->NotImplemented();
121 handler(*method_call, std::move(result));
References flutter::BinaryMessenger::SetMessageHandler().
Referenced by flutter::TEST().
◆ SetWarnsOnOverflow()
template<typename T = EncodableValue>
The documentation for this class was generated from the following file: