restage_core 2.0.0
restage_core: ^2.0.0 copied to clipboard
Cross-platform widget primitives (Container, Column, Row, Text, Image, and more) — a curated Remote Flutter Widgets (RFW) catalog for server-driven Flutter UI.
restage_core example #
restage_core is the curated cross-platform RFW widget catalog: layout,
structure, and decoration primitives (Container, Column, Row, Stack, Text,
Image, and more) for server-driven Flutter UI.
You author a surface in plain Flutter using these primitives, then a build step lowers it against the catalog into an inert render blob.
Author with core primitives #
import 'package:flutter/material.dart';
import 'package:restage/restage.dart';
@Paywall(id: 'pro')
final class ProSurface extends StatelessWidget {
const ProSurface({super.key});
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.all(24),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: const [
Text('Welcome'),
SizedBox(height: 8),
Text('Everything you need, in one place.'),
],
),
);
}
}
A build step lowers this standard Flutter tree to a render blob:
dart run build_runner build
The generated manifest at
lib/generated/restage.publication.json records the surface identity
and exact artifact closure. Push by surface id, then publish the pushed
revision:
restage surface push pro
restage surface publish pro
The same primitives compose any surface: paywalls, onboarding, messages, or
surveys. See the package README for the full widget set, and
apps/examples
for complete, runnable surfaces.