Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:bubble_tab_indicator/bubble_tab_indicator.dart';
- import 'package:flutter/material.dart';
- void main() => runApp(MyApp());
- class MyApp extends StatelessWidget {
- // This widget is the root of your application.
- @override
- Widget build(BuildContext context) {
- return MaterialApp(
- title: 'Flutter Demo',
- theme: ThemeData(
- primarySwatch: Colors.blue,
- ),
- home: MyHomePage(),
- );
- }
- }
- class MyHomePage extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return DefaultTabController(
- length: 3,
- child: Scaffold(
- appBar: AppBar(
- backgroundColor: Colors.amber,
- title: Text("TabBar Flutter"),
- centerTitle: true,
- bottom: TabBar(
- // isScrollable: true,
- indicatorSize: TabBarIndicatorSize.tab,
- indicator: BubbleTabIndicator(
- indicatorHeight: 35.0,
- indicatorColor: Colors.blueAccent,
- tabBarIndicatorSize: TabBarIndicatorSize.tab,
- ),
- tabs: <Widget>[
- Tab(
- // text: "Home",
- icon: Icon(Icons.home),
- ),
- Tab(
- // text: "Favorite",
- icon: Icon(Icons.favorite),
- ),
- Tab(
- // text: "Account",
- icon: Icon(Icons.account_circle),
- ),
- ],
- ),
- ),
- body: TabBarView(
- children: <Widget>[
- Center(
- child: Icon(Icons.home),
- ),
- Center(
- child: Icon(Icons.favorite),
- ),
- Center(
- child: Icon(Icons.account_circle),
- ),
- ],
- ),
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement