Flutter Engine
fl_platform_plugin.h File Reference
#include "flutter/shell/platform/linux/public/flutter_linux/fl_binary_messenger.h"

Go to the source code of this file.

Functions

G_BEGIN_DECLS G_DECLARE_FINAL_TYPE (FlPlatformPlugin, fl_platform_plugin, FL, PLATFORM_PLUGIN, GObject)
 
FlPlatformPlugin * fl_platform_plugin_new (FlBinaryMessenger *messenger)
 

Function Documentation

◆ fl_platform_plugin_new()

FlPlatformPlugin* fl_platform_plugin_new ( FlBinaryMessenger *  messenger)

FlPlatformPlugin:

#FlPlatformPlugin is a plugin that implements the shell side of PlatformPlugins.platform from the Flutter services library. fl_platform_plugin_new: : an #FlBinaryMessenger

Creates a new plugin that implements SystemChannels.platform from the Flutter services library.

Returns: a new #FlPlatformPlugin

Definition at line 193 of file fl_platform_plugin.cc.

References fl_json_method_codec_new(), fl_method_channel_new(), fl_method_channel_set_method_call_handler(), kChannelName, and method_call_cb().

Referenced by fl_view_constructed().

193  {
194  g_return_val_if_fail(FL_IS_BINARY_MESSENGER(messenger), nullptr);
195 
196  FlPlatformPlugin* self =
197  FL_PLATFORM_PLUGIN(g_object_new(fl_platform_plugin_get_type(), nullptr));
198 
199  g_autoptr(FlJsonMethodCodec) codec = fl_json_method_codec_new();
200  self->channel =
201  fl_method_channel_new(messenger, kChannelName, FL_METHOD_CODEC(codec));
203  nullptr);
204 
205  return self;
206 }
G_MODULE_EXPORT FlJsonMethodCodec * fl_json_method_codec_new()
static constexpr char kChannelName[]
G_MODULE_EXPORT void fl_method_channel_set_method_call_handler(FlMethodChannel *self, FlMethodChannelMethodCallHandler handler, gpointer user_data, GDestroyNotify destroy_notify)
G_MODULE_EXPORT FlMethodChannel * fl_method_channel_new(FlBinaryMessenger *messenger, const gchar *name, FlMethodCodec *codec)
static void method_call_cb(FlMethodChannel *channel, FlMethodCall *method_call, gpointer user_data)

◆ G_DECLARE_FINAL_TYPE()

G_BEGIN_DECLS G_DECLARE_FINAL_TYPE ( FlPlatformPlugin  ,
fl_platform_plugin  ,
FL  ,
PLATFORM_PLUGIN  ,
GObject   
)