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

Background color does not fill the whole Toast (ver 2.1.0) #29

Closed
jkyeo opened this issue Nov 13, 2018 · 25 comments
Closed

Background color does not fill the whole Toast (ver 2.1.0) #29

jkyeo opened this issue Nov 13, 2018 · 25 comments
Labels
bug Something isn't working

Comments

@jkyeo
Copy link

jkyeo commented Nov 13, 2018

As shown below, Background color does not fill the whole Toast.
image


ENV:

Google Pixel 2 XL running Android 9
fluttertoast:
    dependency: "direct main"
    description:
      name: fluttertoast
      url: "https://pub.dartlang.org"
    source: hosted
    version: "2.1.0"
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.11.3, on Mac OS X 10.14.1 18B75, locale en-CN)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.2)
[✓] VS Code (version 1.28.2)
[✓] Connected device (3 available)

• No issues found!
@pankajnegii
Copy link

Same issue here...using android Oreo

@needou
Copy link

needou commented Nov 14, 2018

me too

1 similar comment
@Musasshi90
Copy link

me too

@pgfepale
Copy link

Same here.. Android.

@ponnamkarthik ponnamkarthik added bug Something isn't working duplicate This issue or pull request already exists and removed duplicate This issue or pull request already exists labels Nov 15, 2018
@love-bk
Copy link

love-bk commented Nov 16, 2018

I also have this problem.

@ponnamkarthik
Copy link
Owner

fixed in v2.1.1

@pankajnegii
Copy link

@ponnamkarthik 👍

@percy-g2
Copy link

Its still same on pixel 2 XL running dec pie update.

screenshot_20181218-013321

@j0j00
Copy link

j0j00 commented Dec 18, 2018

Hi @ponnamkarthik,

I think the issue is that the background drawable doesn't have the appropriate paddings.

Is there a reason this approach using setColorFilter isn't used instead? That seems a lot easier than messing around with RoundRectShape and ShapeDrawables.

@ponnamkarthik
Copy link
Owner

fixed in v2.2.0

@liuchuancong
Copy link

Yes, the problem still exists.please!

@percy-g2
Copy link

It works now but there is another outer background layer of gray color in Android device.

Screen

@j0j00
Copy link

j0j00 commented Dec 21, 2018

Which Android version (SDK) are you guys seeing the issue on?

And @ponnamkarthik, is there a reason the R.drawable.toast_bg is being used? I think that might be the issue.

@ponnamkarthik
Copy link
Owner

@percy-g2 @liuchuancong what device are you getting this error

@ponnamkarthik
Copy link
Owner

@percy-g2 @liuchuancong Please test with 2.2.2 and let me know

@percy-g2
Copy link

@ponnamkarthik i'm not getting any error, that's my string toast msg "Error". It's working fine now with v2.2.2 but there is a gray outer layout around toast msg as you can see in my last image attached.

@ponnamkarthik
Copy link
Owner

@percy-g2 what device and the Android version are you using

@percy-g2
Copy link

@ponnamkarthik Pixel 2XL and android pie

@loshine
Copy link

loshine commented Jan 24, 2019

Still have this problem in Android 9 use ver 2.2.7

_20190124145023

    Fluttertoast.instance.showToast(
      msg: _isAnonymous ? "关闭匿名" : "开启匿名",
      toastLength: Toast.LENGTH_SHORT,
      gravity: ToastGravity.CENTER,
      textColor: Colors.white,
      backgroundColor: Colors.red,
    );

@ponnamkarthik
Copy link
Owner

@loshine on what device are you testing

I have a custom rom with 9.0 and it works well :)

@loshine
Copy link

loshine commented Jan 25, 2019

@loshine on what device are you testing

I have a custom rom with 9.0 and it works well :)

Samsung Galaxy S9+ with oneUI

@loshine
Copy link

loshine commented Jan 28, 2019

@loshine on what device are you testing

I have a custom rom with 9.0 and it works well :)

use the below code to set toast background looked nice in my phone~

toast.getView().setBackground(shapeDrawable);

@dark-chocolate
Copy link

I'm using version: 2.2.11, background color doesn't seem to work in Android, on iOS it just works.

@nats-afs
Copy link

This work for me here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

14 participants