Functions to enable plugins
Enable Plugins
Each plugin in meeting.plugins
object is of type
RtkPlugin
and exposes the following functions to enable
plugins.
Activate Plugins
The activate()
method activates a plugin for all users in the meeting. The snippet below retrieves the first plugin from the list and activates it.
final plugins = await meeting.plugins.all;
plugins.first.activate();
This directly activates the plugin without any user interaction.
For e.g. you can also show a list of all plugins and activate a plugin on click programmatically.
class ExamplePluginWidget extends StatelessWidget {
final List<RtkPlugin> plugins;
const ExamplePluginWidget(
this.plugins, {
super.key,
});
Widget build(BuildContext context) {
return ListView(
children: plugins
.map((plugin) => ElevatedButton(
child: Text('Activate ${plugin.name}'),
onPressed: () => plugin.activate(),
))
.toList(),
);
}
}
Get Plugin View
When a plugin is enabled, the core SDK adds a communication layer between the plugin inside the WebView and
itself (meeting object). You can show the plugin using PluginView
which is a widget that takes RtkPlugin
as an argument.
class ExamplePluginWidget extends StatelessWidget {
final RtkPlugin plugin;
const ExamplePluginWidget(
this.plugin, {
super.key,
});
Widget build(BuildContext context) => PluginView(plugin);
}
Disable Plugins
Each plugin in meeting.plugins
object is of type
RtkPlugin
and exposes the following functions to disable
plugins.
Deactivate Plugin
The deactivate()
method deactivates the plugin for all users in the meeting.
final plugins = await meeting.plugins.all;
plugins.first.deactivate();