简体   繁体   English

FLUTTER | 自定义循环进度指示器

[英]FLUTTER | Custom Circular Progress Indicator

How can I make a custom circular progress indicator like the ones in the below image in Flutter? 如何在Flutter中创建自定义循环进度指示器,如下图所示? The out of box one does not allow adding text in the center. 开箱即用不允许在中心添加文本。

Screenshot of Example Example的截图

I think you have two ways. 我想你有两种方法。

first put CircularProgressIndicator and Text widgets into Stack and place them as you want( Text in the center and CircularProgressIndicator cover all stack space). 首先将CircularProgressIndicatorText小部件放入Stack并根据需要放置它们(中间的TextCircularProgressIndicator覆盖所有堆栈空间)。 Stack widget is key point here for you to understand... Stack小部件是这里的关键点,让您了解...

the second way and more flexible way is to this action with CustomPaint Widget. 第二种方式和更灵活的方式是使用CustomPaint Widget进行此操作。 this link will help you to achieve the goal... https://medium.com/@NPKompleet/creating-an-analog-clock-in-flutter-i-68def107d9f4 此链接将帮助您实现目标... https://medium.com/@NPKompleet/creating-an-analog-clock-in-flutter-i-68def107d9f4

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM