Created
July 10, 2018 14:25
-
-
Save diegoveloper/f9d76c631b651bdce6005c6ccb084e2b 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
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
body: DefaultTabController( | |
length: 2, | |
child: NestedScrollView( | |
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { | |
return <Widget>[ | |
SliverAppBar( | |
expandedHeight: 200.0, | |
floating: false, | |
pinned: true, | |
flexibleSpace: FlexibleSpaceBar( | |
centerTitle: true, | |
title: Text("Collapsing Toolbar", | |
style: TextStyle( | |
color: Colors.white, | |
fontSize: 16.0, | |
)), | |
background: Image.network( | |
"https://images.pexels.com/photos/396547/pexels-photo-396547.jpeg?auto=compress&cs=tinysrgb&h=350", | |
fit: BoxFit.cover, | |
)), | |
), | |
new SliverPadding( | |
padding: new EdgeInsets.all(16.0), | |
sliver: new SliverList( | |
delegate: new SliverChildListDelegate([ | |
TabBar( | |
labelColor: Colors.black87, | |
unselectedLabelColor: Colors.grey, | |
tabs: [ | |
new Tab(icon: new Icon(Icons.info), text: "Tab 1"), | |
new Tab( | |
icon: new Icon(Icons.lightbulb_outline), | |
text: "Tab 2"), | |
], | |
), | |
]), | |
), | |
), | |
]; | |
}, | |
body: Center( | |
child: Text("Sample text"), | |
), | |
), | |
), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment