open static method
Future<void>
open(
- BuildContext context, {
- required FrontFaceChatConfig config,
- FrontFaceChatTheme theme = const FrontFaceChatTheme(),
- FrontFaceChatStrings strings = const FrontFaceChatStrings(),
- double extraBottomInset = 0,
Opens the chat screen as a full-screen route.
Creates a scoped FrontFaceChatProvider for the route and disposes it when the user closes the screen.
await FrontFaceChat.open(
context,
config: FrontFaceChatConfig(
projectId: 'your-project-uuid',
publishableKey: 'pk_...',
),
);
Implementation
static Future<void> open(
BuildContext context, {
required FrontFaceChatConfig config,
FrontFaceChatTheme theme = const FrontFaceChatTheme(),
FrontFaceChatStrings strings = const FrontFaceChatStrings(),
double extraBottomInset = 0,
}) {
return Navigator.of(context).push<void>(
MaterialPageRoute<void>(
builder: (routeContext) => ChangeNotifierProvider(
create: (_) =>
FrontFaceChatProvider(config: config, strings: strings),
child: FrontFaceChatScreen(
theme: theme,
extraBottomInset: extraBottomInset,
),
),
),
);
}