nslogx / flutter_easyloading

✨A clean and lightweight loading/toast widget for Flutter, easy to use without context, support iOS、Android and Web
https://pub.dev/packages/flutter_easyloading
MIT License
1.25k stars 219 forks source link

How can i remove the background color. I would like the background to be transparent #135

Open princestha opened 2 years ago

princestha commented 2 years ago

EasyLoading.instance ..displayDuration = const Duration(milliseconds: 2000) ..loadingStyle = EasyLoadingStyle.custom ..indicatorSize = 60 ..textColor = Colors.black ..radius = 20 ..backgroundColor = Colors.transparent ..maskColor = Colors.white ..indicatorColor = Colors.black ..userInteractions = false ..dismissOnTap = false ..indicatorType = EasyLoadingIndicatorType.cubeGrid; The above is not working for me

github-actions[bot] commented 2 years ago

Thanks for taking the time to open an issue. I will have a look and answer as soon as possible.

BBarisKilic commented 2 years ago

Please add ..boxShadow = <BoxShadow>[] to your code.

Final code: EasyLoading.instance ..displayDuration = const Duration(milliseconds: 2000) ..loadingStyle = EasyLoadingStyle.custom ..indicatorSize = 60 ..textColor = Colors.black ..radius = 20 ..backgroundColor = Colors.transparent ..maskColor = Colors.white ..indicatorColor = Colors.black54 ..userInteractions = false ..dismissOnTap = false ..boxShadow = <BoxShadow>[] ..indicatorType = EasyLoadingIndicatorType.cubeGrid;

KannadukiAoi commented 2 years ago

@BBarisKilic Thank you very much! I just have same question now. Add a BoxShadow perfect working !

rmahmadkhan commented 1 year ago

Didn't work for me. I'm trying to use custom widget for loading but it is still showing black background wrapping my widget.

idamsel commented 1 year ago

Please attach your code snippet at here

rmahmadkhan commented 1 year ago

My code:

/// EasyLoading styling
  EasyLoading.instance
    ..displayDuration = const Duration(milliseconds: 2500)
    ..radius = 10
    ..textStyle = const TextStyle(
      color: AppTheme.whiteColor,
      fontSize: 18,
      letterSpacing: 0.5,
      fontWeight: FontWeight.w400,
    )
    ..maskColor = Colors.transparent
    ..backgroundColor = Colors.transparent
    ..maskType = EasyLoadingMaskType.custom
    ..indicatorWidget = Image.asset(kGifLoading, height: 80, width: 80)
    ..boxShadow = [];

What I'm getting in ui:

What I need? I need to remove that black background around my blue image

idamsel commented 1 year ago

You forgot to add ..loadingStyle = EasyLoadingStyle.custom line. Your code must be start with as below EasyLoading.instance ..displayDuration = const Duration(milliseconds: 2500) ..loadingStyle = EasyLoadingStyle.custom // Add this line in your code ..radius = 10 your rest of code

Let me know if you still face any issue !
rmahmadkhan commented 1 year ago

Yeah, it worked also had to add

    ..textColor = Colors.white
    ..indicatorColor = Colors.transparent

because they can't be null when loadingStyle is custom

applebest commented 10 months ago

是的,它有效还必须添加

    ..textColor = Colors.white
    ..indicatorColor = Colors.transparent

因为当loadingStyle是自定义的时候它们不能为空

👍🏻 Thanks for the solution, attached the code so more people can see it

    EasyLoading.instance
      ..displayDuration = const Duration(milliseconds: 2500)
      ..loadingStyle = EasyLoadingStyle.custom 
      ..radius = 10.0
      ..textColor = Colors.white
      ..indicatorColor = Colors.transparent
      ..maskColor = Colors.transparent
      ..backgroundColor = Colors.transparent
      ..boxShadow = []
      ..userInteractions = true
      ..dismissOnTap = false;
lozyHao commented 6 months ago

image 1、为啥加上 loadingStyle = EasyLoadingStyle.custom之后,toast直接显示不出来 2、backgroundColor = backgroundColor,自定义背景色不起作用