Created
July 11, 2018 12:40
-
-
Save deepak-gehlot/03bce8489e83396e7bb371a90f43b70e 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
import 'package:flutter/material.dart'; | |
class SimpleTab extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
textStyle() { | |
return new TextStyle(color: Colors.white, fontSize: 30.0); | |
} | |
return new DefaultTabController( | |
length: 3, | |
child: new Scaffold( | |
appBar: new AppBar( | |
title: new Text("Smiple Tab Demo"), | |
bottom: new TabBar( | |
tabs: <Widget>[ | |
new Tab( | |
text: "First", | |
), | |
new Tab( | |
text: "Second", | |
), | |
new Tab( | |
text: "Third", | |
), | |
], | |
), | |
), | |
body: new TabBarView( | |
children: <Widget>[ | |
new Container( | |
color: Colors.deepOrangeAccent, | |
child: new Center( | |
child: new Text( | |
"First", | |
style: textStyle(), | |
), | |
), | |
), | |
new Container( | |
color: Colors.blueGrey, | |
child: new Center( | |
child: new Text( | |
"Second", | |
style: textStyle(), | |
), | |
), | |
), | |
new Container( | |
color: Colors.teal, | |
child: new Center( | |
child: new Text( | |
"Third", | |
style: textStyle(), | |
), | |
), | |
), | |
], | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment