flutter Material-信息显示
  sX9JkgY3DY86 2023年11月13日 27 0

CircularProgressIndicator

循环进度

圆形

Center(
child: Column(
children: <Widget>[
RaisedButton(
child: Text("aa"),
onPressed: () {},
),
CircularProgressIndicator()
],
),
)

flutter Material-信息显示_Text

更换颜色

CircularProgressIndicator(
  valueColor: new AlwaysStoppedAnimation<Color>(Colors.green),
),

flutter Material-信息显示_Text_02

 

独立页面

loading(BuildContext context) {
showDialog<Null>(
context: context, //BuildContext对象
barrierDismissible: false,
builder: (BuildContext context) {
return LoadingDialog(
//调用对话框
text: '正在加载请稍后...',
);
});
}

class LoadingDialog extends Dialog {
final String text;

LoadingDialog({Key key, @required this.text}) : super(key: key);

@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () => Future.value(false), //禁止返回
child: Material(
//创建透明层
type: MaterialType.transparency, //透明类型
child: Center(
//保证控件居中效果
child: SizedBox(
width: 200.0,
height: 200.0,
child: Container(
// decoration: ShapeDecoration(
// color: Color(0xffffffff),
// // color: Color(0xffffffff),
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.all(
// Radius.circular(8.0),
// ),
// ),
// ),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(Colors.grey),
),
Padding(
padding: const EdgeInsets.only(
top: 20.0,
),
child: Text(
text,
style: TextStyle(fontSize: 16.0, color: Colors.white),
),
),
],
),
),
),
),
));
}
}

 

flutter Material-信息显示_sed_03

 

 

 

 

直线

LinearProgressIndicator()

flutter Material-信息显示_Text_04

 



【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月13日 0

暂无评论

推荐阅读
  sX9JkgY3DY86   2023年11月13日   29   0   0 idesedImage
  sX9JkgY3DY86   2023年11月13日   13   0   0 分割线ideText
  sX9JkgY3DY86   2023年11月13日   25   0   0 ci控件Text
  sX9JkgY3DY86   2023年11月13日   19   0   0 Textsed
sX9JkgY3DY86