// Using ValueNotifier to update whenever the value of the progress changed
final ValueNotifier<double?> completionValue = ValueNotifier(null);
// Call this function on where you are updating the progress value
void _updateProgressUI({
required int totalFiles,
required int totalSuccess,
}) {
//Update completionValue value
completionValue.value = totalSuccess / totalFiles;
}
// Use this widget on you screen to show the progress indicator
Container(
padding: EdgeInsets.symmetric(horizontal: ,),
child: ValueListenableBuilder<double?>(
valueListenable: completionValue,
builder: (_, completionValue, __) {
return CircularPercentIndicator(
lineHeight: 16,
progressColor: your_color,
backgroundColor: your_color,
percent: completionValue ?? 0,
animationDuration: 1000,
animateFromLastPercent: true,
animation: true,
linearStrokeCap: LinearStrokeCap.roundAll,
);
},
),
)
3条答案
按热度按时间wa7juj8i1#
您可以使用Percent Indicator包来实现基于您的内容的动态加载器。
例如:
试着把圆形的指示器包裹在你的图像之外。
xlpyo6sf2#
你可以试试syncfusion_flutter_gauges软件包。
例如:https://flutter.syncfusion.com/#/radial-gauge/pointers/range-pointer
https://flutter.syncfusion.com/#/radial-gauge/pointer-animation/ease
tf7tbtn23#
步骤1:创建对话框
第二步:打电话
步骤3:关闭对话框