I\'m using a transparent AppBar and I would like to display body behind the transparent AppBar and not bellow. How to do that ?
After some time I do not know if this will help anyone but...there it goes..
Problem: I wanted to have gradient background on the body of my Scaffold
, and in Android the AppBar
was messing things up.
My solution:
Scaffold(
extendBodyBehindAppBar: true,
appBar: AppBar(
backgroundColor: Colors.transparent,
elevation: 0,
title: Text("AppBar text"),
),
body: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
HexColor.hexToColor("D76984"),
HexColor.hexToColor("2369C0")
]),
),
)
);
Other solutions using Stack
also might work but then the entire design of this screen is forced to use Stack which for me is less responsive than using other widgets...but that is just me.