【问题标题】:Set background color to transparent but doesn't work. Use EasyLoading package将背景颜色设置为透明但不起作用。使用 EasyLoading 包
【发布时间】:2022-01-10 02:46:14
【问题描述】:

当我在EasyLoading 中将背景颜色设置为透明时,它不会显示透明效果,而是显示黑色。 我试图在源代码中弄清楚,但一无所获。 我想知道是否有一种方法可以使背景颜色透明,以便它可以显示后面的所有内容。

更新 在这个问题中解决了: https://github.com/0xPool/flutter_easyloading/issues/135

void showLoading([String loadingText = 'Loading']) {
  EasyLoading.instance
    ..loadingStyle = EasyLoadingStyle.custom
    ..indicatorType = EasyLoadingIndicatorType.ring
    ..indicatorColor = Colors.transparent
    ..backgroundColor = Colors.transparent
    ..textColor = Colors.transparent
    ..textStyle =
        TextStyle(color: _loadingText, fontSize: 14.sp, fontWeight: FontWeight.bold, fontFamily: 'Helvetica')
    ..textPadding = EdgeInsets.zero
    ..indicatorWidget = Column(
      children: [
        _LoadingRing(
          color: _loadingRingGradient,
        ),
        addVerticalSpace(32)
      ],
    );

  EasyLoading.show(status: loadingText, maskType: EasyLoadingMaskType.none, dismissOnTap: true);
}

【问题讨论】:

  • 您是否查看了 GitHub 中 EasyLoading 的问题部分?如果这是一个常见问题,那么可能有一些东西可以帮助您。
  • 一开始我并没有想在问题部分找到解决方案。谢谢!!!

标签: flutter flutter-packages


【解决方案1】:

您只需在您的代码..boxShadow = <BoxShadow>[] 中添加BoxShadow。请在下面的链接中找到与此相关的问题。

EasyLoading GitHub Open Issue

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-03-03
    • 2011-02-11
    • 2011-04-14
    • 1970-01-01
    • 2014-01-24
    • 1970-01-01
    • 1970-01-01
    • 2017-06-02
    相关资源
    最近更新 更多