ponnamkarthik / FlutterToast

Toast Plugin for Flutter
MIT License
1.45k stars 364 forks source link

Flutter toast background color #340

Closed Pandi17 closed 2 years ago

Pandi17 commented 3 years ago

Flutter toast background colour is not working in android 11 but working in android 10 my flutter sdk 2.2.3, please fix as soon as possible

fluttertoast: ^8.0.8

Pandi17 commented 3 years ago

Sorry, accidently closed this issue, issue still remains

RTRenjith commented 3 years ago

same issue for me too, any update?

Pandi17 commented 3 years ago

same issue for me too, any update?

Not yet bro

yaochangliang159 commented 3 years ago

the same to me

shadabunique commented 3 years ago

@Pandi17 Trying to reproduce on Android 11 but it works for me. I tried -

   Fluttertoast.showToast(
    msg: "Toast with red background",
    toastLength: Toast.LENGTH_SHORT,
    backgroundColor: Colors.red,
    textColor: Colors.white);

And I can see a toast with red background and white text. Can you post the code you are trying on your end?

RTRenjith commented 3 years ago

I'm using pixel 3a API 30 x86 Android emulator

Fluttertoast.showToast(
                        msg: "Logged out!",
                        toastLength: Toast.LENGTH_LONG,
                        gravity: ToastGravity.SNACKBAR,
                        backgroundColor: Colors.red,
                        textColor: Colors.white,
                        fontSize: 16.0
                    );

doesn't work :( Screenshot_1633318438 (

Pandi17 commented 3 years ago

@Pandi17 Trying to reproduce on Android 11 but it works for me. I tried -

   Fluttertoast.showToast(
    msg: "Toast with red background",
    toastLength: Toast.LENGTH_SHORT,
    backgroundColor: Colors.red,
    textColor: Colors.white);

And I can see a toast with red background and white text. Can you post the code you are trying on your end?

Same code only I'm using, but not working in android 11 but working in android 10, both in emulator and in real device

dvird commented 3 years ago

?

iamthejahid commented 3 years ago

Same problem, My Code scenario -

class ToastMessage {
  static void error(String message) {
    Fluttertoast.showToast(
      msg: message,
      toastLength: Toast.LENGTH_SHORT,
      gravity: ToastGravity.BOTTOM,
      timeInSecForIosWeb: 1,
      backgroundColor: Colors.red,
      textColor: Colors.white,
      fontSize: 16.0,
    );
  }

  static void success(String message) {
    Fluttertoast.showToast(
      msg: message,
      toastLength: Toast.LENGTH_SHORT,
      gravity: ToastGravity.BOTTOM,
      timeInSecForIosWeb: 1,
      backgroundColor: Colors.green,
      textColor: Colors.white,
      fontSize: 16.0,
    );
  }
}

Red Color and green color are not working in my case!

DavideM12 commented 2 years ago

Same issue for me. Background color doesn't work on Android 11

DavideM12 commented 2 years ago

I downloaded the whole repository with the last commit of C4st3ll4n and now it works! The author of this packages should publish the new version on pub.dev

mikekosulin commented 2 years ago

Same issue on Pixel 3, Android 12.

rodevasia commented 2 years ago

if you're using a Color(<your_color>) which does not seems to work me, you have to create a color_swatch with MaterialColor and also the Colors.<color> is defined with MeterialColor

alarmatwork commented 2 years ago

Android 12 will show their colour (probably matches with dark background color of OS) and also app icon Screenshot_20220128-152724 n

himanshupapreja commented 1 year ago

Android 12 will show their colour (probably matches with dark background color of OS) and also app icon Screenshot_20220128-152724 n

I am facing the same problem. getting icon and black background but my color is not displaying. Please help me How to set background color in android 12 or upper?