Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2020
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 1.84 KB | None | 0 0
  1. import 'package:bubble_tab_indicator/bubble_tab_indicator.dart';
  2. import 'package:flutter/material.dart';
  3.  
  4. void main() => runApp(MyApp());
  5.  
  6. class MyApp extends StatelessWidget {
  7.   // This widget is the root of your application.
  8.   @override
  9.   Widget build(BuildContext context) {
  10.     return MaterialApp(
  11.       title: 'Flutter Demo',
  12.       theme: ThemeData(
  13.         primarySwatch: Colors.blue,
  14.       ),
  15.       home: MyHomePage(),
  16.     );
  17.   }
  18. }
  19.  
  20. class MyHomePage extends StatelessWidget {
  21.   @override
  22.   Widget build(BuildContext context) {
  23.     return DefaultTabController(
  24.       length: 3,
  25.       child: Scaffold(
  26.         appBar: AppBar(
  27.           backgroundColor: Colors.amber,
  28.           title: Text("TabBar Flutter"),
  29.           centerTitle: true,
  30.           bottom: TabBar(
  31.             // isScrollable: true,
  32.             indicatorSize: TabBarIndicatorSize.tab,
  33.             indicator: BubbleTabIndicator(
  34.               indicatorHeight: 35.0,
  35.               indicatorColor: Colors.blueAccent,
  36.               tabBarIndicatorSize: TabBarIndicatorSize.tab,
  37.             ),
  38.             tabs: <Widget>[
  39.               Tab(
  40.                 // text: "Home",
  41.                 icon: Icon(Icons.home),
  42.               ),
  43.               Tab(
  44.                 // text: "Favorite",
  45.                 icon: Icon(Icons.favorite),
  46.               ),
  47.               Tab(
  48.                 // text: "Account",
  49.                 icon: Icon(Icons.account_circle),
  50.               ),
  51.             ],
  52.           ),
  53.         ),
  54.         body: TabBarView(
  55.           children: <Widget>[
  56.             Center(
  57.               child: Icon(Icons.home),
  58.             ),
  59.             Center(
  60.               child: Icon(Icons.favorite),
  61.             ),
  62.             Center(
  63.               child: Icon(Icons.account_circle),
  64.             ),
  65.           ],
  66.         ),
  67.       ),
  68.     );
  69.   }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement