2026-11-26 00:36:27 +08:00
|
|
|
// 全部功能: the tools the sidebar keeps behind one button, each opening its
|
|
|
|
|
// own page. Scheduled tasks so far; more entries go into the grid.
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
import '../state.dart';
|
|
|
|
|
import 'scheduled_tasks_screen.dart';
|
2026-11-26 17:18:09 +08:00
|
|
|
import 'stats_screen.dart';
|
2026-11-26 09:04:25 +08:00
|
|
|
import '../l10n.dart';
|
2026-11-26 00:36:27 +08:00
|
|
|
|
|
|
|
|
class FeaturesScreen extends StatelessWidget {
|
|
|
|
|
final AppState app;
|
|
|
|
|
const FeaturesScreen({super.key, required this.app});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
final theme = Theme.of(context);
|
|
|
|
|
return Scaffold(
|
2026-11-26 11:48:16 +08:00
|
|
|
appBar: AppBar(title: const AppText('All features')),
|
2026-11-26 00:36:27 +08:00
|
|
|
body: ListView(
|
|
|
|
|
padding: const EdgeInsets.fromLTRB(16, 12, 16, 32),
|
|
|
|
|
children: [
|
2026-11-26 11:48:16 +08:00
|
|
|
AppText('Tools for servers and agents are collected here.',
|
2026-11-26 00:36:27 +08:00
|
|
|
style: TextStyle(fontSize: 12.5, color: theme.hintColor)),
|
|
|
|
|
const SizedBox(height: 14),
|
|
|
|
|
GridView.count(
|
|
|
|
|
crossAxisCount: 2,
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
|
|
|
mainAxisSpacing: 12,
|
|
|
|
|
crossAxisSpacing: 12,
|
|
|
|
|
childAspectRatio: 1.25,
|
|
|
|
|
children: [
|
|
|
|
|
_FeatureTile(
|
|
|
|
|
icon: Icons.schedule,
|
2026-11-26 11:48:16 +08:00
|
|
|
title: 'Scheduled tasks',
|
|
|
|
|
caption: 'Send prompts to sessions on a schedule',
|
2026-11-26 00:36:27 +08:00
|
|
|
onTap: () => Navigator.of(context).push(MaterialPageRoute(
|
|
|
|
|
builder: (_) => ScheduledTasksScreen(app: app),
|
|
|
|
|
)),
|
|
|
|
|
),
|
2026-11-26 17:18:09 +08:00
|
|
|
_FeatureTile(
|
|
|
|
|
icon: Icons.query_stats,
|
|
|
|
|
title: 'Stats',
|
|
|
|
|
caption: 'Prompts, tokens, cost and model activity',
|
|
|
|
|
onTap: () => Navigator.of(context).push(MaterialPageRoute(
|
|
|
|
|
builder: (_) => StatsScreen(app: app),
|
|
|
|
|
)),
|
|
|
|
|
),
|
2026-11-26 00:36:27 +08:00
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _FeatureTile extends StatelessWidget {
|
|
|
|
|
final IconData icon;
|
|
|
|
|
final String title;
|
|
|
|
|
final String caption;
|
|
|
|
|
final VoidCallback onTap;
|
|
|
|
|
|
|
|
|
|
const _FeatureTile({
|
|
|
|
|
required this.icon,
|
|
|
|
|
required this.title,
|
|
|
|
|
required this.caption,
|
|
|
|
|
required this.onTap,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
final theme = Theme.of(context);
|
|
|
|
|
return Material(
|
|
|
|
|
color: theme.colorScheme.surfaceContainerHighest.withValues(alpha: 0.5),
|
|
|
|
|
borderRadius: BorderRadius.circular(16),
|
|
|
|
|
clipBehavior: Clip.antiAlias,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: onTap,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(14),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
width: 38,
|
|
|
|
|
height: 38,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: theme.colorScheme.primaryContainer,
|
|
|
|
|
borderRadius: BorderRadius.circular(11),
|
|
|
|
|
),
|
|
|
|
|
child: Icon(icon,
|
|
|
|
|
size: 21, color: theme.colorScheme.onPrimaryContainer),
|
|
|
|
|
),
|
|
|
|
|
const Spacer(),
|
2026-11-26 09:04:25 +08:00
|
|
|
AppText(title,
|
2026-11-26 00:36:27 +08:00
|
|
|
style: const TextStyle(
|
|
|
|
|
fontSize: 14.5, fontWeight: FontWeight.w600)),
|
|
|
|
|
const SizedBox(height: 2),
|
2026-11-26 09:04:25 +08:00
|
|
|
AppText(
|
2026-11-26 00:36:27 +08:00
|
|
|
caption,
|
|
|
|
|
maxLines: 2,
|
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
|
style: TextStyle(fontSize: 11.5, color: theme.hintColor),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
2026-11-26 09:04:25 +08:00
|
|
|
}
|