问题描述
我正在尝试实现一个简单的Stack,但是对于为什么在将整数压入堆栈时会得到一个无限列表感到困惑。
所有其他功能都按预期运行,但我不了解 @override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Weather App',theme: ThemeData(
primarySwatch: Colors.blue,),home: Scaffold(
backgroundColor: Colors.tealAccent,appBar: AppBar(
title: Text('Flutter Weather App'),body: Container(
height: 501.7,width: 420.0,decoration: BoxDecoration(
image: DecorationImage(
image: isweatherDataLoaded //this
? HandleError()
: images["clear"],fit: BoxFit.fill,shape: BoxShape.rectangle,child: Center(
child: Column(children: <Widget>[
//WEATHER DATA
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),child: weatherData != null
? Weather(weather: weatherData)
: Container(),Padding(
padding: const EdgeInsets.all(8.0),child: isLoading
? CircularProgressIndicator(
strokeWidth: 2.0,valueColor:
new AlwaysStoppedAnimation(Colors.black),)
: IconButton(
icon: new Icon(Icons.refresh),tooltip: 'Refresh',onPressed: () async {
await loadWeather();
},color: Colors.black,],//FUTURE FORECAST WEATHER DATA
SafeArea(
child: Padding(
padding: const EdgeInsets.all(8.0),child: Container(
height: 200.0,child: forecastData != null
? ListView.builder(
itemCount: forecastData.list.length,scrollDirection: Axis.horizontal,itemBuilder: (context,index) => WeatherItem(
weather: forecastData.list.elementAt(index)))
: Container(),)
])),)),);
}
的问题。当我尝试为其分配一个已推送如下变量的空堆栈时,它出错了:
push
λ > a = makeStack
λ > push 3 a
[3]
λ > a
[]
λ > a = push 3 a
λ > a
[3,3,3^CInterrupted.
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)