Want to move the actions along with title in flexibleSpace in SliverAppBar in Flutter? Use the below example code to move the actions along with title in flexibleSpace in SliverAppBar.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Color.fromRGBO(58, 66, 86, 1.0), body: CustomScrollView( slivers: <Widget>[ SliverAppBar( floating: false, pinned: true, expandedHeight: 150.0, backgroundColor: Color.fromRGBO(58, 66, 86, 1.0), flexibleSpace: Row( crossAxisAlignment: CrossAxisAlignment.end, children: <Widget>[ Container( width: 200, child: FlexibleSpaceBar(title: Text("User Status")), ), Spacer(), IconButton( icon: Icon(Icons.refresh), onPressed: () {}, ), IconButton( icon: Icon(Icons.search), onPressed: () {}, ) ], ), ), SliverList( delegate: SliverChildBuilderDelegate((_, i) { return ListTile(title: Text("Item ${i}")); }, childCount: 20), ), ], ), ); } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.