skip to Main Content

I’ve been using Flutter for a couple of days and I implemented get API but my concern is when I scroll down the AppBar color changes to another color.How my AppBar looks like when I scroll

In my AppBar, I have just title and actions.

I want the AppBar doesn’t change it’s color.
Thanks in advance for your guidance.

2

Answers


  1. You can add your appBar color in this appBar property.

    AppBar(
       // add your appBar color.
      surfaceTintColor: Colors.white, 
      backgroundColor: Colors.white,
      foregroundColor: foregroundColor,
      shadowColor: shadowColor,
     ),
    
    Login or Signup to reply.
  2. The Golden attribute that causes that problem is scrollUnderElevation ,set it to 0:

    AppBar(
    scrollUnderElevation: 0,
     )
    

    The problem has no correlation with the color of the AppBar.

    Hope it helps you.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search