show static method

Future<void> show(
  1. BuildContext context, {
  2. required ChatUser user,
  3. String? subtitle,
  4. List<ChatProfileAction> actions = const [],
})

Shows the profile of user in a bottom sheet.

Implementation

static Future<void> show(
  BuildContext context, {
  required ChatUser user,
  String? subtitle,
  List<ChatProfileAction> actions = const [],
}) {
  final theme = ChatThemeData.of(context);
  final l10n = ChatLocalizations.of(context);
  return showModalBottomSheet<void>(
    context: context,
    showDragHandle: true,
    useSafeArea: true,
    isScrollControlled: true,
    builder: (sheetContext) => ChatScope(
      theme: theme,
      localizations: l10n,
      child: ChatUserProfile(
        user: user,
        subtitle: subtitle,
        actions: [
          for (final action in actions)
            ChatProfileAction(
              icon: action.icon,
              label: action.label,
              isDestructive: action.isDestructive,
              onPressed: () {
                Navigator.of(sheetContext).pop();
                action.onPressed();
              },
            ),
        ],
      ),
    ),
  );
}