circle around icon flutter
To create a circle around an icon in Flutter using the C language, you can use the Container
widget with a circular shape and set the borderRadius
property to achieve the desired effect. Here's an example:
Container(
width: 50,
height: 50,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.blue,
),
child: Icon(
Icons.star,
color: Colors.white,
),
);
This code snippet creates a Container
with a width and height of 50, and sets the decoration
property with a BoxDecoration
object. The shape
property is set to BoxShape.circle
to make the container circular. The color
property sets the background color of the container to blue.
Inside the Container
, an Icon
widget is used to display the icon. The Icons.star
parameter specifies the star icon, and the color
property sets the color of the icon to white.
By using this code, you can create a circular container around an icon in a Flutter application.