[英]Flutter Circular progress indicator not working properly on android
I'm building an app with flutter, and I have some issue with loadings on android: I have several futureBuilder, with CircularProgressIndicator()
and, while on IOS they all work properly, on android I got a single dot showed instead of the loading象征。
这是示例代码,下面是 IOS 和 android 的两个屏幕。
FutureBuilder(
future: myFuture,
builder: (BuildContext context, AsyncSnapshot<VtsAccount> snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return Center(child: CircularProgressIndicator());
} else {
if (snapshot.hasError)
return Center(child: Text('Error');
else {
return RichText(
textAlign: TextAlign.center,
text: TextSpan(
text: snapshot.data.myField()),
);
}
}
});
预先感谢您的帮助。
我使用以下代码在 CircularProgressIndicator 上获得了相同的“点效应”:
return Container( width:1,height: 1,child:Center(child:CircularProgressIndicator()));
我确定问题是您没有为 CircularProgressIndicator 小部件的父小部件提供足够的空间
(我不知道为什么在 IOS 中行为不同)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.