stac 1.4.0
stac: ^1.4.0 copied to clipboard
Stac is a Server-Driven UI (SDUI) framework for Flutter. Stac allows you to build beautiful cross-platform applications with JSON in real time.
Website • Console • Quickstart • Documentation • Community & Support • GitHub
Stac #
Stac is a Server-Driven UI (SDUI) framework for Flutter. It lets you build and update your app's UI on the fly, without waiting for app store reviews! Instead of hard-coding everything in your app, you write your UI using Stac's intuitive Dart DSL. Your server then delivers this UI as a JSON payload, and Stac automatically renders it natively on the client at runtime.
Why use Stac?
- Ship instantly: Tweak your UI in Dart, push it to your server, and boom—your users see it immediately.
- A/B testing made easy: Try out different layouts or personalize the experience without rolling out a new app version.
- Build once: Keep your UI consistent across iOS, Android, and Web with a unified backend schema.
- Move faster: Let your backend dictate layouts directly without ever touching the client-side Flutter codebase.
Features 📦 #
- 🚀 Instant updates: Push UI changes straight from your server. No app store waiting rooms.
- 💻 Familiar Dart syntax: Write your server UI using our purely Dart DSL. It feels just like writing traditional Flutter code!
- 🧩 Native rendering: Stac translates your server's payload into lightning-fast native Flutter widgets on the client.
- 🧱 Prebuilt components: Comes with a massive library of ready-to-use standard Flutter widgets.
- 🌐 Network requests: Trigger API calls and manage data directly from your server payload.
- 🧭 Navigation: Control routing, open dialogs, and trigger bottom sheets from the backend.
- 📝 Forms & validation: We handle the messy form state and validation for you.
- 🎨 Dynamic theming: Change colors, fonts, and layouts on the fly using
StacTheme. - 💾 Smart caching: Built-in screen caching so your app feels blazing fast, even on flaky networks.
- 🛠️ Custom widgets: Need a custom chart or native integration? Easily build and register your own UI components.
Quick Start #
It's super easy to get started. You just need to initialize Stac and tell it which screen to load.
1. Initialize Stac #
Set up Stac in your app's main.dart and provide a routeName to fetch from your server.
import 'package:flutter/material.dart';
import 'package:stac/stac.dart';
// import 'package:my_app/default_stac_options.dart';
void main() async {
// Initialize Stac with optional custom configurations
await Stac.initialize(options: defaultStacOptions);
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Stac App',
// Pass a routeName to load your dynamic SDUI screen!
home: Stac(routeName: 'get_started'),
);
}
}
2. Write your UI #
You can author your screens using Stac's Dart package. It feels just like writing normal Flutter code, but it compiles down to JSON!
|
|
Documentation #
- 📚 Full Documentation – Complete guides and API reference
- 🚀 Quick Start – Get up and running in minutes
- 🛠️ Stac CLI – Command-line tools for development
- 🎛️ Stac Console – Web interface for managing your app
- 🤝 Contributing – Help build Stac
License #
This project is licensed under the MIT License - see the LICENSE file for details.
Join our community #
- 💬 Discord – Chat with the community and get help
- 🐙 GitHub – Report issues and contribute
- 🐦 X – Follow us for updates
Developed with 💙 by the Stac team and our amazing community