Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snackbar inside dialog / sheet appeared to be cropped #32

Open
Nialixus opened this issue Feb 29, 2024 · 1 comment
Open

Snackbar inside dialog / sheet appeared to be cropped #32

Nialixus opened this issue Feb 29, 2024 · 1 comment
Labels
help wanted Extra attention is needed improvement

Comments

@Nialixus
Copy link

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!

@mhmzdev mhmzdev added help wanted Extra attention is needed improvement labels Sep 6, 2024
@mhmzdev
Copy link
Owner

mhmzdev commented Sep 6, 2024

@Nialixus thank you for raising this, I've added related labels and will look into it myself too. Will try my best to fix it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed improvement
Projects
None yet
Development

No branches or pull requests

2 participants