showChatUIKitBottomSheet<T> function

Future<T?> showChatUIKitBottomSheet<T>({
  1. required BuildContext context,
  2. List<ChatUIKitEventAction<T>>? items,
  3. Color? backgroundColor,
  4. Color? barrierColor,
  5. bool enableRadius = true,
  6. String? title,
  7. TextStyle? titleStyle,
  8. Widget? titleWidget,
  9. Widget? body,
  10. String? cancelLabel,
  11. bool showCancel = true,
  12. TextStyle? cancelLabelStyle,
  13. double? height,
  14. bool isDismissible = true,
})

Implementation

Future<T?> showChatUIKitBottomSheet<T>({
  required BuildContext context,
  List<ChatUIKitEventAction<T>>? items,
  Color? backgroundColor,
  Color? barrierColor,
  bool enableRadius = true,
  String? title,
  TextStyle? titleStyle,
  Widget? titleWidget,
  Widget? body,
  String? cancelLabel,
  bool showCancel = true,
  TextStyle? cancelLabelStyle,
  double? height,
  bool isDismissible = true,
}) {
  assert(
    (items?.isNotEmpty == true || body != null),
    'items and body cannot be null at the same time',
  );

  return showModalBottomSheet(
    clipBehavior: !enableRadius ? null : Clip.hardEdge,
    isDismissible: isDismissible,
    shape: !enableRadius
        ? null
        : const RoundedRectangleBorder(
            borderRadius: BorderRadius.only(
              topLeft: Radius.circular(16.0),
              topRight: Radius.circular(16.0),
            ),
          ),
    backgroundColor: backgroundColor,
    barrierColor: barrierColor,
    useSafeArea: true,
    context: context,
    builder: (BuildContext context) {
      return ChatUIKitBottomSheet(
        title: title,
        titleStyle: titleStyle,
        titleWidget: titleWidget,
        body: body,
        items: items,
        cancelLabel: cancelLabel,
        height: height,
        cancelLabelStyle: cancelLabelStyle,
        showCancel: showCancel,
      );
    },
  );
}