flutter library
The Flutter widget layer of hiblob.
import 'package:hiblob/flutter.dart';
const Hiblob(name: 'ada@example.com', size: 48);
AnimatedHiblob(
name: 'ada@example.com',
size: 120,
animation: HiblobAnimation.always,
)
The widgets paint the deterministic layout through dart:ui primitives.
For the pure, Flutter-independent engine (hash, traits, palette,
geometry, motion), import package:hiblob/hiblob.dart instead.
Classes
- Accessory
- One accessory mark and the color it is painted with.
- AccessoryKeys
- Keys HiblobOptions.accessories accepts, with the deterministic per-name probability each accessory defaults to when unpinned.
- AnimatedHiblob
- An animated hiblob: seeded breathe, bob, blinks, and glances.
- AnimatedHiblobPainter
- Paints an animated hiblob: it computes its own MotionFrame from an elapsed-time notifier each repaint, and crossfades between the previous and current figure when the expression (or name) changes.
- DrawStep
- One drawing step: a path and the ARGB color it is painted with.
- Expression
- One expression pose.
- EyeGroup
- One eye: the marks that draw it (filled or stroked), and its center, used to scale the eye around itself when it blinks.
- GeometryPath
- One drawn primitive: an ordered command list, plus how it paints.
- Hiblob
- A static hiblob.
- HiblobOptions
- Immutable options for one hiblob.
- HiblobPainter
- Paints a static hiblob — the painter behind the Hiblob widget.
- HiblobRenderer
- A resolved, ready-to-paint hiblob.
- MotionFrame
- One instant of motion, in view-box units.
- MotionSeeds
- The per-name random periods and phases motion reads.
- PaletteKeys
- Keys HiblobOptions.palette accepts. Each value is a hex color string.
- ResolvedHiblob
- A fully resolved, ready-to-draw hiblob.
Enums
- Backdrop
- The backdrop plates a hiblob can sit on.
- HiblobAnimation
- How AnimatedHiblob runs its ambient motion.
Constants
-
expressions
→ const List<
Expression> - Every built-in expression, in roster order.
- frown → const Expression
- A downturned mouth that droops at the corners.
- grin → const Expression
- A wide open smile.
- happy → const Expression
- Closed smiling eyes.
- idle → const Expression
- The neutral face.
- love → const Expression
- Heart-shaped eyes with a warm tint.
- mad → const Expression
- Slanted, lowered brows with a faint hot tint.
- sad → const Expression
- Eyes curved upward at the outer edge.
- scared → const Expression
- Widest eyes with a faint cold tint.
-
shapeBands
→ const Map<
String, (double, double)> - The silhouette bands. Everyday shapes get wide bands; loud shapes are a find. These tables are part of the frozen visual contract: changing a band moves existing names to different silhouettes.
- shy → const Expression
- Small closed eyes drawn inward, blushing.
- sick → const Expression
- Squinting lines with a queasy tint.
- sleepy → const Expression
- Half-closed, drooping eyes.
- smug → const Expression
- One eye open, one raised in a smirk.
- surprised → const Expression
- Wide round eyes.
- thinking → const Expression
- Eyes glancing up and to the left, one squinting.
-
toneBands
→ const Map<
String, (double, double)> - The tone bands, pale to ink, partitioned like the silhouette bands.
-
traitKeys
→ const List<
String> - Every trait the layout reads, in roster order.
- unsure → const Expression
- One eye open, one small and doubtful.
- wink → const Expression
- One eye open, one closed.
Functions
-
drawStepsOf(
ResolvedHiblob resolved) → List< DrawStep> -
Flattens
resolvedinto a paint-order draw list — what layoutFor returns for a name, here applied to an already resolved figure. -
layoutFor(
String name, {HiblobOptions options = const HiblobOptions()}) → List< DrawStep> -
The completed draw list for
name: every path in paint order (backdrop, body, mouth, and accessories), each with its color. Stroked paths carry their stroke color; the caller chooses stroke vs fill from GeometryPath.stroke. -
motionAt(
MotionSeeds seeds, double elapsedMs, {double ramp = 0}) → MotionFrame -
The motion frame at
elapsedMsforseeds. -
motionSeedsFor(
String name, {HiblobOptions options = const HiblobOptions()}) → MotionSeeds -
Reads the motion seeds for
name. -
partsFor(
String name, {HiblobOptions options = const HiblobOptions()}) → List< GeometryPath> -
The body silhouette and any extra volumes (ResolvedHiblob.body) for
name, without palette information. -
resolve(
String name, {HiblobOptions options = const HiblobOptions()}) → ResolvedHiblob -
Resolves
namewithoptionsinto drawable geometry and palette. -
svgFromName(
String name, {HiblobOptions options = const HiblobOptions()}) → String -
Convenience for svgOf: resolves
namewithoptionsfirst. -
svgOf(
ResolvedHiblob resolved) → String -
Renders
resolvedas an SVG document string. -
traitsFor(
String name, {HiblobOptions options = const HiblobOptions()}) → Map< String, double> -
Reads the trait table for
name, withoptionspins applied. -
uiPathFrom(
GeometryPath path) → Path -
Converts a core GeometryPath into a
dart:uipath.