feat(app): register native Settings on the shared live session

This commit is contained in:
2026-10-21 18:55:50 +01:00
parent 7b327f012b
commit d05aa0cfbc
15 changed files with 278 additions and 54 deletions
@@ -26,7 +26,6 @@ class SettingsConnectionSection extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
@@ -64,18 +63,14 @@ class SettingsConnectionSection extends StatelessWidget {
const SizedBox(height: settingsFieldGap),
Text(
controller.endpointSaveError,
style: theme.textTheme.bodySmall?.copyWith(
color: theme.colorScheme.error,
),
style: settingsTextStyle(context, error: true),
),
],
if (controller.actionError.isNotEmpty) ...<Widget>[
const SizedBox(height: settingsFieldGap),
Text(
controller.actionError,
style: theme.textTheme.bodySmall?.copyWith(
color: theme.colorScheme.error,
),
style: settingsTextStyle(context, error: true),
),
],
const SizedBox(height: settingsTitleGap),
@@ -102,13 +97,19 @@ class SettingsStatusCard extends StatelessWidget {
final title = lines.isEmpty ? '' : lines.first;
final details = lines.length > 1 ? lines.sublist(1) : const <String>[];
final titleColor = switch (state.kind) {
transport.ConnectionKind.connected => theme.colorScheme.primary,
transport.ConnectionKind.disconnected => theme.colorScheme.error,
_ => theme.colorScheme.onSurface,
transport.ConnectionKind.connected =>
usesCupertinoControls(context)
? CupertinoTheme.of(context).primaryColor
: theme.colorScheme.primary,
transport.ConnectionKind.disconnected => settingsErrorColor(context),
_ => settingsTextStyle(context).color,
};
final titleWidget = Text(
title,
style: theme.textTheme.titleMedium?.copyWith(color: titleColor),
style: settingsTextStyle(
context,
title: true,
).copyWith(color: titleColor),
);
return SettingsCard(
child: Column(
@@ -129,12 +130,7 @@ class SettingsStatusCard extends StatelessWidget {
titleWidget,
for (final line in details) ...<Widget>[
const SizedBox(height: settingsFieldGap),
Text(
line,
style: theme.textTheme.bodyMedium?.copyWith(
color: theme.colorScheme.onSurfaceVariant,
),
),
Text(line, style: settingsTextStyle(context, secondary: true)),
],
],
),
@@ -156,7 +152,6 @@ class SettingsWorkspaceSection extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final saveError = controller.workspaceSaveError;
final canSave = canSaveWorkspace(controller.workspaceDraft);
return Column(
@@ -193,16 +188,11 @@ class SettingsWorkspaceSection extends StatelessWidget {
const SizedBox(height: settingsFieldGap),
Text(
savedWorkspaceLine(controller.savedWorkspace),
style: theme.textTheme.bodyMedium,
style: settingsTextStyle(context),
),
if (saveError.isNotEmpty) ...<Widget>[
const SizedBox(height: settingsFieldGap),
Text(
saveError,
style: theme.textTheme.bodySmall?.copyWith(
color: theme.colorScheme.error,
),
),
Text(saveError, style: settingsTextStyle(context, error: true)),
],
],
);