Skip to content

Instantly share code, notes, and snippets.

@ashutoshsr7
Created April 29, 2024 07:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashutoshsr7/d8ddac6595e005450e89e5a84d38d244 to your computer and use it in GitHub Desktop.
Save ashutoshsr7/d8ddac6595e005450e89e5a84d38d244 to your computer and use it in GitHub Desktop.
Tabs - Navigation
import 'package:flutter/material.dart';
void main() {
runApp(const TabBarDemo());
}
class TabBarDemo extends StatelessWidget {
const TabBarDemo({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
home: DefaultTabController(
length: 3,
child: Scaffold(
appBar: AppBar(
bottom: const TabBar(
tabs: [
Tab(icon: Icon(Icons.home)),
Tab(icon: Icon(Icons.search)),
Tab(icon: Icon(Icons.person)),
],
),
title: const Text('Tabs Demo - Blup'),
),
body: TabBarView(
children: [
Icon(Icons.home),
Icon(Icons.search),
Icon(Icons.person),
],
),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment