Last active
February 5, 2020 07:03
-
-
Save kitoko552/d9a899670fc76287ec135a082940754e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DefaultTabController( | |
length: _tabs.length, // This is the number of tabs. | |
child: NestedScrollView( | |
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { | |
return <Widget>[ | |
SliverOverlapAbsorber( | |
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context), | |
child: SliverAppBar( | |
title: const Text('Books'), // This is the title in the app bar. | |
pinned: true, | |
expandedHeight: 150.0, | |
forceElevated: innerBoxIsScrolled, | |
bottom: TabBar( | |
tabs: _tabs.map((String name) => Tab(text: name)).toList(), | |
), | |
), | |
), | |
]; | |
}, | |
body: TabBarView( | |
children: _tabs.map((String name) { | |
return SafeArea( | |
top: false, | |
bottom: false, | |
child: Builder( | |
builder: (BuildContext context) { | |
return CustomScrollView( | |
key: PageStorageKey<String>(name), | |
slivers: <Widget>[ | |
SliverOverlapInjector( | |
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context), | |
), | |
SliverPadding( | |
padding: const EdgeInsets.all(8.0), | |
sliver: SliverFixedExtentList( | |
itemExtent: 48.0, | |
delegate: SliverChildBuilderDelegate( | |
(BuildContext context, int index) { | |
return ListTile( | |
title: Text('Item $index'), | |
); | |
}, | |
childCount: 30, | |
), | |
), | |
), | |
], | |
); | |
}, | |
), | |
); | |
}).toList(), | |
), | |
), | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment