Posted By

markt22 on 07/18/18


Tagged

flutter dart


Versions (?)

Flutter: DefaultTabController


 / Published in: JavaScript
 

Creates an App with 3 tabs, using DefaultTabController

  1. class _MyHomePageState extends State<MyHomePage> {
  2. @override
  3. Widget build(BuildContext context) {
  4. return DefaultTabController(
  5. length: 3,
  6. child: Scaffold(
  7. appBar: AppBar(
  8. bottom: TabBar(
  9. tabs: [
  10. Tab(icon: Icon(Icons.directions_car)),
  11. Tab(icon: Icon(Icons.directions_transit)),
  12. Tab(icon: Icon(Icons.directions_bike)),
  13. ],
  14. ),
  15. title: Text('Tabs Demo'),
  16. ),
  17. body: TabBarView(
  18. children: [
  19. Icon(Icons.directions_car),
  20. Icon(Icons.directions_transit),
  21. Icon(Icons.directions_bike),
  22. ],
  23. ),
  24. ),
  25. );
  26. }
  27. }

Report this snippet  

You need to login to post a comment.