Avatar Brick
Avatar Brick is a custom avatar can automatically display your abbreviation name when no avatar
is available.
Let’s get started
Import the package in your project:
import 'package:avatar_brick/avatar_brick.dart';
1. Avatar with an image
To pass an image to an AvatarBrick, you can either pass an image to the image variable or use
specific image formats (AvatarBrick.network
, AvatarBrick.asset
, AvatarBrick.file
, AvatarBrick.memory
). Try the following simple example:
Note: If you pass an image to the image variable, it should be have a fit
variable
of BoxFit.cover
, a height
variable of double.maxFinite
and a weight
variable
of double.maxFinite
.
2. Avatar with a “name”
If you want to create an avatar can automatically display your abbreviation name. DON’T pass
image
variable or pass null
value. Then pass your name in the name
variable like following
example:
3. Loading Avatar
If you want to create a loading avatar.DON’T pass any variable or pass the true
value to
the isLoading
variable like the following example:
Customization
You can customize the size of the avatar by passing the variable size
. Try the following example:
You can customize the color of the background, border, abbreviation name. Try the following example:
You can customize the radius, border, shadow,… of the image. Try the following example:
Thank you for using my package!
See more of my packages here
Contact me: congson99vn@gmail.com
| linkedin | github