stac
1.6.0, released 2 months ago by stac.dev
A Server-Driven UI framework for Flutter that renders JSON payloads into native widgets.
What it does
Stac allows developers to build and update mobile or web user interfaces in real time via JSON payloads delivered from a server. It uses a Dart DSL to write UIs that compile into JSON and render natively on the client at runtime.
AI-written summary of version 1.6.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to ship UI changes and updates instantly without going through app store review cycles.
- You want to perform A/B testing or personalize layouts dynamically from a backend schema across Android, iOS, and Web.
Skip it when
- Your application requires highly complex custom native rendering logic that cannot easily be serialized into JSON.
- You need completely offline-first operations with zero network dependency for dynamic screen updates.
Strengths
- Instant over-the-air UI updates without updating the native client app.
- Familiar Dart DSL syntax that mirrors writing traditional Flutter code.
- Built-in network requests, form validation, and screen caching support.
Weaknesses
- Dependent on a backend infrastructure to supply the UI JSON schemas.
- Limited to the prebuilt components and registered custom widgets supported by the Stac framework.
Setup
- Kind
- Flutter widgets
- Effort
- Medium
- Code generation
- Yes (build_runner)
- Direct dependencies
- 9
Requires initializing Stac in main.dart via Stac.initialize() and setting up server endpoints to serve the dynamic UI JSON payloads.
void main() async {
await Stac.initialize();
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Stac(routeName: 'get_started'),
);
}
}Alternatives
Packages that do the same job and could replace stac.
- flutter_chat_ui
A customizable, cross‑platform chat UI widget set for Flutter.
90Compare - a2ui_flutter
Renders AI-generated A2UI surfaces as Flutter widgets.
84Compare - xwidget
Build dynamic UIs in Flutter using an expressive, XML based markup language.
65Compare - dynamic_widget
A backend-driven UI toolkit to build dynamic Flutter user interfaces using JSON.
49Compare
Works with
Packages commonly used together with stac: ones it builds on, ones built on it, and its own family.
- json_annotationstac depends on itProvides annotations for json_serializable to generate JSON (de)serialization code.
- shared_preferencesstac depends on itFlutter plugin for reading and writing simple key-value pairs. Wraps NSUserDefaults on iOS and SharedPreferences on Android.
- flutter_svgstac depends on itRenders Scalable Vector Graphics (SVG 1.1) and precompiled vector graphics in Flutter.
- diostac depends on itA powerful HTTP networking package for Dart and Flutter with interceptors and request cancellation.
- cached_network_imagestac depends on itLoad and cache network images in Flutter with placeholder and error widget support.
- stac_frameworkstac depends on itEnables easy creation of custom parsers for widgets and actions in server-driven UI implementations.
- stac_loggerstac depends on itLightweight logging utility for the Stac framework that works across all platforms.
- stac_corestac depends on itCore library for the Stac server‑driven UI framework, providing models, interfaces, and utilities.