我是新手,他想知道什么是更好的方式来添加CircularProgressIndicator我的布局.例如,我的登录视图.此视图具有用户名,密码和登录按钮.我确实想要创建一个叠加布局(带Opacity),在加载时,显示我在NativeScript中使用的进度指示器,但我对如何操作感到困惑,如果这是更好的方法.例如,在NativeScript中,我在主布局中添加IndicatorActivity并将busy设置为true或false,因此它在加载时覆盖所有视图组件.
编辑:
我能够达到这个结果:
void main() {
runApp(new MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
primarySwatch: Colors.blue,
),
home: new MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => new _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> { …Run Code Online (Sandbox Code Playgroud)