How to set Gradient Background for Floating Action Button in Flutter

Gradients have the ability to make UI components fancier. In this blog post, let’s check how to add a Floating Action Button with a gradient background in Flutter. The FloatingActionButton widget doesn’t have a direct property to create a gradient background. So, we should look for adding another widget that supports a gradient background. The…

How to add Floating Action Button with Icon and Text

The Floating Action Button (FAB) is one of the commonly used components in material design. Usually, the FAB has icons only. In this tutorial, let’s learn how to add Floating Action Button with icon and text in Flutter. The FloatingActionButton class has a constructor – FloatingActionButton.extended that can be used to add icon and text…

How to add Border to Floating Action Button in Flutter

A Floating Action Button is one of the commonly used button components of Material design. In this blog post, let’s learn how to add a border and change the border color of the Floating Action Button in Flutter. The FloatingActionButton widget has the shape property that helps to change the shape. We can use the…

How to change Floating Action Button Shape in Flutter

FloatingActionButton (FAB) is one of the important button widgets in Flutter. In this blog post, let’s learn how to change the shape of the Floating Action Button in Flutter. The FloatingActionButton widget has many properties for style customization. Its shape property helps you to change the default shape of FAB. You can even add a…

How to change Floating Action Button Position in Flutter

The Floating Action Button or FAB is an important button widget in Flutter. In this blog post, let’s learn how to change the position of the Floating Action Button in Flutter. By default, the position of the FloatingActionButton is bottom right. You can change the default FAB position using the floatingActionButtonLocation property of Scaffold. See…

How to change Floating Action Button Elevation in Flutter

The elevation of a component is the distance from the underneath surface. Visually, the elevation results in shadows. In this blog post, let’s check how to change the Floating Action Button elevation in Flutter. The FloatingActionButton widget has various properties for customization. One among them is elevation. You can change the FAB elevation using it….

How to set Padding for Elevated Button in Flutter

How to set Padding for Elevated Button in Flutter

Padding is an important aspect that determines the clarity of your mobile app UI. In this Flutter tutorial, let’s check how to apply padding to the ElevatedButton widget. You can set padding to the elevated button using the Padding class. Make Padding widget parent to the elevated button. Following is the complete example. See the…

Change Elevated Button Color on Press in Flutter

Change Elevated Button Color on Press in Flutter

The ElevatedButton is the ready-to-go button for most of the Flutter developers there. In this blog post, let’s learn how to change the color of the elevated button at the time of pressing. The ElevatedButton is styled using the ButtonStyle class. You can change the background color of an ElevatedButton using MaterialStateProperty class. You can…

How to Dynamically Disable and Enable Button in Flutter

Sometimes, we may need to disable and enable buttons in our apps. In this flutter example, I am showing you how to enable and disable elevated button. The ElevatedButton is enabled by default. But you can easily disable it by passing null to the onPressed property. See the snippet below. In practical scenarios, you always…