feat(app): register the saved-schedule list under Settings at /schedules
This commit is contained in:
@@ -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,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user