flutter_pravatar

Last updated:

0 purchases

flutter_pravatar Image
flutter_pravatar Images
Add to Cart

Description:

flutter pravatar

flutter_pravatar #
Display placeholder profile pictures from pravatar.cc/ for mocked users.
Usage #
Random #
Display a a random placholder avatar, different each time it is loaded.
@override
Widget build(BuildContext context) {
return Pravatar.random(),
}
copied to clipboard
Unique identifier #
Display the placholder avatar associated to the given uniqueId.
The avatar is guaranteed to be always the same as soon as the provided uniqueId is the same.
@override
Widget build(BuildContext context) {
return Pravatar.uniqueId('[email protected]'),
}
copied to clipboard
Image identifier #
Display the placholder avatar from its imageId.

All identifiers are available on the website.

@override
Widget build(BuildContext context) {
return Pravatar.imageId(27),
}
copied to clipboard
Image provider #
If you want to use the image provider manually, you can use [PravatarImage].
@override
Widget build(BuildContext context) {
final devicePixelRatio = MediaQuery.of(context).devicePixelRatio;
return Image(
image: PravatarImage(
size: devicePixelRatio * 100,
uniqueId: '[email protected]',
),
);
}
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.