简体   繁体   中英

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

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:

在此处输入图像描述

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,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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