Skip to content

Instantly share code, notes, and snippets.

@diegoveloper
Last active July 7, 2018 05:36
Show Gist options
  • Save diegoveloper/7c93fceec562a25711b7e1b9c14d9318 to your computer and use it in GitHub Desktop.
Save diegoveloper/7c93fceec562a25711b7e1b9c14d9318 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
class MainPersistentTabBar extends StatelessWidget {
@override
Widget build(BuildContext context) {
return DefaultTabController(
length: 2,
child: Scaffold(
appBar: AppBar(
bottom: TabBar(
tabs: [
Tab(icon: Icon(Icons.directions_car), text: "Tab 1",),
Tab(icon: Icon(Icons.directions_transit), text: "Tab 2"),
],
),
title: Text('Persistent Tab Demo'),
),
body: TabBarView(
children: [
Center( child: Text("Page 1")),
Center( child: Text("Page 2")),
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment