Skip to content
Related Articles
Open in App
Not now

Related Articles

Icon Class in Flutter

Improve Article
Save Article
  • Difficulty Level : Easy
  • Last Updated : 15 Feb, 2021
Improve Article
Save Article

Icon class in Flutter is used to show specific icons in our app. Instead of creating an image for our icon, we can simply use the Icon class for inserting an icon in our app. For using this class you must ensure that you have set uses-material-design: true in the pubsec.yml file of your object.

      key key,


  • color: It is used to set the color of the icon
  • size: It is used to resize the Icon
  • semanticLable: It comes in play while using the app in accessibility mode (ie, voice-over)
  • textDirection: It is used for rendering Icon

Note: The semanticLabel are not visible in the UI.

A few of them are depicted below:

To view, the complete list of Icons click here.

Let’s see some of those icons in action with simple flutter apps.


Here we will design an app that shows various icons on different tabs. Here we will have 5 tabs with 5 icons each and we will alter its properties to view the UI changes. The property changes are as below:

  1. music_note Icon:
    color: default, size: 100, semanticLabel: None, textdirection: default
  2. music_video Icon:
    color: default, size: 100, semanticLabel: None, textdirection: default
  3. camera_alt Icon:
    color: default, size: 100, semanticLabel: 'Camera', textdirection: default
  4. grade Icon:
    color: red, size: 300, semanticLabel: 'Star', textdirection: default
  5. email Icon:
    color: default, size: default, semanticLabel: None', textdirection: default


import 'package:flutter/material.dart';
void main() {
class TabBarDemo extends StatelessWidget {
  Widget build(BuildContext context) {
    return MaterialApp(
      home: DefaultTabController(
        length: 5,
        child: Scaffold(
          appBar: AppBar(
            bottom: TabBar(
              tabs: [
                Tab(icon: Icon(Icons.music_note)),
                Tab(icon: Icon(Icons.music_video)),
                Tab(icon: Icon(Icons.camera_alt)),
                Tab(icon: Icon(Icons.grade)),
                Tab(icon: Icon(,
            title: Text('GeeksForGeeks'),
          body: TabBarView(
            children: [
                  size: 100),
                size: 100),
                semanticLabel: 'Camera',
                size: 100),
                size: 300,
                semanticLabel: 'Star',),


My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!