gravix_effects library
Gravix Effects for Flutter — real-time beauty filter, face reshape, makeup and looks on a camera the plugin owns.
The local preview is GravixPreview; the filtered STREAM goes to your streaming stack through its output package:
gravix_effects_webrtc (flutter_webrtc / LiveKit) or gravix_effects_agora (Agora).
if (!await GravixCamera.requestPermission()) return;
final cam = await GravixCamera.start(lens: GravixLens.front, fps: 24);
GravixPreview(cam); // local preview widget
await cam.setBuiltinLook('glow');
final out = await GravixWebRtc.attach(cam); // or GravixAgora.attach(cam), …
await cam.switchCamera(); // the output stays attached
await cam.stop();
Classes
- GravixCamera
- A running Gravix camera: the plugin owns the camera; the filtered picture goes to GravixPreview and to the output package you attach (see the library docs).
- GravixEffects
-
The optional effects pack (R85). A host built with
gravixEffectsPack=falseships without the face-tracking libraries and models (~20 MB smaller on arm64); download fetches them on first use. With the pack bundled (the default) availability is always ready. Until the pack is ready the camera, license and watermark work as usual — face effects simply stay off, and gravixErrors reportsE_PACK_NOT_INSTALLEDonce. - GravixLook
-
A look (
.gfxeffect) and its gallery info. Create one with GravixLooks; apply it with GravixCamera.applyLook. - GravixLooks
-
Where looks come from. Every source is validated by the SDK's
.gfxreader (a bad file is an error, never a crash). Remote looks are cached (HTTPS only, validated before caching, revalidated with ETag / Last-Modified, served from the cache when offline, LRU 50 MB); passsha256to pin the exact file. - GravixPackAvailability
- GravixPreview
- The local camera preview (the engine's own output — no WebRTC renderer). Mirrored for the front camera (selfie view) unless mirrorFront is false. Fills its box like BoxFit.cover.
Enums
- GravixLens
- GravixLowEndFilter
- Low-end filter (R93): on weak GPUs every look runs without reshape and region effects (lip tint, blush, teeth, under-eye, eye brighten), processing at 480, so the camera can hold its frame rate. Tone, smoothing, LUT and stickers stay. auto (default) and off: every effect of the look always runs — the SDK never removes effects by itself (R100, owner 2026-11-06, like Tencent: its device tier never drops beauty, makeup or reshape). on: the host asks for the low-end filter (no reshape, no region effects, processing 480) — only when the host turns it on.
- GravixPackState
- State of the optional effects pack (face tracking libraries + models, R85).
- GravixPerformance
- CPU policy (R63, experimental). quality (default): full quality. auto: when the phone cannot keep up (heat throttling, a busy app) the SDK runs its face model less often (12 / s instead of every frame while the face moves) so the stream keeps its frame rate, and returns to full quality once the phone recovers. quality: never. saver: always.
Properties
-
gravixErrors
→ Stream<
String> -
Errors the native side reports while a camera runs, e.g.
E_CAMERA…(camera failed to start) orE_TRACKER: <state>: <message>(the face tracker could not start and fell back; statefailed= no face effects).E_TRACKER: not_installed: E_PACK_NOT_INSTALLED …= the optional effects pack is missing (see GravixEffects).no setter - gravixSupported → bool
-
True where the SDK runs (Android today). Elsewhere (iOS, web, desktop) every call throws
GravixException('E_UNSUPPORTED_PLATFORM')— check this and fall back to your normal camera.no setter
Exceptions / Errors
- GravixException
-
Typed failure from the native side (camera, WebRTC, GL, look loading). code is stable (
E_…).