Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change background color of Stepper widget to transparent color?

Tags:

flutter

Stepper widget's background color is transparent at the Vertical type. When change type like StepperType.horizontal, stepper has white-grey background color. How could I change that background color at the horizontal axis?

Here is my sample code:

Container(
   width: _width,
   child: Stepper(
      type: StepperType.horizontal,
      steps: [
        Step(
          title: Text("First"),
          content: Text("This is our first example."),
        ),
        Step(
          title: Text("Second"),
          content: Text("This is our second example."),
        ),
      ],
    ),
  ),
like image 765
Can Karabag Avatar asked Sep 06 '25 16:09

Can Karabag


1 Answers

To change the background color of stepper widget wrap it into Theme and give it a color in Canvas color.

Container(
        width: _width,
        child: Theme(
          data: ThemeData(canvasColor: Colors.lightBlue),
          child: Stepper(
            type: StepperType.horizontal,
            steps: [
              Step(
                title: Text("First"),
                content: Text("This is our first example."),
              ),
              Step(
                title: Text("Second"),
                content: Text("This is our second example."),
              ),
            ],
          ),
        ),
      ),
like image 118
Fatima Hossny Avatar answered Sep 10 '25 16:09

Fatima Hossny