dicebear_core library
Unique avatars from dozens of styles — deterministic, customizable, vector-based.
The engine behind DiceBear. Pair it with the
style definitions from the dicebear_styles package:
import 'package:dicebear_core/dicebear_core.dart';
import 'package:dicebear_styles/adventurer.dart';
void main() {
final style = Style.parse(adventurer);
final avatar = Avatar(style, {'seed': 'Felix'});
print(avatar.svg);
}
Classes
- Avatar
- Top-level entry point for rendering an avatar from a style and options.
- Color
- Color helpers used by the renderer and the option resolver.
- OptionsDescriptor
- Builds a descriptor of every option a given style accepts. Tooling such as the editor uses the result to render form controls and validation hints without having to introspect the style itself.
- Style
- Validated, lazily-decomposed wrapper around a style definition.
- ValidationErrorDetail
- A single field failure inside a ValidationError.
Exceptions / Errors
- CircularColorReferenceError
- Thrown when a color in the style definition references itself, directly or indirectly. chain reproduces the resolution path.
- OptionsValidationError
- Thrown when avatar options fail schema validation.
- StyleValidationError
- Thrown when a style definition fails schema validation.
- ValidationError
- Base class for schema validation errors. Carries the per-field failures in details; message is the formatted summary.