StreamChat constructor

const StreamChat(
  1. {Key? key,
  2. required StreamChatClient client,
  3. required Widget? child,
  4. StreamChatThemeData? streamChatThemeData,
  5. StreamChatConfigurationData? streamChatConfigData,
  6. EventHandler? onBackgroundEventReceived,
  7. Duration backgroundKeepAlive = const Duration(minutes: 1),
  8. Stream<ConnectivityResult>? connectivityStream,
  9. bool useMaterial3 = false}
)

Widget used to provide information about the chat to the widget tree

class MyApp extends StatelessWidget { final StreamChatClient client;

MyApp(this.client);

@override Widget build(BuildContext context) { return MaterialApp( home: Container( child: StreamChat( client: client, child: ChannelListPage(), ), ), ); } }

Use StreamChat.of to get the current StreamChatState instance.

Implementation

const StreamChat({
  super.key,
  required this.client,
  required this.child,
  this.streamChatThemeData,
  this.streamChatConfigData,
  this.onBackgroundEventReceived,
  this.backgroundKeepAlive = const Duration(minutes: 1),
  this.connectivityStream,
  this.useMaterial3 = false,
});