placeholder_images 0.0.1 placeholder_images: ^0.0.1 copied to clipboard
Placeholder for images. You can use the simple method to get a unique image for each user just like Google or Microsoft Teams. The image consists of initials of the user name.
Placeholder Images #
Placeholder for images. You can use the simple method to get a unique image for each user just like Google or Microsoft Teams. The image consists of initials of the user name.
Implementation #
You can use this function like this:
- Call the static method of library
var url = PlaceholderImage.getPlaceholderImageURL("name")
This will return a link which you can load in your UI by using cached image library or any other library like this. Every time you call this link with a unique name will result a unique image with different text on it.
It works just like Google or Microsoft Teams placeholder images.
- Change Settings
You have many options available in the library. You can play with them to get best as you want.
Below is the list of properties:
- Text Color (Hex Color String)
- Background Color (Hex Color String)
- Random Background (true or false)
- Size (16 to 512)
- Font Size (0.1 to 1)
- Length (Greater then zero)
- Rounded (true or false)
- Bold (true or false)
- Uppercase (true or false)
- SVG (true or false)
var url = PlaceholderImage.getPlaceholderImageURL(
"name",
textColor: "FFFFFF",
backgroundColor: "000000",
**or**
randomBackground: true,
size: 256,
fontSize: 0.5,
length: 2,
rounded: false,
bold: false,
uppercase: false,
isSvg: false,
);
This way you can change settings of the image.