我想在加載程序中使用我的應用程式圖示。如何實施。目前我正在使用回圈進度指示器。
return Center(
child: CircularProgressIndicator(
strokeWidth: 2));
uj5u.com熱心網友回復:
如果你想要的只是簡單的進度指示器,你可以使用它
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,
),
],
),
);
}
}

但如果你正在尋找復雜的東西,我會建議你去
- 里沃 包
- 樂天 禮包
uj5u.com熱心網友回復:
有多種實作自定義加載器的方法。如果您的 loader 是影片的,那么知道您的 loader 的擴展格式。根據我使用像https://lottiefiles.com/這樣的 json 影片加載器的經驗,正在使用一個名為 lottie 的包
dependencies: lottie: ^1.2.1
如果您的加載器是普通影像,那么您可以選擇在采取行動之前使用計時器來顯示影像例如等待來自互聯網的一些資料。
如果您需要更多幫助,請告訴我
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/340062.html
