Icon Class in Flutter

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.

Syntax:

Icon(

   key key,

   size,

   color,

   semanticLabel,

   textDirection

)

Properties:

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.

Leave a comment

Your email address will not be published. Required fields are marked *