Created
June 20, 2018 08:28
-
-
Save paulallies/89cf2381d862a1e56707a07297aaa402 to your computer and use it in GitHub Desktop.
Home Page for Flutter Nav
This file contains hidden or 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'; | |
//Drawer Widget | |
import '../pages/drawer.dart'; | |
//Tabs Content | |
import '../pages/home/tab1.dart'; | |
import '../pages/home/tab2.dart'; | |
import '../pages/home/tab3.dart'; | |
class HomePage extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return new DefaultTabController( | |
length: 3, | |
child: Scaffold( | |
drawer: new MyDrawer(), | |
appBar: AppBar( | |
title: Text("Home"), | |
bottom: TabBar( | |
tabs: [ | |
Tab(icon: Icon(Icons.directions_car)), | |
Tab(icon: Icon(Icons.directions_transit)), | |
Tab(icon: Icon(Icons.directions_bike)), | |
], | |
), | |
), | |
body: new TabBarView( | |
children: <Widget>[ | |
new HomeTab1(), | |
new HomeTab2(), | |
new HomeTab3(), | |
], | |
)), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment