import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; class WorkspacePage extends StatelessWidget { const WorkspacePage({super.key}); @override Widget build(BuildContext context) { return ListView( padding: const EdgeInsets.all(18), children: [ Text( '早上好,员工小明', style: Theme.of( context, ).textTheme.headlineSmall?.copyWith(fontWeight: FontWeight.w800), ), const SizedBox(height: 6), Text('今天有什么需要处理?', style: Theme.of(context).textTheme.bodyLarge), const SizedBox(height: 22), Card( child: InkWell( borderRadius: BorderRadius.circular(20), onTap: () => context.push('/leave/new'), child: const Padding( padding: EdgeInsets.all(18), child: Row( children: [ CircleAvatar( radius: 24, child: Icon(Icons.event_available_outlined), ), SizedBox(width: 14), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( '发起请假', style: TextStyle( fontSize: 17, fontWeight: FontWeight.w700, ), ), SizedBox(height: 4), Text('由 Schema 自动生成移动表单卡片'), ], ), ), Icon(Icons.chevron_right), ], ), ), ), ), const SizedBox(height: 16), const _StatusCard(), ], ); } } class _StatusCard extends StatelessWidget { const _StatusCard(); @override Widget build(BuildContext context) { return Card( child: Padding( padding: const EdgeInsets.all(18), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( '我的工作', style: Theme.of( context, ).textTheme.titleMedium?.copyWith(fontWeight: FontWeight.w700), ), const SizedBox(height: 16), const Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ _Metric(value: '0', label: '待我处理'), _Metric(value: '0', label: '进行中'), _Metric(value: '0', label: '本月完成'), ], ), ], ), ), ); } } class _Metric extends StatelessWidget { const _Metric({required this.value, required this.label}); final String value; final String label; @override Widget build(BuildContext context) => Column( children: [ Text( value, style: Theme.of( context, ).textTheme.headlineSmall?.copyWith(fontWeight: FontWeight.w800), ), Text(label), ], ); }