// First-run gate. On a fresh install (no ~/.chain/config.yaml, no // setup-plan.yaml) the app opens INTO the setup instead of showing // the full shell with a wizard dialog on top — setup before the // app, not after. The guided-setup wizard renders embedded as the // page content; "Später einrichten" skips into the app for this // run (the gate returns on the next launch as long as nothing is // configured — the wizard IS the onboarding until then). import 'package:flutter/material.dart'; import '../l10n/app_localizations.dart'; import '../theme/tokens.dart'; import '../widgets/guided_setup_dialog.dart'; class SetupGateScreen extends StatelessWidget { /// Called when the operator finishes the setup or skips — the /// app swaps this screen for the normal shell. final VoidCallback onDone; const SetupGateScreen({super.key, required this.onDone}); @override Widget build(BuildContext context) { final theme = Theme.of(context); final l = AppLocalizations.of(context)!; return Scaffold( backgroundColor: theme.scaffoldBackgroundColor, body: Center( child: SingleChildScrollView( padding: const EdgeInsets.all(ChainSpace.xl), child: ConstrainedBox( constraints: const BoxConstraints(maxWidth: 560), child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( 'Ch∆In Studio', style: theme.textTheme.titleMedium?.copyWith( color: theme.colorScheme.primary, fontWeight: FontWeight.w700, ), ), const SizedBox(height: ChainSpace.xs), Text( l.setupGateIntro, style: theme.textTheme.bodyMedium?.copyWith( color: theme.colorScheme.onSurfaceVariant, ), ), const SizedBox(height: ChainSpace.lg), Container( padding: const EdgeInsets.all(ChainSpace.xl), decoration: BoxDecoration( color: theme.colorScheme.surfaceContainerLow, borderRadius: BorderRadius.circular(ChainRadius.md), border: Border.all( color: theme.colorScheme.outlineVariant, ), ), child: GuidedSetupDialog( embedded: true, onFinished: onDone, ), ), const SizedBox(height: ChainSpace.sm), Align( alignment: Alignment.centerRight, child: TextButton( onPressed: onDone, child: Text(l.setupGateSkip), ), ), ], ), ), ), ), ); } }