在此记录项目中所遇到问题及解决方案
自定义加载对话框源码
import 'package:flutter/material.dart';
class LoadingDialog extends Dialog {
@override
Widget build(BuildContext context) {
return new Material(
type: MaterialType.transparency,
child: new Center(
child: new SizedBox(
width: 100.0,
height: 100.0,
child: new Container(
decoration: ShapeDecoration(
color: Color(0xffffffff),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(8.0),
),
),
),
child: new Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
new CircularProgressIndicator(),
],
),
),
),
),
);
}
}
调用
showDialog(context: context,
builder: (BuildContext context){
return LoadingDialog();
});