add border to circle avatar flutter code example

Example 1: circle around icon flutter

CircleAvatar(
   backgroundColor: Colors.white,
   radius: 30,
   child: Icon(Icons.add),
),

Example 2: how to make an image contained in circle avatar in flutter

CircleAvatar(
                radius: 30.0,
                backgroundImage:
                    NetworkImage("${snapshot.data.hitsList[index].previewUrl}"),
                backgroundColor: Colors.transparent,
              )

Example 3: border at circleAvatar flutter

CircleAvatar(
    radius: 30,
    backgroundColor: Colors.teal,
    child: CircleAvatar(
      backgroundImage: AssetImage('assets/appdev.png'),
      radius: 28,
    ),
  ),

Example 4: flutter squared avatar rounded borders

ClipRRect(
  borderRadius: BorderRadius.circular(20.0),//or 15.0
  child: Container(
    height: 70.0,
    width: 70.0,
    color: Color(0xffFF0E58),
    child: Icon(Icons.volume_up, color: Colors.white, size: 50.0),
  ),
),

Tags:

C Example