flutter_easyloading icon indicating copy to clipboard operation
flutter_easyloading copied to clipboard

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

Open princestha opened this issue 4 years ago • 10 comments

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

princestha avatar Oct 05 '21 16:10 princestha

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

github-actions[bot] avatar Oct 05 '21 16:10 github-actions[bot]

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;

BBarisKilic avatar Oct 12 '21 13:10 BBarisKilic

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

KannadukiAoi avatar Feb 23 '22 12:02 KannadukiAoi

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

rmahmadkhan avatar Oct 12 '22 06:10 rmahmadkhan

Please attach your code snippet at here

vaidarbhi01 avatar Oct 12 '22 09:10 vaidarbhi01

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

rmahmadkhan avatar Oct 12 '22 11:10 rmahmadkhan

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 !

vaidarbhi01 avatar Oct 12 '22 13:10 vaidarbhi01

Yeah, it worked also had to add

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

because they can't be null when loadingStyle is custom

rmahmadkhan avatar Oct 12 '22 20:10 rmahmadkhan

是的,它有效还必须添加

    ..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;

applebest avatar Nov 29 '23 10:11 applebest