I would like to show appBar when scrolling, like video below
This is what I have now, but appBar not showing when scroll
Here the code
@override
Widget build(BuildContext context) {
return Scaffold(
bottomNavigationBar: _showButton(),
backgroundColor: Colors.grey.shade200,
extendBodyBehindAppBar: true,
// appBar: AppBar(backgroundColor: Colors.transparent, elevation: 0),
body: CustomScrollView(slivers: [
SliverAppBar(expandedHeight: MediaQuery.of(context).size.width,
flexibleSpace: FlexibleSpaceBar(
title: Text("This is sample"),
background: _showPropertyUnitImage(),
),),SliverList(delegate: SliverChildListDelegate([
_showWidget(context)
]))
],)
);
}
Can some assist me to the right direction? Thanks
3
Answers
Using
DefaultTabController
I think
SliverAppBar
can help you in this case.https://api.flutter.dev/flutter/material/SliverAppBar-class.html
Code:
Video demo