Stack has 3 child properties, first child (red background) is partially visible because last child (black background) is on top. I need the last child to be directly below the other two and it should not overlap as it is doing now. Last child contains dynamic text - more than one line of text causes the text block to shift up instead of down - trying adding a few lines to the last child.
return new Scaffold(
body: NestedScrollView(
controller:_scrollController ,
headerSliverBuilder:
(BuildContext contrxt, bool innerBoxIsScrolled) {
print('scrolled $innerBoxIsScrolled');
return <Widget>[
SliverAppBar(
backgroundColor: Colors.transparent,
automaticallyImplyLeading: false,
expandedHeight: 195.0,
pinned: true,
floating: true,
forceElevated: innerBoxIsScrolled,
flexibleSpace: FlexibleSpaceBar(
background: new Stack(children: <Widget>[
Positioned(
right: 0.0,
left: 0,
bottom: -1,
child: Container(
color: Colors.redAccent,
height: 50.0,
child: Text("Container 1 Text", textAlign: TextAlign.center,),
),
),
Container(
color: Colors.blue,
height: MediaQuery.of(context).size.height / 6,
width: MediaQuery.of(context).size.width,
child: Text("Container 2 Text", textAlign: TextAlign.center,),
),
Positioned(
bottom: 0,
left: 0,
right: 0,
child: Container(
//margin: EdgeInsets.only(top: 49.0),
color: Colors.black,
//height: 20.0,
width: MediaQuery.of(context).size.width,
//padding: EdgeInsets.only(top: 5.0, left: 20.0, bottom: 5.0, right: 20.0),
child: Padding(
padding: const EdgeInsets.all(10.0),
child: new Text("Container 3",
style: TextStyle(fontSize: 12.0, color: Colors.grey[800]),
),
),
),
)
]),
),
),
];
},
body: Container(),