Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Tab Bar Android App Flutter - Example Code

Learn how to create Tab Bar on your android application using flutter. This Application will give a basic idea like how you can create tab bar with icons, text and controller.

Code
import 'package:flutter/material.dart';

class TabBarWidget extends StatelessWidget {
  const TabBarWidget({super.key});

  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
        length: 3,
        initialIndex: 1,
        child: Scaffold(
          appBar: AppBar(
            title: const Text('Contact Us'),
            bottom: const TabBar(tabs: [
              Tab(
                icon: Icon(Icons.email),
                child: Text('Email'),
              ),
              Tab(
                icon: Icon(Icons.sms),
                child: Text('SMS'),
              ),
              Tab(
                icon: Icon(Icons.web),
                child: Text('Web'),
              )
            ]),
          ),
          body: const TabBarView(
              children: [Text('1st Tab'), Text('2nd Tab'), Text('3rd Tab')]),
        ));
} 
Output:

Tutorial Video


 


This post first appeared on Technology Innnovation, please read the originial post: here

Share the post

Tab Bar Android App Flutter - Example Code

×

Subscribe to Technology Innnovation

Get updates delivered right to your inbox!

Thank you for your subscription

×