Closed sloosh closed 4 years ago
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 ? Thanks.
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. I simply used Get.theme.snackBarTheme to retrieve the corresponding properties...
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