show static method

Future<void> show({
  1. required BuildContext context,
  2. required SMSupportData smSupportData,
})

Show SM Support as a bottom sheet within the parent app's context

This method allows opening the support interface without creating a new MaterialApp. The bottom sheet is dismissible by tapping outside or dragging down.

Example:

await SMSupport.show(
  context: context,
  smSupportData: SMSupportData(
    appName: 'Your App',
    locale: SMSupportLocale.en,
    tenantId: '1',
    apiKey: 'your-api-key',
    secretKey: 'your-secret-key',
    baseUrl: 'https://api.example.com',
    socketBaseUrl: 'wss://socket.example.com',
  ),
);

Implementation

static Future<void> show({
  required BuildContext context,
  required SMSupportData smSupportData,
}) async {
  // Initialize all services before showing UI
  await InitializationHandler.initialize(
    context: context,
    smSupportData: smSupportData,
  );

  // Show the bottom sheet - remaining initialization happens inside
  if (context.mounted) {
    await BottomSheetWrapper.show(
      context: context,
      smSupportData: smSupportData,
    );
  }
}