skip to Main Content

enter image description here

I can’t add border radius to linear progress indicator item. when trying add borderRadius as a parameter, it shows as error?

Full snippet

error
enter image description here

How to fix this issue? Your help highly appreciated

2

Answers


  1. Remove Const Keyword before Linear Progress Indicator.
    Because BorderRadius.circular invokes dynamic computation for painting border radius hence keyword const is making conflict there.

    LinearProgressIndicator(borderRadius: BorderRadius.circular(7))
    

    OR below will do the same

     const LinearProgressIndicator(
                            valueColor: AlwaysStoppedAnimation(Colors.green),
                            borderRadius: BorderRadius.all(Radius.circular(7)))
    

    If still the error persist try restarting dart analysis server by pressing refresh button at top left corner in android studio

    enter image description here

    Login or Signup to reply.
  2. LinearProgressIndicator(
                  borderRadius: BorderRadius.circular(10),
                  value: controller.value,
                  semanticsLabel: 'Linear progress indicator',
                ),
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search