flutterdartstepper

How to change Stepper line color in Flutter?


I would like to customize my Stepper in my flutter App. I changed the color of the background number and the Stepper background with Theme(ThemeData), but i would like to change the color and the height of the little line between every steps.

How is it possible ? Is there a way to extends Stepper class, and change the Widget "Widget _buildHorizontal" ? I saw that's the only way to change line height & color. But how can i extends it ?

I tried all the possible color from ThemeData.

The result i have


Solution

  • Currently Flutter does not have a way to change the color of Stepper Line because the color of stepper line is static.

    image of source code

    You can create a custom stepper:

    https://nakib.medium.com/making-a-custom-number-stepper-in-flutter-e8bdde04b3f
    https://medium.com/fabcoding/create-an-icon-stepper-view-in-flutter-3fb53fe2e3bc



    or use a package like:
    easy_stepper,
    im_stepper,
    cupertino_stepper