screenstack_sdk 4.1.0
screenstack_sdk: ^4.1.0 copied to clipboard
In-app screenshot and widget-layer capture for Flutter apps, driven by the ScreenStack CLI in CI. Produces store screenshots and showcase layers for ScreenStack canvases.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
void main() => runApp(const ExampleApp());
class ExampleApp extends StatefulWidget {
const ExampleApp({super.key});
@override
State<ExampleApp> createState() => _ExampleAppState();
}
class _ExampleAppState extends State<ExampleApp> {
late final GoRouter _router = GoRouter(
routes: [
GoRoute(path: '/', builder: (context, state) => const _HomePage()),
GoRoute(path: '/stats', builder: (context, state) => const _StatsPage()),
],
);
@override
Widget build(BuildContext context) {
return MaterialApp.router(
routerConfig: _router,
debugShowCheckedModeBanner: false,
theme: ThemeData(colorSchemeSeed: Colors.indigo),
darkTheme: ThemeData(
colorSchemeSeed: Colors.indigo,
brightness: Brightness.dark,
),
);
}
}
class _HomePage extends StatelessWidget {
const _HomePage();
@override
Widget build(BuildContext context) {
final locale = Localizations.localeOf(context).toLanguageTag();
return Scaffold(
key: const ValueKey('home_screen'),
appBar: AppBar(title: const Text('Today')),
body: Center(child: Text('Locale: $locale')),
floatingActionButton: FloatingActionButton.extended(
onPressed: () => context.go('/stats'),
label: const Text('Stats'),
),
);
}
}
class _StatsPage extends StatelessWidget {
const _StatsPage();
@override
Widget build(BuildContext context) {
return Scaffold(
key: const ValueKey('stats_screen'),
appBar: AppBar(title: const Text('Stats')),
body: ListView(
padding: const EdgeInsets.all(24),
children: const [
RepaintBoundary(
key: ValueKey('streak_card'),
child: Card(
child: Padding(
padding: EdgeInsets.all(24),
child: Text('12 day streak', style: TextStyle(fontSize: 28)),
),
),
),
],
),
);
}
}