feat(app): register the saved-schedule list under Settings at /schedules
This commit is contained in:
@@ -10,4 +10,5 @@ abstract final class SettingsKeys {
|
||||
static const workspace = ValueKey<String>('settings.workspace');
|
||||
static const saveWorkspace = ValueKey<String>('settings.saveWorkspace');
|
||||
static const templates = ValueKey<String>('settings.templates');
|
||||
static const schedules = ValueKey<String>('settings.schedules');
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'settings_keys.dart';
|
||||
import 'settings_theme.dart';
|
||||
|
||||
/// The Settings entry to the saved-schedule list.
|
||||
///
|
||||
/// The row only opens the route; the list's own controller performs the single
|
||||
/// `list_schedules` read, exactly like the Templates entry.
|
||||
const String settingsSchedulesLabel = 'Browse schedules';
|
||||
const String settingsSchedulesSecondary =
|
||||
'Saved run configurations for every pipeline.';
|
||||
|
||||
class SettingsSchedulesSection extends StatelessWidget {
|
||||
const SettingsSchedulesSection({super.key, required this.onOpen});
|
||||
|
||||
final VoidCallback onOpen;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (usesCupertinoControls(context)) {
|
||||
return CupertinoListSection.insetGrouped(
|
||||
margin: EdgeInsets.zero,
|
||||
children: <Widget>[
|
||||
CupertinoListTile(
|
||||
key: SettingsKeys.schedules,
|
||||
title: const Text(settingsSchedulesLabel),
|
||||
subtitle: const Text(settingsSchedulesSecondary),
|
||||
trailing: const CupertinoListTileChevron(),
|
||||
onTap: onOpen,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
return Card(
|
||||
margin: EdgeInsets.zero,
|
||||
child: ListTile(
|
||||
key: SettingsKeys.schedules,
|
||||
title: const Text(settingsSchedulesLabel),
|
||||
subtitle: const Text(settingsSchedulesSecondary),
|
||||
trailing: const Icon(Icons.chevron_right),
|
||||
onTap: onOpen,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import 'settings_controller.dart';
|
||||
import 'settings_controls.dart';
|
||||
import 'settings_layout.dart';
|
||||
import 'settings_notifications_section.dart';
|
||||
import 'settings_schedules_section.dart';
|
||||
import 'settings_sections.dart';
|
||||
import 'settings_store.dart';
|
||||
import 'settings_templates_section.dart';
|
||||
@@ -31,6 +32,7 @@ class SettingsScreen extends StatefulWidget {
|
||||
this.ping,
|
||||
this.embedded = false,
|
||||
this.onOpenTemplates,
|
||||
this.onOpenSchedules,
|
||||
this.notifications,
|
||||
});
|
||||
|
||||
@@ -53,6 +55,9 @@ class SettingsScreen extends StatefulWidget {
|
||||
/// without a dead row that would go nowhere.
|
||||
final VoidCallback? onOpenTemplates;
|
||||
|
||||
/// Opens the saved-schedule list above Settings.
|
||||
final VoidCallback? onOpenSchedules;
|
||||
|
||||
/// The app-level notification capability; absent in connection-only fixtures.
|
||||
final NotificationController? notifications;
|
||||
|
||||
@@ -141,6 +146,12 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
controller: widget.notifications!,
|
||||
),
|
||||
],
|
||||
if (widget.onOpenSchedules != null) ...<Widget>[
|
||||
const SizedBox(height: settingsSectionGap),
|
||||
const _SectionTitle('Schedules'),
|
||||
const SizedBox(height: settingsTitleGap),
|
||||
SettingsSchedulesSection(onOpen: widget.onOpenSchedules!),
|
||||
],
|
||||
if (widget.onOpenTemplates != null) ...<Widget>[
|
||||
const SizedBox(height: settingsSectionGap),
|
||||
const _SectionTitle('Templates'),
|
||||
|
||||
Reference in New Issue
Block a user