Flutter Engine
 
Loading...
Searching...
No Matches
fl_method_channel_private.h File Reference

Go to the source code of this file.

Functions

G_BEGIN_DECLS gboolean fl_method_channel_respond (FlMethodChannel *channel, FlBinaryMessengerResponseHandle *response_handle, FlMethodResponse *response, GError **error)
 

Function Documentation

◆ fl_method_channel_respond()

G_BEGIN_DECLS gboolean fl_method_channel_respond ( FlMethodChannel *  channel,
FlBinaryMessengerResponseHandle *  response_handle,
FlMethodResponse *  response,
GError **  error 
)

fl_method_channel_respond: @channel: an #FlMethodChannel. @response_handle: an #FlBinaryMessengerResponseHandle. @response: an #FlMethodResponse. @error: (allow-none): #GError location to store the error occurring, or NULL to ignore.

Responds to a method call.

Returns: TRUE on success.

Definition at line 215 of file fl_method_channel.cc.

219 {
220 g_return_val_if_fail(FL_IS_METHOD_CHANNEL(self), FALSE);
221 g_return_val_if_fail(FL_IS_BINARY_MESSENGER_RESPONSE_HANDLE(response_handle),
222 FALSE);
223 g_return_val_if_fail(FL_IS_METHOD_RESPONSE(response), FALSE);
224
225 g_autoptr(GBytes) message =
226 fl_method_codec_encode_response(self->codec, response, error);
227 if (message == nullptr) {
228 return FALSE;
229 }
230 return fl_binary_messenger_send_response(self->messenger, response_handle,
231 message, error);
232}
G_MODULE_EXPORT gboolean fl_binary_messenger_send_response(FlBinaryMessenger *self, FlBinaryMessengerResponseHandle *response_handle, GBytes *response, GError **error)
g_autoptr(GMutexLocker) locker
GBytes * fl_method_codec_encode_response(FlMethodCodec *self, FlMethodResponse *response, GError **error)
G_BEGIN_DECLS GBytes * message
const uint8_t uint32_t uint32_t GError ** error

References error, fl_binary_messenger_send_response(), fl_method_codec_encode_response(), g_autoptr(), message, and self.

Referenced by fl_method_call_respond(), fl_method_call_respond_error(), fl_method_call_respond_not_implemented(), and fl_method_call_respond_success().