28 FlMethodCall*
self = FL_METHOD_CALL(
object);
30 g_clear_pointer(&self->name, g_free);
32 g_clear_object(&self->channel);
33 g_clear_object(&self->response_handle);
35 G_OBJECT_CLASS(fl_method_call_parent_class)->dispose(
object);
47 FlMethodChannel* channel,
48 FlBinaryMessengerResponseHandle* response_handle) {
49 g_return_val_if_fail(name !=
nullptr,
nullptr);
50 g_return_val_if_fail(
args !=
nullptr,
nullptr);
51 g_return_val_if_fail(FL_IS_METHOD_CHANNEL(channel),
nullptr);
52 g_return_val_if_fail(FL_IS_BINARY_MESSENGER_RESPONSE_HANDLE(response_handle),
56 FL_METHOD_CALL(g_object_new(fl_method_call_get_type(),
nullptr));
58 self->name = g_strdup(name);
60 self->channel = FL_METHOD_CHANNEL(g_object_ref(channel));
61 self->response_handle =
62 FL_BINARY_MESSENGER_RESPONSE_HANDLE(g_object_ref(response_handle));
68 g_return_val_if_fail(FL_IS_METHOD_CALL(
self),
nullptr);
73 g_return_val_if_fail(FL_IS_METHOD_CALL(
self),
nullptr);
78 FlMethodResponse* response,
80 g_return_val_if_fail(FL_IS_METHOD_CALL(
self), FALSE);
81 g_return_val_if_fail(FL_IS_METHOD_RESPONSE(response), FALSE);
83 g_autoptr(GError) local_error =
nullptr;
88 if (
error ==
nullptr) {
89 g_warning(
"Failed to send method call response: %s",
90 local_error->message);
93 g_propagate_error(
error, local_error);
103 g_return_val_if_fail(FL_IS_METHOD_CALL(
self), FALSE);
105 g_autoptr(FlMethodResponse) response =
113 const gchar* message,
116 g_return_val_if_fail(FL_IS_METHOD_CALL(
self), FALSE);
117 g_return_val_if_fail(code !=
nullptr, FALSE);
119 g_autoptr(FlMethodResponse) response =
128 g_return_val_if_fail(FL_IS_METHOD_CALL(
self), FALSE);
130 g_autoptr(FlMethodResponse) response =