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

Displaying a Snackbar that is does not use the full width makes buttons on that height unclickable. #2995

Open
NeariX67 opened this issue Dec 23, 2023 · 0 comments
Assignees

Comments

@NeariX67
Copy link

Describe the bug
When using Get.showSnackbar and the width is smaller than the window (which results in transparent space beside it), you cannot click on buttons that are visible in that space left and right from the snackbar.

Reproduction code

Get.showSnackbar(
  const GetSnackBar(
    maxWidth: 200,
    snackPosition: SnackPosition.top,
    message: "Hello world",
  ),
);

Full example:

import 'package:flutter/material.dart';
import 'package:get/get.dart';

void main() => runApp(
      GetMaterialApp(
        debugShowCheckedModeBanner: false,
        home: Home(),
      ),
    );

class Home extends StatelessWidget {
  @override
  Widget build(context) => Scaffold(
        appBar: AppBar(
          title: Text("Snackbar example"),
          actions: [
            ElevatedButton(
              onPressed: () {
                print("I got clicked");
              },
              child: Text("Button"),
            ),
          ],
        ),
        body: Center(
          child: ElevatedButton(
            onPressed: () {
              Get.showSnackbar(
                const GetSnackBar(
                  maxWidth: 200,
                  snackPosition: SnackPosition.top,
                  message: "Hello world",
                ),
              );
            },
            child: Text("Show snackbar"),
          ),
        ),
      );
}

To Reproduce
Steps to reproduce the behavior:

  1. Click "Show snackbar"
  2. Try to click "Button" in the top right corner

Expected behavior
Button in the top right is clickable.

Screenshots
image

Flutter Version:
3.16.5

Getx Version:
4.6.6, as well as latest commit

Describe on which device you found the bug:
Windows, MacOS, iOS, Web, Android

talha828 added a commit to talha828/getx that referenced this issue Dec 30, 2023
… width makes buttons on that height unclickable - Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants