Skip to content

Snackbar inside dialog / sheet appeared to be cropped #32

@Nialixus

Description

@Nialixus

Hi there! First of all, thanks for creating this awesome snackbar. So I'm encountering an issue here.

The problem arises when I try to display your snackbar within a dialog. While in a regular scenario this snackbar works just fine, but in dialog the snackbar only displays the asset icon without the rest of the snackbar content, as shown in the image below.

Inidia Milestones

Here's the code snippet I'm using:

ScaffoldMessengerState openSnackbar({
  String title = 'Oops!',
  required String message,
  ContentType? contentType,
}) {
  return ScaffoldMessenger.of(this)
    ..hideCurrentSnackBar()
    ..showSnackBar(
      SnackBar(
        elevation: 0,
        behavior: SnackBarBehavior.floating,
        backgroundColor: Colors.transparent,
        clipBehavior: Clip.none,
        content: ColoredBox(
          color: theme.highlightColor,
          child: AwesomeSnackbarContent(
            title: title,
            message: message,
            contentType: contentType ?? ContentType.failure,
          ),
        ),
      ),
    );
}

I've already confirmed that a regular snackbar layout works as expected in dialogs. Additionally, I've experimented with various properties such as actionOverflowThreshold, margin, padding, shape, width, clip, behavior, inMaterialBanner, titleFontSize, and messageFontSize to troubleshoot the issue with your awesome snackbar. Unfortunately, the snackbar still appears to be cropped.

Any insights or suggestions on resolving this issue would be greatly appreciated. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions