Using Material3 useMaterial3: true
in Flutter version 3.0.1, when scrolling lets say listview, the appbar changes to darker color... Can this be disabled?
Example from native android Material3 MaterialToolbar disable coloring at scroll:
Using Material3 useMaterial3: true
in Flutter version 3.0.1, when scrolling lets say listview, the appbar changes to darker color... Can this be disabled?
Example from native android Material3 MaterialToolbar disable coloring at scroll:
I had same problem.
In my case i had an AppBar
with transparent background and a Scaffold
with extendBodyBehindAppBar
set to true
.
I tried with shadowColor
and surfaceTintColor
with Colors.transparent
value, but the shadow was still visible.
Then I noticed the scrolledUnderElevation
property of AppBar. Setting it to 0.0 was the solution.
I think you can just set the surfaceTintColor
property of AppBar
:
surfaceTintColor: Colors.transparent
I was facing this same issue and solved it right after looking at your question.
I think this is the best solution mostly with the material3 flutter
scrolledUnderElevation: 0,
to disable it completely just make sure it is 0 incase you just want to reduce the opacity just increase the value i.e 0.6
just add below property to AppBar :
forceMaterialTransparency: true,
problem will solved.
It works for me:
surfaceTintColor: Colors.transparent; // add required color
Either add in the appBar
or otherwise in the ThemeData
.