Build a settings screen
Use Remix CLI recipes to build, customize, and test a Flutter settings screen
Build Launchpad, a desktop-browser settings screen with a form, save state, dialog, and sidebar. You write the application; the CLI installs editable component recipes and their theme.

The finished screenshot includes the medium Button height edit below. It is an application example, not a screen the CLI generates for you.
This walkthrough includes the complete application and test source below.
The sample download contains
both projects, generated adapters, and their tests. Its default_demo directory
holds the Vanilla project.
Before you start
Use Flutter 3.44 or newer, which bundles Dart 3.12, Git, and a desktop browser.
Check your SDK with flutter --version. The samples use local state, with no
backend or responsive mobile layout. Both hosts explicitly use Geist from
remix_ui_fonts, so app text and owned recipes share a reproducible font.
Prepare the project and CLI
In the directory where you keep applications:
flutter create --empty --platforms=web remix_default_demo
cd remix_default_demoInstall the CLI release candidate globally and confirm its version:
dart pub global activate remix_cli '^1.0.0-rc.1'
remix --versionAdd Pub's bin directory to PATH if needed; Pub prints the instructions.
The printed version should satisfy the release-candidate constraint above. Keep running CLI
commands from the project root, beside pubspec.yaml.
Initialize and install Button
remix init --prefix Acme --preset vanillaAcme controls local names such as AcmeButton and acmeButtonStyle.
Initialization resolves the official registry's stable branch to a commit,
records it in remix.yaml, and writes a managed barrel at lib/ui/ui.dart.
It does not install a component yet.
Preview the first install:
remix add button --dry-runThe plan should install theme before button and list the dependencies the
CLI will add, including remix and remix_ui_fonts. No source is written by
--dry-run. Install when the plan matches:
remix add buttonInspect lib/ui/components/button.dart, the recipe you own, and
button.g.dart, the adapter produced by the generator. Edit the recipe, not
the generated file. The CLI also adds the required dependencies and exports.
Render the first button
Replace lib/main.dart with this complete example:
import 'package:flutter/widgets.dart';
import 'ui/ui.dart';
void main() => runApp(const AcmeApp());
class AcmeApp extends StatelessWidget {
const AcmeApp({super.key});
@override
Widget build(BuildContext context) {
return WidgetsApp(
color: const Color(0xFF000000),
builder: (_, _) => Overlay(
initialEntries: [
OverlayEntry(
builder: (_) => const AcmeTheme(
theme: AcmeThemeData.light(),
child: HomePage(),
),
),
],
),
);
}
}
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
final theme = AcmeTheme.of(context);
return ColoredBox(
color: theme.background,
child: Center(
child: AcmeButton.primary(
label: 'Continue',
onPressed: () {},
),
),
);
}
}flutter run -d chrome
You should see Continue centered in the app. Its callback is deliberately empty at this stage. Keep this terminal open; use another terminal in the same sample directory for the remaining CLI commands.
Build the settings screen
Install the remaining recipes, one item per command:
remix add checkbox
remix add textfield
remix add dialog
remix add card
remix add sidebar
remix add sidebar_layoutThe existing theme is preserved. Sidebar also installs its toggle and
tooltip dependencies. Sidebar Layout is a plain shell layout with no Spec
and no generated adapter. It pairs an installed sidebar with a header and body,
and switches to a start-edge sheet below its compact breakpoint. Each command
updates the barrel and generates the needed adapters.
Replace your application's lib/main.dart with the complete Vanilla source below.
The same file is default_demo/lib/main.dart in the
sample download.
Keep your CLI-installed lib/ui files; the next step changes one of them.
import 'package:flutter/material.dart';
import 'package:remix/remix.dart';
import 'package:remix_ui_fonts/remix_ui_fonts.dart';
import 'ui/ui.dart';
void main() => runApp(const SampleApp());
class SampleApp extends StatefulWidget {
const SampleApp({super.key});
@override
State<SampleApp> createState() => _SampleAppState();
}
class _SampleAppState extends State<SampleApp> {
AcmeThemeMode mode = AcmeThemeMode.system;
@override
Widget build(BuildContext context) {
return WidgetsApp(
title: 'Launchpad — vanilla preset',
color: const Color(0xFFF8FAFC),
debugShowCheckedModeBanner: false,
pageRouteBuilder: <T>(settings, builder) => PageRouteBuilder<T>(
settings: settings,
pageBuilder: (context, animation, secondaryAnimation) =>
builder(context),
),
builder: (context, child) => AcmeTheme(
theme: const AcmeThemeData.light(),
darkTheme: const AcmeThemeData.dark(),
mode: mode,
child: Builder(
builder: (context) {
final dark = AcmeTheme.of(context).brightness == Brightness.dark;
return DefaultTextStyle(
style: TextStyle(
fontFamily: RemixFonts.geist,
fontSize: 14,
color: dark ? const Color(0xFFF1F1F1) : const Color(0xFF202020),
),
child: child!,
);
},
),
),
home: Builder(
builder: (context) {
final dark = AcmeTheme.of(context).brightness == Brightness.dark;
return WorkspacePage(
dark: dark,
onTheme: () => setState(
() => mode = dark ? AcmeThemeMode.light : AcmeThemeMode.dark,
),
);
},
),
);
}
}
class WorkspacePage extends StatefulWidget {
const WorkspacePage({super.key, required this.dark, required this.onTheme});
final bool dark;
final VoidCallback onTheme;
@override
State<WorkspacePage> createState() => _WorkspacePageState();
}
class _WorkspacePageState extends State<WorkspacePage> {
final name = TextEditingController(text: 'Launchpad');
bool summary = true;
bool saving = false;
int saves = 0;
String destination = 'settings';
String status = 'No changes saved yet.';
@override
void dispose() {
name.dispose();
super.dispose();
}
Future<void> save() async {
setState(() => saving = true);
await Future<void>.delayed(const Duration(milliseconds: 1500));
if (!mounted) return;
setState(() {
saving = false;
saves += 1;
status =
'Saved ${name.text}. Save count: $saves. Summary: ${summary ? 'on' : 'off'}.';
});
}
Future<void> invite() async {
final confirmed = await showRemixDialog<bool>(
context: context,
barrierLabel: 'Close invitation preview',
builder: (context) => Center(
child: AcmeDialog(
title: 'Invite a teammate',
description:
'This sample records your choice locally. It sends no invitation.',
actions: [
AcmeButton.outline(
label: 'Cancel',
onPressed: () => Navigator.pop(context, false),
),
AcmeButton.primary(
label: 'Confirm',
onPressed: () => Navigator.pop(context, true),
),
],
),
),
);
if (confirmed == true && mounted) {
setState(() => status = 'Invitation confirmed in this sample.');
}
}
@override
Widget build(BuildContext context) {
final foreground = widget.dark
? const Color(0xFFFAFAFA)
: const Color(0xFF171717);
final muted = widget.dark
? const Color(0xFFA3A3A3)
: const Color(0xFF737373);
final background = widget.dark
? const Color(0xFF0A0A0A)
: const Color(0xFFFAFAFA);
return DefaultTextStyle(
style: TextStyle(
fontFamily: RemixFonts.geist,
color: foreground,
fontSize: 15,
height: 1.5,
),
child: ColoredBox(
color: background,
child: SafeArea(
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
SizedBox(
width: 230,
child: AcmeSidebar<String>(
semanticLabel: 'Workspace navigation',
style: SidebarStyler().sectionLabel(
TextStyler().fontFamily(RemixFonts.geist),
),
header: const Padding(
padding: EdgeInsets.all(24),
child: Text(
'LAUNCHPAD',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w700,
letterSpacing: 2,
),
),
),
sections: const [
RemixSidebarSection(
label: 'WORKSPACE',
destinations: [
RemixSidebarDestination(
value: 'overview',
label: 'Overview',
),
RemixSidebarDestination(
value: 'settings',
label: 'Settings',
),
RemixSidebarDestination(
value: 'billing',
label: 'Billing',
enabled: false,
),
],
),
],
selectedValue: destination,
onSelected: (value) => setState(() => destination = value),
footer: Text(
'vanilla preset\nApplication-owned source',
style: TextStyle(fontSize: 12, color: muted),
),
),
),
Expanded(
child: SingleChildScrollView(
padding: const EdgeInsets.symmetric(
horizontal: 48,
vertical: 44,
),
child: Align(
alignment: Alignment.topLeft,
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 820),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Row(
children: [
Expanded(
child: Text(
'WORKSPACE / ${destination.toUpperCase()}',
style: TextStyle(
color: muted,
fontSize: 12,
letterSpacing: 1.5,
),
),
),
AcmeButton.outline(
label: widget.dark
? 'Use light theme'
: 'Use dark theme',
onPressed: widget.onTheme,
),
],
),
const SizedBox(height: 32),
Text(
destination == 'settings'
? 'Workspace settings'
: 'Workspace overview',
style: const TextStyle(
fontSize: 36,
fontWeight: FontWeight.w600,
height: 1.2,
),
),
const SizedBox(height: 12),
Text(
'A real Flutter application built from the vanilla preset.',
style: TextStyle(color: muted),
),
const SizedBox(height: 32),
AcmeCard(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const Text(
'General',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
const SizedBox(height: 8),
Text(
'Set the workspace name and your email preference.',
style: TextStyle(color: muted),
),
const SizedBox(height: 24),
AcmeTextField(
controller: name,
label: 'Workspace name',
semanticLabel: 'Workspace name',
helperText:
'The application owns this text field recipe.',
),
const SizedBox(height: 16),
AcmeCheckbox(
label: 'Send a weekly summary',
selected: summary,
onChanged: (value) =>
setState(() => summary = value ?? false),
),
const SizedBox(height: 24),
Wrap(
spacing: 12,
runSpacing: 12,
children: [
AcmeButton.primary(
label: 'Save changes',
loading: saving,
onPressed: save,
),
AcmeButton.outline(
label: 'Preview invitation',
onPressed: invite,
),
AcmeButton.outline(
label: 'Delete workspace',
enabled: false,
onPressed: () => setState(
() => status =
'ERROR: disabled action ran.',
),
),
],
),
const SizedBox(height: 20),
Semantics(
liveRegion: true,
child: Text(
status,
style: TextStyle(
color: muted,
fontSize: 13,
),
),
),
],
),
),
const SizedBox(height: 24),
AcmeCard(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'One instance override',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
const SizedBox(height: 8),
Text(
'This button uses the same recipe with a local style override.',
style: TextStyle(color: muted),
),
const SizedBox(height: 20),
AcmeButton.primary(
label: 'Run preview',
style: ButtonStyler()
.color(const Color(0xFF0E7490))
.label(.color(const Color(0xFFFFFFFF)))
.onPressed(
ButtonStyler().color(
const Color(0xFF164E63),
),
)
.onHovered(
ButtonStyler().color(
const Color(0xFF155E75),
),
)
.borderRadius(
.all(const Radius.circular(999)),
),
onPressed: () => setState(
() => status =
'Preview completed. The instance override keeps the callback.',
),
),
],
),
),
const SizedBox(height: 24),
Text(
'Source: lib/ui/ · Config: remix.yaml · Preset: vanilla',
style: TextStyle(color: muted, fontSize: 12),
),
],
),
),
),
),
),
],
),
),
),
);
}
}The complete app owns the form values, save counter, loading flag, dialog
result, and sidebar selection. It uses WidgetsApp with a Navigator as the application host.
Keep its host builder and scope placement together: the text field needs an
overlay, and the dialog needs the invoking context's navigator and text defaults.
Customize your recipe
Open lib/ui/components/button.dart. In _metricsFor, change the medium
minHeight from AcmeTokens.controlMd (36 pixels) to 44.0:
.medium => (
minHeight: 44.0,
paddingX: AcmeTokens.s4,
gap: AcmeTokens.s2,
),Reload the app. All medium default buttons should use the taller recipe, while the cyan preview button keeps its instance-specific colors and rounded shape.
This changes a recipe value, not the generated widget signature. If you change recipe parameters, enums, or annotations, regenerate the adapter as described in the customization reference.
Check behavior and preserve edits
- Reload to reset local state. Enter Launchpad Studio as the workspace name.
- Clear Send a weekly summary, then press Save changes twice while loading.
- Confirm Save count: 1 and Summary: off when the save completes.
- Open and confirm the invitation dialog. Check that its result reaches the screen.
- Change the sidebar selection and test the preview button's callback.

Now compare your edited Button with its registry recipe:
remix add button --diffThe diff's current side contains your 44.0 edit; proposed contains the
registry token AcmeTokens.controlMd. The command does not replace your source. Repeat ordinary add:
remix add buttonConfirm the medium height remains 44.0. --overwrite is an explicit
replacement operation; do not use it to inspect an update. See
source-preservation details before trying it.
Try Fortal separately
Do not switch the Vanilla project's preset. From its directory, create a second application:
cd ..
flutter create --empty --platforms=web remix_fortal_demo
cd remix_fortal_demoInitialize Fortal and install its recipes using the same global CLI. The Fortal theme
does not depend on remix_ui_fonts, so the last command adds Geist for the
application:
remix init --prefix Acme --preset fortal
remix add button
remix add checkbox
remix add textfield
remix add dialog
remix add card
remix add sidebar
remix add sidebar_layout
flutter pub add 'remix_ui_fonts:^0.1.0'Replace this app's lib/main.dart with the complete Fortal source below, also
available as fortal_demo/lib/main.dart in the download.
import 'package:flutter/material.dart';
import 'package:remix/remix.dart';
import 'package:remix_ui_fonts/remix_ui_fonts.dart';
import 'ui/ui.dart';
void main() => runApp(const SampleApp());
class SampleApp extends StatefulWidget {
const SampleApp({super.key});
@override
State<SampleApp> createState() => _SampleAppState();
}
class _SampleAppState extends State<SampleApp> {
AcmeThemeMode mode = AcmeThemeMode.system;
@override
Widget build(BuildContext context) {
return WidgetsApp(
title: 'Launchpad — fortal preset',
color: const Color(0xFFF8FAFC),
debugShowCheckedModeBanner: false,
pageRouteBuilder: <T>(settings, builder) => PageRouteBuilder<T>(
settings: settings,
pageBuilder: (context, animation, secondaryAnimation) =>
builder(context),
),
builder: (context, child) => AcmeTheme(
theme: const AcmeThemeData.light(accent: AcmeAccentColor.mar),
darkTheme: const AcmeThemeData.dark(accent: AcmeAccentColor.mar),
mode: mode,
child: Builder(
builder: (context) {
final dark = AcmeTheme.of(context).brightness == Brightness.dark;
return DefaultTextStyle(
style: TextStyle(
fontFamily: RemixFonts.geist,
fontSize: 14,
color: dark ? const Color(0xFFF1F1F1) : const Color(0xFF202020),
),
child: child!,
);
},
),
),
home: Builder(
builder: (context) {
final dark = AcmeTheme.of(context).brightness == Brightness.dark;
return WorkspacePage(
dark: dark,
onTheme: () => setState(
() => mode = dark ? AcmeThemeMode.light : AcmeThemeMode.dark,
),
);
},
),
);
}
}
class WorkspacePage extends StatefulWidget {
const WorkspacePage({super.key, required this.dark, required this.onTheme});
final bool dark;
final VoidCallback onTheme;
@override
State<WorkspacePage> createState() => _WorkspacePageState();
}
class _WorkspacePageState extends State<WorkspacePage> {
final name = TextEditingController(text: 'Launchpad');
bool summary = true;
bool saving = false;
int saves = 0;
String destination = 'settings';
String status = 'No changes saved yet.';
@override
void dispose() {
name.dispose();
super.dispose();
}
Future<void> save() async {
setState(() => saving = true);
await Future<void>.delayed(const Duration(milliseconds: 1500));
if (!mounted) return;
setState(() {
saving = false;
saves += 1;
status =
'Saved ${name.text}. Save count: $saves. Summary: ${summary ? 'on' : 'off'}.';
});
}
Future<void> invite() async {
final confirmed = await showRemixDialog<bool>(
context: context,
barrierLabel: 'Close invitation preview',
builder: (context) => Center(
child: AcmeDialog(
title: 'Invite a teammate',
description:
'This sample records your choice locally. It sends no invitation.',
actions: [
AcmeButton.outline(
label: 'Cancel',
onPressed: () => Navigator.pop(context, false),
),
AcmeButton.solid(
label: 'Confirm',
onPressed: () => Navigator.pop(context, true),
),
],
),
),
);
if (confirmed == true && mounted) {
setState(() => status = 'Invitation confirmed in this sample.');
}
}
@override
Widget build(BuildContext context) {
final foreground = widget.dark
? const Color(0xFFFAFAFA)
: const Color(0xFF171717);
final muted = widget.dark
? const Color(0xFFA3A3A3)
: const Color(0xFF737373);
final background = widget.dark
? const Color(0xFF0A0A0A)
: const Color(0xFFFAFAFA);
return DefaultTextStyle(
style: TextStyle(
fontFamily: RemixFonts.geist,
color: foreground,
fontSize: 15,
height: 1.5,
),
child: ColoredBox(
color: background,
child: SafeArea(
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
SizedBox(
width: 230,
child: AcmeSidebar<String>(
semanticLabel: 'Workspace navigation',
style: SidebarStyler().sectionLabel(
TextStyler().fontFamily(RemixFonts.geist),
),
header: const Padding(
padding: EdgeInsets.all(24),
child: Text(
'LAUNCHPAD',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w700,
letterSpacing: 2,
),
),
),
sections: const [
RemixSidebarSection(
label: 'WORKSPACE',
destinations: [
RemixSidebarDestination(
value: 'overview',
label: 'Overview',
),
RemixSidebarDestination(
value: 'settings',
label: 'Settings',
),
RemixSidebarDestination(
value: 'billing',
label: 'Billing',
enabled: false,
),
],
),
],
selectedValue: destination,
onSelected: (value) => setState(() => destination = value),
footer: Text(
'fortal preset\nApplication-owned source',
style: TextStyle(fontSize: 12, color: muted),
),
),
),
Expanded(
child: SingleChildScrollView(
padding: const EdgeInsets.symmetric(
horizontal: 48,
vertical: 44,
),
child: Align(
alignment: Alignment.topLeft,
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 820),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Row(
children: [
Expanded(
child: Text(
'WORKSPACE / ${destination.toUpperCase()}',
style: TextStyle(
color: muted,
fontSize: 12,
letterSpacing: 1.5,
),
),
),
AcmeButton.outline(
label: widget.dark
? 'Use light theme'
: 'Use dark theme',
onPressed: widget.onTheme,
),
],
),
const SizedBox(height: 32),
Text(
destination == 'settings'
? 'Workspace settings'
: 'Workspace overview',
style: const TextStyle(
fontSize: 36,
fontWeight: FontWeight.w600,
height: 1.2,
),
),
const SizedBox(height: 12),
Text(
'A real Flutter application built from the fortal preset.',
style: TextStyle(color: muted),
),
const SizedBox(height: 32),
AcmeCard(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const Text(
'General',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
const SizedBox(height: 8),
Text(
'Set the workspace name and your email preference.',
style: TextStyle(color: muted),
),
const SizedBox(height: 24),
AcmeTextField(
controller: name,
label: 'Workspace name',
semanticLabel: 'Workspace name',
helperText:
'The application owns this text field recipe.',
),
const SizedBox(height: 16),
AcmeCheckbox(
label: 'Send a weekly summary',
selected: summary,
onChanged: (value) =>
setState(() => summary = value ?? false),
),
const SizedBox(height: 24),
Wrap(
spacing: 12,
runSpacing: 12,
children: [
AcmeButton.solid(
label: 'Save changes',
loading: saving,
onPressed: save,
),
AcmeButton.outline(
label: 'Preview invitation',
onPressed: invite,
),
AcmeButton.outline(
label: 'Delete workspace',
enabled: false,
onPressed: () => setState(
() => status =
'ERROR: disabled action ran.',
),
),
],
),
const SizedBox(height: 20),
Semantics(
liveRegion: true,
child: Text(
status,
style: TextStyle(
color: muted,
fontSize: 13,
),
),
),
],
),
),
const SizedBox(height: 24),
AcmeCard(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'One instance override',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
const SizedBox(height: 8),
Text(
'This button uses the same recipe with a local style override.',
style: TextStyle(color: muted),
),
const SizedBox(height: 20),
AcmeButton.solid(
label: 'Run preview',
style: ButtonStyler()
.color(const Color(0xFF0E7490))
.label(.color(const Color(0xFFFFFFFF)))
.onPressed(
ButtonStyler().color(
const Color(0xFF164E63),
),
)
.onHovered(
ButtonStyler().color(
const Color(0xFF155E75),
),
)
.borderRadius(
.all(const Radius.circular(999)),
),
onPressed: () => setState(
() => status =
'Preview completed. The instance override keeps the callback.',
),
),
],
),
),
const SizedBox(height: 24),
Text(
'Source: lib/ui/ · Config: remix.yaml · Preset: fortal',
style: TextStyle(color: muted, fontSize: 12),
),
],
),
),
),
),
),
],
),
),
),
);
}
}The Fortal example uses AcmeTheme with the Mar accent and AcmeButton.solid,
rather than AcmeButton.primary. Keep its complete host configuration.
Do not apply the Vanilla preset's Button metrics edit to Fortal.

Fortal supplies a different theme and recipe vocabulary, not a second runtime
for your form. Repeat the same behavior checks. Neither preset adds a
remix_fortal package dependency to the consumer application.
Run the tests
Copy test/workflow_test.dart from the matching downloaded project into each
sample. Keep the project names used above; the tests import those names.
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:remix_default_demo/main.dart';
void main() {
Future<void> start(WidgetTester tester) async {
tester.view.physicalSize = const Size(1400, 1000);
tester.view.devicePixelRatio = 1;
addTearDown(tester.view.resetPhysicalSize);
addTearDown(tester.view.resetDevicePixelRatio);
await tester.pumpWidget(const SampleApp());
await tester.pumpAndSettle();
expect(find.byType(WidgetsApp), findsOneWidget);
expect(find.byType(MaterialApp), findsNothing);
}
testWidgets(
'the form saves once while loading and keeps the entered values',
(tester) async {
await start(tester);
await tester.enterText(find.byType(EditableText), 'Launchpad Studio');
await tester.tap(find.text('Send a weekly summary'));
await tester.tap(find.text('Save changes'));
await tester.pump(const Duration(milliseconds: 100));
expect(find.textContaining('Save count:'), findsNothing);
await tester.tap(find.text('Save changes'), warnIfMissed: false);
await tester.pump(const Duration(milliseconds: 1600));
await tester.pumpAndSettle();
expect(
find.text('Saved Launchpad Studio. Save count: 1. Summary: off.'),
findsOneWidget,
);
expect(tester.takeException(), isNull);
},
);
testWidgets(
'disabled actions stay inactive and the instance override works',
(tester) async {
await start(tester);
await tester.tap(find.text('Delete workspace'), warnIfMissed: false);
await tester.pumpAndSettle();
expect(find.text('ERROR: disabled action ran.'), findsNothing);
await tester.tap(find.text('Run preview'));
await tester.pumpAndSettle();
expect(
find.text(
'Preview completed. The instance override keeps the callback.',
),
findsOneWidget,
);
expect(tester.takeException(), isNull);
},
);
testWidgets(
'the dialog returns its result and the theme changes at runtime',
(tester) async {
await start(tester);
await tester.tap(find.text('Use dark theme'));
await tester.pumpAndSettle();
expect(find.text('Use light theme'), findsOneWidget);
await tester.tap(find.text('Preview invitation'));
await tester.pumpAndSettle();
expect(find.text('Invite a teammate'), findsOneWidget);
final title = tester.renderObject<RenderParagraph>(
find.text('Invite a teammate'),
);
expect(
title.text.style?.decoration?.contains(TextDecoration.underline) ??
false,
isFalse,
);
await tester.tap(find.text('Confirm'));
await tester.pumpAndSettle();
expect(find.text('Invite a teammate'), findsNothing);
expect(find.text('Invitation confirmed in this sample.'), findsOneWidget);
expect(tester.takeException(), isNull);
},
);
testWidgets(
'Sidebar changes the destination and skips the disabled destination',
(tester) async {
await start(tester);
await tester.tap(find.text('Overview'));
await tester.pumpAndSettle();
expect(find.text('Workspace overview'), findsOneWidget);
await tester.tap(find.text('Billing'), warnIfMissed: false);
await tester.pumpAndSettle();
expect(find.text('Workspace overview'), findsOneWidget);
expect(tester.takeException(), isNull);
},
);
}import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:remix_fortal_demo/main.dart';
void main() {
Future<void> start(WidgetTester tester) async {
tester.view.physicalSize = const Size(1400, 1000);
tester.view.devicePixelRatio = 1;
addTearDown(tester.view.resetPhysicalSize);
addTearDown(tester.view.resetDevicePixelRatio);
await tester.pumpWidget(const SampleApp());
await tester.pumpAndSettle();
expect(find.byType(WidgetsApp), findsOneWidget);
expect(find.byType(MaterialApp), findsNothing);
}
testWidgets(
'the form saves once while loading and keeps the entered values',
(tester) async {
await start(tester);
await tester.enterText(find.byType(EditableText), 'Launchpad Studio');
await tester.tap(find.text('Send a weekly summary'));
await tester.tap(find.text('Save changes'));
await tester.pump(const Duration(milliseconds: 100));
expect(find.textContaining('Save count:'), findsNothing);
await tester.tap(find.text('Save changes'), warnIfMissed: false);
await tester.pump(const Duration(milliseconds: 1600));
await tester.pumpAndSettle();
expect(
find.text('Saved Launchpad Studio. Save count: 1. Summary: off.'),
findsOneWidget,
);
expect(tester.takeException(), isNull);
},
);
testWidgets(
'disabled actions stay inactive and the instance override works',
(tester) async {
await start(tester);
await tester.tap(find.text('Delete workspace'), warnIfMissed: false);
await tester.pumpAndSettle();
expect(find.text('ERROR: disabled action ran.'), findsNothing);
await tester.tap(find.text('Run preview'));
await tester.pumpAndSettle();
expect(
find.text(
'Preview completed. The instance override keeps the callback.',
),
findsOneWidget,
);
expect(tester.takeException(), isNull);
},
);
testWidgets(
'the dialog returns its result and the theme changes at runtime',
(tester) async {
await start(tester);
await tester.tap(find.text('Use dark theme'));
await tester.pumpAndSettle();
expect(find.text('Use light theme'), findsOneWidget);
await tester.tap(find.text('Preview invitation'));
await tester.pumpAndSettle();
expect(find.text('Invite a teammate'), findsOneWidget);
final title = tester.renderObject<RenderParagraph>(
find.text('Invite a teammate'),
);
expect(
title.text.style?.decoration?.contains(TextDecoration.underline) ??
false,
isFalse,
);
await tester.tap(find.text('Confirm'));
await tester.pumpAndSettle();
expect(find.text('Invite a teammate'), findsNothing);
expect(find.text('Invitation confirmed in this sample.'), findsOneWidget);
expect(tester.takeException(), isNull);
},
);
testWidgets(
'Sidebar changes the destination and skips the disabled destination',
(tester) async {
await start(tester);
await tester.tap(find.text('Overview'));
await tester.pumpAndSettle();
expect(find.text('Workspace overview'), findsOneWidget);
await tester.tap(find.text('Billing'), warnIfMissed: false);
await tester.pumpAndSettle();
expect(find.text('Workspace overview'), findsOneWidget);
expect(tester.takeException(), isNull);
},
);
}Replace analysis_options.yaml with the reviewed configuration:
include: package:flutter_lints/flutter.yaml
analyzer:
exclude:
- lib/ui/**/*.g.dartThis excludes generated adapters from lint findings, not your authored recipes. Run from each sample directory:
flutter analyze
flutter test
flutter build web --releaseThe four workflow tests cover form and save behavior, disabled controls, callbacks, dialog results and text decoration, and sidebar selection. The download also carries theme-mode tests for each sample. Fix failures before treating a screenshot as evidence that the sample works.
Troubleshooting
- Pub cannot resolve
remix_cli: the CLI needs Dart 3.12. Check thatflutter --versionreports Flutter 3.44 or newer. - Missing generated class: inspect the add command's generation error and the recipe's
partdeclaration. - Missing overlay or incorrect dialog text: restore the complete sample's application host and scope placement.
- No
primaryconstructor: use the Vanilla sample, selected with--preset vanilla, or thesolidconstructor withfortal.
See the CLI reference for configuration and command details.