Last active
February 5, 2020 07:03
-
-
Save kitoko552/f6b849d9fa8f8b9f79af4fdaf90aca2d 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
Scaffold( | |
appBar: AppBar(title: const Text('Books'), elevation: 0.0), | |
body: DefaultTabController( | |
length: _tabs.length, | |
child: NestedScrollView( | |
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { | |
return <Widget>[ | |
// TabBarを追加 | |
SliverPersistentHeader( | |
pinned: true, | |
delegate: _StickyTabBarDelegate( | |
TabBar( | |
tabs: _tabs.map((String name) => Tab(text: name)).toList(), | |
), | |
), | |
), | |
]; | |
}, | |
body: TabBarView(), | |
), | |
), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment