Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Dart 检查行';的子项已初始化_Dart_Flutter - Fatal编程技术网

Dart 检查行';的子项已初始化

Dart 检查行';的子项已初始化,dart,flutter,Dart,Flutter,在我的颤振应用程序中,我多次出现以下代码: <Widget>[ _isForecastLoaded ? new Center( child: new ForecastView(forecastDayDTOs: _forecast.forecast) ) : new Center(), ... ] [ _船艏楼有货吗 ?新中心( 子级:新建ForecastView(forecastDayDTOs:_forecast.forecast) ) :新

在我的颤振应用程序中,我多次出现以下代码:

<Widget>[
  _isForecastLoaded
    ? new Center(
      child: new ForecastView(forecastDayDTOs: _forecast.forecast)
    )
    : new Center(),
...
]
[
_船艏楼有货吗
?新中心(
子级:新建ForecastView(forecastDayDTOs:_forecast.forecast)
)
:新中心(),
...
]
这基本上是一个空检查。如果没有它,我会有一个例外,即行不能有空的子行。 我认为这是错误的,但不确定用什么样的方式来处理它

新建ForecastView(forecastDayDTOs:\u forecast.forecast)
<Widget>[
   new Center(
      child: new ForecastView(forecastDayDTOs: _forecast.forecast) 
    )

...
]