# Avatar
# FLAvatar
FLAvatar supports displaying image or color + text.
Tips
When both the image and color are specified, the image will be displayed in preference.
- image
FLAvatar(
image: Image.asset('assets/avatar.jpg', scale: 2),
width: 75,
height: 75,
radius: 10, // if not specify, will be width / 2
),
- text
FLAvatar(
color: Color(0xFF0078D4),
width: 50,
height: 50,
text: 'CE',
textStyle: TextStyle(fontSize: 17, color: Colors.white),
),
# API
# FLAvatar
property | description | type | default value |
---|---|---|---|
image | image | Image | |
color | main color | Color | |
text | text | String | |
width | widget width | double | |
height | widget height | double | |
radius | corner radius | double | |
onTap | tap callback | VoidCallback |