Files
ttstd_family_care/lib/features/apps/presentation/apps_page.dart
tongtongstudio 41d815336a feat(home): 实现管理平板信息页与管理消息页
- 新增首页平板信息卡片(定位、截图、使用时长、设备操作)
- 将消息 Tab 改为管理 Tab,增加横版菜单与消息列表
- 新增相册、闹钟、联系人、应用子页面路由
- 统一主色为桐桐绿并优化调试日志输出
2026-08-17 16:44:45 +08:00

138 lines
5.4 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import 'package:cupertino_ui/cupertino_ui.dart';
import 'package:go_router/go_router.dart';
import '../../../core/widgets/feature_ui.dart';
import '../../../l10n/app_localizations.dart';
/// 应用页(管理 → 应用)。
///
/// 对应移动端设计稿:搜索栏 + 常用九宫格 + 系统工具/影音娱乐分类列表。
class AppsPage extends StatelessWidget {
const AppsPage({super.key});
@override
Widget build(BuildContext context) {
final l10n = AppLocalizations.of(context);
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: Text(l10n.appsTitle),
leading: CupertinoButton(
padding: EdgeInsets.zero,
child: const Icon(CupertinoIcons.back),
onPressed: () => context.go('/messages'),
),
trailing: CupertinoButton(
padding: EdgeInsets.zero,
child: const Text('管理'),
onPressed: () {},
),
),
child: ListView(
padding: const EdgeInsets.only(bottom: 20),
children: [
// 搜索栏
Container(
margin: const EdgeInsets.fromLTRB(16, 10, 16, 4),
height: 40,
decoration: BoxDecoration(
color: CupertinoColors.white,
borderRadius: BorderRadius.circular(12),
boxShadow: const [BoxShadow(color: Color(0x14141E3C), blurRadius: 8, offset: Offset(0, 2))],
),
child: const Row(
children: [
SizedBox(width: 14),
Icon(CupertinoIcons.search, size: 16, color: AppColors.sub),
SizedBox(width: 8),
Text('搜索应用', style: TextStyle(fontSize: 14, color: AppColors.sub)),
],
),
),
SectionTitle(l10n.appsCommon),
CardBox(
child: Column(
children: [
Row(
children: [
Expanded(child: IconTile(emoji: '🖼️', color: AppColors.blue, label: l10n.menuAlbum)),
Expanded(child: IconTile(emoji: '', color: AppColors.orange, label: l10n.menuAlarm)),
Expanded(child: IconTile(emoji: '👥', color: AppColors.green, label: l10n.menuContacts)),
Expanded(child: IconTile(emoji: '📁', color: AppColors.purple, label: l10n.menuFiles)),
],
),
const SizedBox(height: 14),
Row(
children: [
Expanded(child: IconTile(emoji: '📷', color: AppColors.red, label: l10n.appsCamera)),
Expanded(child: IconTile(emoji: '📅', color: AppColors.teal, label: '日历')),
Expanded(child: IconTile(emoji: '📝', color: const Color(0xFF22C55E), label: '备忘录')),
Expanded(child: IconTile(emoji: '', color: AppColors.gray, label: l10n.appsAdd)),
],
),
],
),
),
SectionTitle(l10n.appsSystem),
CardBox(
padding: EdgeInsets.zero,
child: Column(
children: [
_appRow('⚙️', const Color(0xFF64748B), '设置', '系统 · 已安装'),
const AppDivider(),
_appRow('🌐', AppColors.teal, '浏览器', '系统 · 已安装'),
const AppDivider(),
_appRow('🗺️', const Color(0xFF22C55E), '地图', '系统 · 已安装'),
],
),
),
SectionTitle(l10n.appsEntertain),
CardBox(
padding: EdgeInsets.zero,
child: Column(
children: [
_appRow('🎵', AppColors.red, '音乐', 'v8.2 · 已安装'),
const AppDivider(),
_appRow('🎬', AppColors.orange, '视频', 'v5.1 · 已安装'),
const AppDivider(),
_appRow('📚', AppColors.purple, '阅读', 'v3.4 · 已安装'),
],
),
),
],
),
);
}
Widget _appRow(String emoji, Color color, String name, String sub) => Padding(
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 12),
child: Row(
children: [
Container(
width: 42,
height: 42,
decoration: BoxDecoration(color: color, borderRadius: BorderRadius.circular(13)),
child: Center(child: Text(emoji, style: const TextStyle(fontSize: 19))),
),
const SizedBox(width: 12),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(name, style: const TextStyle(fontSize: 14.5, fontWeight: FontWeight.w600, color: AppColors.ink)),
Text(sub, style: const TextStyle(fontSize: 12, color: AppColors.sub)),
],
),
),
Container(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 5),
decoration: BoxDecoration(
color: const Color(0xFFE8F8EE),
borderRadius: BorderRadius.circular(14),
),
child: const Text('打开', style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: AppColors.green)),
),
],
),
);
}