50 lines
1.5 KiB
Dart
50 lines
1.5 KiB
Dart
import '../../ui/theme/app_theme.dart';
|
|
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(
|
|
backgroundColor: AppColors.groupedBackground,
|
|
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,
|
|
),
|
|
);
|
|
}
|
|
}
|