首页 > 解决方案 > SpinKitChasingDots 小部件断言 Flutter 错误 !(itemBuilder is IndexedWidgetBuilder && color is Color) && !(itemBuilder == null && color == null)'

问题描述

在最新的颤振升级之后。当我离开应用程序以转到主屏幕并返回时发生。此错误仅在红屏中出现几秒钟,然后恢复正常。

您应该指定 itemBuilder 或颜色 'package:flutter_spinkit/src/chasing_dots.dart': 断言失败: line 10 pos 16: '!(itemBuilder is IndexedWidgetBuilder && color is Color) && !(itemBuilder == null && color = =空)'

我在我的代码中看不到任何可能导致它的东西。颜色已指定。

class Loading extends StatelessWidget {


  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.brown,
      child: Center(
        child: SpinKitChasingDots(
          color: Colors.white,
          size: 50.0,
        )
      ),
    );

  }
}

只出现在模拟器上而不出现在手机上。一定是绘画的东西。

标签: flutter

解决方案


推荐阅读