Skip to content

Instantly share code, notes, and snippets.

@deepak-gehlot
Created July 11, 2018 12:40
Show Gist options
  • Save deepak-gehlot/03bce8489e83396e7bb371a90f43b70e to your computer and use it in GitHub Desktop.
Save deepak-gehlot/03bce8489e83396e7bb371a90f43b70e to your computer and use it in GitHub Desktop.
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