Instead of adding normal icon, you need to use IconButton widget for interactivity. //State is information of the application that can change over time or when some actions are taken. But to set icon at right side of raised button we have to modify the raised button structure and create custom raised button with Row widget. IconButton( icon: Icon(Icons.star), onPressed: { // Interactivity or events codes here }, ), Where icon: Icon(Icons.add) is an icon of star. In simple terms, it is an icon that reacts when the user will touch it. 5. We can also customize the look and feel of this button. constraints property - IconButton class - material library - Dart API Flutter It allows us to create one Icon in a mobile app. An IconButton is a picture printed on the Material widget. You can write code inside the braze bracket. Example: Open the main.dart file and replace it with the below code. Based on native IconButton. The approach described in this post yields an odd looking button that seems expanded to the width of the app, see this image (link as I am not allowed to attach images):. This property must not be null. The icon to display inside the button. You can use the below code in your script. Icon Button. Hi@akhtar, To create an Icon Button in Flutter, you can find Icon Widget in Flutter document. It is a useful widget that gives the Flutter UI a material design feel. Implementation final Widget icon The Icon.size and Icon.color of the icon is configured automatically based on the iconSize and color properties of this widget using an IconTheme and therefore should not be explicitly given in the icon widget.. var MyEmailIcon = Icon( Icons.email, color: Colors.grey.shade900, ); var MyEmailButton = IconButton(icon… Follow the instructions to create an IconButton with an Ink background. onPressed is the event, that works when we press on the star icon. 1.) In Flutter, IconButton is a button with an icon which the user can click on to perform an action.IconButton will not include text content, so if you want a button that consists of an icon … See Icon, ImageIcon.. Then increase the size of the icon in the icon button. So in this tutorial we would Flutter Add Image Icon Inside Rounded Raised Button Android iOS Example Tutorial. API docs for the constraints property from the IconButton class, for the Dart programming language. Flutter package to create custom animated IconButton. Button becomes wide when adding a Row widget as child Expected results: The icon bigger but in the center of the button The icon seems to grow while being anchored on the top left rather than the center. I am trying to create a Flutter app that has a button with a text and icon as label, the icon being placed right of the text. We are using the default Icon library of flutter in our tutorial because it covers all the icons. Includes all available icons. The icon displays Icon widget and onPressed is a callback function that called when the button is tapped. This attribute takes the value of an Icon() which can store the icons. To start using the IconButton widget in Flutter, we should know about different properties: icon:- The important attribute of the IconButton widget is the icon attribute.