| pcx_content_type |
navigation |
| title |
RtkProvider |
| description |
API reference for RtkProvider component (Flutter Library) |
| products |
|
A foundational widget that initializes and provides the RealtimeKit environment for a Flutter application. RtkProvider acts as a context wrapper that sets up design tokens, client configurations, and UI Kit information required by RealtimeKit components.
| Property |
Type |
Required |
Default |
Description |
child |
Widget |
✅ |
- |
The widget below this widget in the tree |
meeting |
RealtimekitClient |
✅ |
- |
Meeting client instance |
uiKitInfo |
RealtimeKitUIInfo |
✅ |
- |
UI Kit configuration info including design tokens and UI settings |
observers |
List<ProviderObserver>? |
❌ |
null |
Riverpod provider observers for debugging |
import 'package:realtimekit_ui/realtimekit_ui.dart';
RtkProvider(
meeting: yourMeetingInstance,
uiKitInfo: yourUiKitInfo,
child: MaterialApp(
home: YourAppHome(),
),
)
import 'package:realtimekit_ui/realtimekit_ui.dart';
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return RtkProvider(
meeting: RealtimekitClient(
// Client configuration
),
uiKitInfo: RealtimeKitUIInfo(
// UI Kit information and design tokens
),
observers: [MyProviderObserver()],
child: MaterialApp(
home: HomeScreen(),
),
);
}
}
:::note
You do not need to wrap the root of your application inside RtkProvider. You can wrap a specific subtree where you use RealtimeKit components. A MaterialApp widget must exist below RtkProvider in the widget tree.
:::