Flutter
usenavii provides deterministic Navii widgets and a Dart port of the core engine for Flutter applications.
Install
flutter pub add usenavii
Stable release: usenavii 0.1.1 on pub.dev.
Requires Flutter 3.24 or newer. The package uses flutter_svg to paint generated SVG strings and works offline on Android, iOS, Web, macOS, Windows, and Linux.
Usage
import 'package:usenavii/usenavii.dart';
Navii(
seed: user.id,
size: 64,
mood: 'happy',
title: user.name,
)
NaviiGroup(
seeds: team.map((user) => user.id).toList(),
size: 48,
overlap: 0.3,
max: 5,
alt: 'Team avatars',
)
Use a stable seed such as a database id or UUID. alt takes precedence over title for the Flutter semantics label.
Widget options
Navii supports size, palette overrides, background, mood, packs, style hints, tile background, and accessibility labels. NaviiGroup adds overlap, maximum visible tiles, ring color, and overflow-counter colors.
The package also re-exports the Dart engine APIs, including createAvatar, selectAvatar, renderAvatar, renderGroup, build, random, seed helpers, hashing, and pack resolution.
Renderer limitations
animated: trueis accepted for API parity, butflutter_svgdoes not execute the SVG CSS keyframes. Flutter paints the static first frame.- SVG filter effects such as hue rotation and Gaussian glow are not supported by
flutter_svg. Avatars still render, but affected pack effects can look different from Web. - The Flutter package versions independently from the npm
@usenavii/*packages and is released through pub.dev.
Example app
cd packages/flutter/example
flutter pub get
flutter run -d chrome
The repository example demonstrates seed input, random avatars, size, moods, and an overlapping NaviiGroup.