Flutter - Circular Icon Button
Last Updated :
28 Apr, 2025
In this article, we will implement how to make a circular icon button in Flutter. A sample image is given below to get an idea about what we are going to do in this article.
Step by Step Implementation
Step 1: Create a New Project in Android Studio
To set up Flutter Development on Android Studio please refer to Android Studio Setup for Flutter Development, and then create a new project in Android Studio please refer to Creating a Simple Application in Flutter.
Step 2: Add the material package that gives us the important methods and then call the runApp method in the main function that will call our application.
import 'package:flutter/material.dart';
void main() {
runApp(RunMyApp());
}
Step 3: Now we have to make a stateless widget RunMyApp Because our application does not go to change its state and then return the MaterialApp widget which allows us the set the title and theme and many more.
class RunMyApp extends StatelessWidget {
const RunMyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(home:);
}
}
Step 4: Give the home property and there can be a scaffold widget that has the property of AppBar and body. AppBar allows us to give the title of AppBar, color, leading, and trailing icon. Now give Body and contains the centered elevated button. Now we have a button, the task is to make it circular. By giving the style to the button we can make it circular and use the shape parameter. Shape further has CircleBorder that gives a circular shape to the button.
// elevated button
ElevatedButton(
onPressed: () {},
child: Icon(Icons.menu, color: Colors.white), // icon of the button
style: ElevatedButton.styleFrom( // styling the button
shape: CircleBorder(),
padding: EdgeInsets.all(20),
backgroundColor: Colors.green, // Button color
foregroundColor: Colors.cyan, // Splash color
),
),
Final Code
Dart
import 'package:flutter/material.dart';
void main() {
runApp(RunMyApp());
}
class RunMyApp extends StatelessWidget {
const RunMyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(primarySwatch: Colors.green),
home: Scaffold(
appBar: AppBar(
title: Text('Circular Icon Button'),
),
body: Center(
// elevated button
child: ElevatedButton(
onPressed: () {},
// icon of the button
child: Icon(Icons.menu, color: Colors.white),
// styling the button
style: ElevatedButton.styleFrom(
shape: CircleBorder(),
padding: EdgeInsets.all(20),
// Button color
backgroundColor: Colors.green,
// Splash color
foregroundColor: Colors.cyan,
),
),
),
),
);
}
}
Output
Similar Reads
Flutter - Extended Icon Button In Flutter there are many prebuilt Button - Material Button, Text Button, Elevated Button, etc. In this article, we are going to implement the Extended Icon Button, which can be customized as per user need. We can give color to the button. A sample video is given below to get an idea about what we a
2 min read
Flutter - Build a Circular Slider A CircularSlider is a unique and engaging way to input or visualize values within a circular, radial design. In Flutter, this can be achieved using various packages, such as the sleek_circular_slider package. This package enables us to create a wide range of Circular Sliders and we can create a Circ
4 min read
Flutter - Circular reveal Animation The Circular Reveal Animation in Flutter is inspired by ViewAnimationUtils.createCircularReveal(...). It does exactly what the name suggests, meaning it is used to reveal content generally an image circularly where the circle grows bigger and makes the image visible. In this article, we will impleme
4 min read
Flutter - Gradient Button Buttons are the building block of any Android Application, Buttons are helping in to perform specific tasks like Navigating from one screen to another screen, Showing the Toast, Sign-in, Sign-up buttons, and many more. But giving the effects of the colors to the Button makes the Button more pretty.
3 min read
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.yaml file of your object.Synt
2 min read