ssgen_flutter 7.0.0-beta.1
ssgen_flutter: ^7.0.0-beta.1 copied to clipboard
Live reload for SpriteStudio Player for Flutter: sswatch reconverts the projects you save in SpriteStudio and pushes them into the running app. A dev dependency.
ssgen_flutter #
Live-reload for SpriteStudio art: save a .sspj in your editor and watch the
running app swap the animation in place — no r, no restart, no rebuild.
Dev tooling only. The host runner (sswatch) watches your sources,
reconverts what went stale through ssgen_dart, and pushes the
fresh pack into the running app over the VM Service, where
ssplayer_flutter hands it to the player's reload. The
app never imports this package, and the runtime stays converter-free: the
receiving end comes up only in a debug build launched for it.
Install #
flutter pub add --dev ssgen_flutter
ssplayer_flutter, ssgen_dart, ssconverter_dart and ssruntime_dart come with it — see
Installation.
Use #
There is nothing to add to the app. A player that loads its pack by asset key —
every SpriteStudioAnimation, and SpriteStudioPlayer.loadAsset — takes the
push by itself. Run the watcher — one tool, one mechanism; you only choose how
the app is launched:
dart run ssgen_flutter:sswatch --run -d macos # desktop
dart run ssgen_flutter:sswatch --run -d <emulator> --device # device
Notes #
- A device cannot convert on-device, so
sswatchconverts on the host and sends an embedded.ssabas bytes. - It is opt-in at build time. Apps gate on the
SS_LIVE_RELOAD--dart-define(ssLiveReloadDefine);sswatch --runinjects it, so a release build carries none of this. - The push channel is the VM Service (
ext.ssgen.reload), which is why this works from an IDE debugger session as well as from--run. - On macOS desktop the debug build must run unsandboxed. The file push hands the app a host path
outside its container, so with the default App Sandbox it reloads 0 players and reports no error.
Set
com.apple.security.app-sandboxtofalseinmacos/Runner/DebugProfile.entitlements(debug only; Release keeps the sandbox), or add--device, whose bytes travel over the VM Service. - A player loaded from bytes has no asset key to be found by. Mix
ssplayer_flutter'sSsLiveReloadinto theStatethat owns it — which also lets a screen react to the reload.
More #
- Live reload — the full setup
- Live Web demos
- Repository