Skip to main content

Posts

flutter - How to change TextButton background color

Flutter - TextButton Background Color The TextButton class represents a material design text button. The flutter developers can use text buttons on toolbars, in dialogs, or in line with other content. Text buttons do not have visible borders. The flutter developers should avoid using text buttons where they would blend in with other content such as in the middle of lists. The TextButton style can be overridden with its style parameter. The following flutter application development tutorial will demonstrate how we can set a background color for the TextButton. We will change the TextButton widget’s default background color. Here we will use the TextButton class’s styleFrom() method to change the TextButton’s default background color. The TextButton class’s styleFrom() method is a static convenience method that constructs a text button ButtonStyle given simple values. By default, TextButton class styleFrom() method returns a ButtonStyle that doesn't ...

flutter - How to create OutlinedButton with icon

Flutter - OutlinedButton Icon The OutlinedButton class represents a material design outlined button that is essentially a TextButton with an outlined border. The outlined buttons are medium-emphasis buttons. In a flutter application, the OutlinedButtons contain actions that are important, but they are not the primary action in an app. An OutlinedButton widget’s default style is defined by defaultStyleOf. The flutter application developers can override the OutlinedButton’s style with its style parameter. An OutlinedButton has a default ButtonStyle.side which defines the appearance of the outline. The flutter app developers can specify an OutlinedButton's shape and the appearance of its outline by specifying both the ButtonStyle.shape and ButtonStyle.side properties. The following flutter application development tutorial will demonstrate how to create an OutlinedButton widget with an icon. Here we will use the OutlinedButton.icon() constructor to create a...

flutter - How to change OutlinedButton border radius

Flutter - OutlinedButton Border Radius The OutlinedButton class represents a material design outlined button that is essentially a TextButton with an outlined border. The outlined buttons are medium-emphasis buttons. In a flutter application, the OutlinedButtons contain actions that are important, but they are not the primary action in an app. An OutlinedButton widget’s default style is defined by defaultStyleOf. The flutter application developers can override the OutlinedButton’s style with its style parameter. An OutlinedButton has a default ButtonStyle.side which defines the appearance of the outline. The flutter app developers can specify an OutlinedButton's shape and the appearance of its outline by specifying both the ButtonStyle.shape and ButtonStyle.side properties. The following flutter application development tutorial will demonstrate how to set or change the OutlinedButton widget’s border-radius. That means how we can make rounded corners Out...

flutter - How to change OutlinedButton border color

Flutter - OutlinedButton Border Color The OutlinedButton class represents a material design outlined button that is essentially a TextButton with an outlined border. The outlined buttons are medium-emphasis buttons. In a flutter application, the OutlinedButtons contain actions that are important, but they are not the primary action in an app. An OutlinedButton widget’s default style is defined by defaultStyleOf. The flutter application developers can override the OutlinedButton’s style with its style parameter. An OutlinedButton has a default ButtonStyle.side which defines the appearance of the outline. The flutter app developers can specify an OutlinedButton's shape and the appearance of its outline by specifying both the ButtonStyle.shape and ButtonStyle.side properties. The following flutter application development tutorial will demonstrate how to set or change the OutlinedButton widget’s border color. Here we will use the OutlinedButton class’s styl...

flutter - How to use OutlinedButton

Flutter OutlinedButton The OutlinedButton class represents a material design Outlined Button that is essentially a TextButton with an outlined border. The Outlined buttons are medium-emphasis buttons. In a flutter application, the OutlinedButtons contain actions that are important, but they are not the primary action in an app. An OutlinedButton widget’s default style is defined by defaultStyleOf. The flutter application developers can override the OutlinedButton’s style with its style parameter. An OutlinedButton has a default ButtonStyle.side which defines the appearance of the outline. The flutter app developers can specify an OutlinedButton's shape and the appearance of its outline by specifying both the ButtonStyle.shape and ButtonStyle.side properties. The OutlinedButton() constructor creates an OutlinedButton. And the OutlinedButton.icon() constructor creates a text button from a pair of widgets that serve as the button's icon and labe...

flutter - How to use TextField

Flutter TextField The TextField class represents a material design text field. The TextField widget lets the user enter text, either with a hardware keyboard or with an onscreen keyboard. The TextField calls the onChanged callback whenever the user changes the text in the field. The flutter developers can control the text that is displayed in the TextField using the controller. The controller allows developers to set an initial value. The controller can also control the selection and composing region and observe changes to the text, selection, and composing region. The flutter developers can use TextField decoration property to control the decoration, for example by adding a label or an icon. The flutter developers can read the value from a TextField widget to use the onSubmitted callback. The onSubmitted callback is applied to TextField's current value when the user finishes editing. The flutter app developers can always read t...

flutter - How to use IconButton

Flutter IconButton The IconButton class represents a material design icon button. IconButton is a picture printed on a material widget that reacts to touches by filling with color. The flutter developers commonly used the Icon buttons in the AppBar actions field, but IconButtons can be used in many other places as well. The flutter app developers can leave the onPressed callback null to disable an IconButton, then it will not react to touch. The IconButton class has several useful properties such as alignment, autofocus, color, disabledColor, focusColor, highlightColor, hoverColor, icon, iconSize, isSelected, onPressed, padding, selectedIcon, splashColor, style, and tooltip. The IconButton class’s alignment property defines how the icon is positioned within the IconButton. The color property defines the color to use for the icon inside the button if the icon is enabled. The icon property defines the icon to display inside the button. The ic...