I want to give border Color to Linear percent indicator in Flutter

Viewed 25

I've tried to give border to linear progress indication by using container but it is not working for me.. Here is the Code.

Container(
  width: Get.width*0.8,
  decoration: BoxDecoration(
    border: Border.all(
      color: Colors.black
    ),
  ),
  child: LinearPercentIndicator(
    // width: Get.width*0.8,
    lineHeight:Get.height*0.04,
    percent: percent/100,
    backgroundColor: Colors.grey,
    progressColor: AppColors.orangeTextColor,
    center: Text(
      percent.toString() + "%",
      style: TextStyle(
        fontSize: 12.0,
        fontWeight: FontWeight.w600,
        color: Colors.black
      ),
    ),
  ),
),

And here is the output:

enter image description here

1 Answers

LinearPercentIndicator comes with a default padding of EdgeInsets.symmetric(horizontal: 10.0). Changing it to zero like this will fix it:

LinearPercentIndicator(
        padding: EdgeInsets.zero,
Related