Flutter-如何在步骤进度中添加圆形边界

我想创建一个如下所示的进度条

step progress bar

但我只能找到没有此选项的软件包,有人知道软件包或以任何方式执行此操作吗?

您可以找到的最接近的是使用此lib: step_progress_indicator 0.2.1 + 4

my step progress bar

           padding: const EdgeInsets.all(16),
           child: StepProgressIndicator(
             size: 8,
             totalSteps: 8,
             currentStep: 3,
             selectedColor: Colors.black,
             unselectedColor: Colors.grey,
             padding: 0.8,
           ),
         ),
评论
命*
命*

I don't know the behavior of this plugin, but maybe wrapping it in a ClipRRect widget can help you:

ClipRRect(
  borderRadius: BorderRadius.circular(16.0), // Change this like you want
  clipBehavior: Clip.antiAlias,
  child: StepProgressIndicator(
    size: 8,
    totalSteps: 8,
    currentStep: 3,
    selectedColor: Colors.black,
    unselectedColor: Colors.grey,
    padding: 0.8,
  ), 
),

希望这会有所帮助!

点赞
评论