Home > Software design >  'LinearStrokeCap' is deprecated and shouldn't be used. This property is no longer use
'LinearStrokeCap' is deprecated and shouldn't be used. This property is no longer use

Time:02-04

I am creating Linear Percent Indicator. I want to achieve rounded borders around it.

Expected Result Vs. Actual Result

enter image description here

My Code

LinearPercentIndicator(
            linearStrokeCap: LinearStrokeCap.roundAll,
            progressColor: Colors.blue[400],
            backgroundColor: Colors.grey[300],
 ),

Error

enter image description here

Any Solution

Any solution to use barRadius as LinearStrokeCap?

CodePudding user response:

Use barRadius instead of linearStrokeCap. as LinearStrokeCap is deprecated they are suggesting to use barRadius.

Updated code :

LinearPercentIndicator(
  lineHeight: 30,
  percent: 0.7,
  barRadius: const Radius.circular(16),
  progressColor: Colors.blue[400],
  backgroundColor: Colors.grey[300],
),

Output:

enter image description here

  •  Tags:  
  • Related