dicebear_offline 1.0.0
dicebear_offline: ^1.0.0 copied to clipboard
A powerful, offline, customizable DiceBear avatar generator for Flutter. Supports OpenPeeps, Personas, Micah, ToonHead, Avataaars, and Miniavs.
dicebear_offline #
A powerful, offline, highly customizable DiceBear avatar generator for Flutter.
This package provides a pure Dart implementation of the beautiful DiceBear avatar styles, allowing you to generate and render SVG avatars entirely offline without making any network requests.
Features #
- 100% Offline: Generates avatars instantly without any network dependencies.
- Multiple Styles: Supports OpenPeeps, Personas, Micah, ToonHead, Avataaars, and Miniavs.
- Highly Customizable: Billions of combinations. Customize hair, eyes, mouth, clothing, colors, accessories, and more.
- Performant: Directly outputs clean SVG strings that can be rendered using
flutter_svg.
Installation #
Add the dependency to your pubspec.yaml:
dependencies:
dicebear_offline: ^1.0.0
flutter_svg: ^2.3.0
Usage #
Import the package and generate an avatar using the SvgEngine:
import 'package:dicebear_offline/dicebear_offline.dart';
import 'package:flutter_svg/flutter_svg.dart';
// Generate an SVG string
final String svgString = SvgEngine.generateSvg(
style: AvatarStyle.personas,
headOrHairKey: 'hairStyle1',
faceOrEyesKey: 'happyEyes',
hairColor: '000000',
skinColor: 'ffdbb4',
clothingColor: '6366f1',
);
// Render it in your Flutter app
SvgPicture.string(svgString)
Check out the example app for a fully featured avatar editor and profile saver demonstrating the complete capabilities of this package!
License #
This project is licensed under the MIT License.