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
Issue with snackBarTheme #7
Comments
The snackbar is currently using GetX snackbars. When I worked on the theme part of the code I was using regular flutter snackbars. I just hard coded the GetX ones with some default colors because I added GetX into my package at a later time. You could probable just edit the code and use the snackbar theme colors for GetX snackbars. |
Hmmm... ok but do you know why changing the SnarBarTheme colors doesn't change the appearance of the GetX snackbars ? |
Because SnackBarTheme is for regular flutter snackbars. GetX uses their own implementations of snackbars. This has some positives like not having to pass context into snackbars when you want to call them so you can better separate your code from your UI. However there are a few negatives like not being able to call the SnackBarTheme colors. Now you could probably rewrite my functions to pass in the context and use something like: Theme.of(context).backgroundColor or you could just hardcode whatever color you want them to be. I took the easy way and just hardcoded them. |
Thanks I got it, but I find a bit weird it couldn't call the SnackBarTheme. |
Thanks for the info... I will update my starter. I didn't know GetX had a way to call theme properties. Thanks for letting me know about it! |
It is fixed now! Thanks @sloosh ! |
Hi,
Changing the snackBarTheme in the themes as no effect... for example it is impossible for me to change color from text or background.
Seems you got the same issue since you have hard coded SnackBar color in your controller code.
Do you know why it doesn't work ?
Thanks
The text was updated successfully, but these errors were encountered: