Skip to main content

RtkProvider

A foundational widget designed to initialize and provide the necessary RealtimeKit environment for a Flutter application. The RtkProvider acts as a context wrapper that sets up design tokens, client configurations, and UI Kit information required for RealtimeKit components. It ensures that functionalities are available and properly initialized throughout the widget tree where it's used.

Usage

To use RtkProvider, wrap the root of your application:

RtkProvider(
meeting: yourMeetingInstance,
uiKitInfo: yourUiKitInfo,
child: MaterialApp(
// Your app's home screen or an entry widget
home: YourAppHome(),
),
)

if you don't want to wrap the root of your app inside RtkProvider, you can also wrap a specific part of your app where you want to use RealtimeKit components but after adding RtkProvider you need a MaterialApp widget under it.

This approach ensures that all the necessary setup is done before your app UI starts, allowing you to utilize RealtimeKit features seamlessly within your application.

Properties

  • child: (Required) The widget below this widget in the tree. This is usually your MaterialApp or your application's home widget.
  • meeting: (Required) An instance of RealtimeKitClient. This represents the RealtimeKit client configuration that includes authentication and other essential settings.
  • uiKitInfo: (Required) An instance of RealtimeKitUIInfo. This holds information related to the RealtimeKit UI such as design tokens and other UI configurations.

Notes

Ensure that the RealtimeKitClient and RealtimeKitUIInfo are properly configured before passing them to the RtkProvider. This is crucial for the proper functioning of all components within your application.

Example

Here is an example of using RtkProvider in an application:

class MyApp extends StatelessWidget {

Widget build(BuildContext context) {
return RtkProvider(
meeeting: RealtimeKitClient(
// RealtimeKitClient client configuration
),
uiKitInfo: RealtimeKitUIInfo(
// UI Kit information and design tokens
),
child: MaterialApp(
home: HomeScreen(),
),
);
}
}

By wrapping your app with RtkProvider, you ensure that all necessary RealtimeKit setups are initialized and available for your app components, allowing you to build a fully functional application.