我想在加载过程中使用我的应用程序图标。如何实施。目前我正在使用循环进度指示器。
return Center(
child: CircularProgressIndicator(
strokeWidth: 2));
Run Code Online (Sandbox Code Playgroud)
小智 7
如果您想要的只是简单的进度指示器,您可以使用这个
class ProgressWithIcon extends StatelessWidget {
const ProgressWithIcon({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return SizedBox(
width: 50,
height: 50,
child: Stack(
alignment: Alignment.center,
children: [
Image.network(
// you can replace this with Image.asset
'https://avatars.githubusercontent.com/u/1393171?s=50&v=4',
fit: BoxFit.cover,
height: 30,
width: 30,
),
// you can replace
const CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(Colors.orange),
strokeWidth: 0.7,
),
],
),
);
}
}
Run Code Online (Sandbox Code Playgroud)
但如果您正在寻找复杂的东西,我建议您选择
| 归档时间: |
|
| 查看次数: |
3895 次 |
| 最近记录: |