build method
Builds an instance of the fancy avatar.
FancyAvatar(40, Image.asset('assets/path/to/image.png'),
ringColor: Colors.indigoAccent[400], spaceWidth: 4.5, elevation: 15.0)
Implementation
@override
Widget build(BuildContext context) {
return Material(
elevation: elevation,
shadowColor: shadowColor ?? ringColor?.withOpacity(.7),
color: Colors.transparent,
shape: CircleBorder(
side: BorderSide(color: ringColor ?? Colors.black, width: ringWidth)),
child: SizedBox(
width: 2 * radius,
height: 2 * radius,
child: CircleAvatar(
backgroundColor: innerRingColor ?? Colors.white.withOpacity(.3),
radius: radius - 2 * ringWidth,
child: ClipOval(
child: DecoratedBox(
decoration:
BoxDecoration(color: avatarBackgroundColor ?? Colors.grey),
child: SizedBox(
width: 2 * radius - 2 * (spaceWidth + ringWidth),
height: 2 * radius - 2 * (spaceWidth + ringWidth),
child: userImage,
),
),
),
),
),
);
}