This commit is contained in:
zhutao
2025-09-09 15:45:08 +08:00
parent d902f72335
commit ccb7d5bb24
3 changed files with 86 additions and 19 deletions

View File

@@ -47,8 +47,8 @@ class _HistoryItemState extends State<HistoryItem> {
}
///跳转详情
void _goDetail() async{
await context.push(RoutePaths.planDetail(_data.id));
void _goDetail() async {
await context.push(RoutePaths.planDetail(_data.id));
widget.onInit();
}
@@ -76,6 +76,7 @@ class _HistoryItemState extends State<HistoryItem> {
@override
Widget build(BuildContext context) {
var progress = (_data.completedSteps! / _data.totalSteps!);
return CupertinoContextMenu(
enableHapticFeedback: true,
actions: [
@@ -114,12 +115,30 @@ class _HistoryItemState extends State<HistoryItem> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(bottom: 5),
child: Text(_data.summary ?? ""),
Row(
children: [
Expanded(child: Text(_data.summary ?? "")),
Visibility(
visible: progress == 1,
child: Container(
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 2),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
color: Theme.of(context).colorScheme.surfaceContainerLow,
),
child: Text(
"Archived",
style: TextStyle(
fontSize: 10,
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
),
),
),
],
),
Container(
margin: const EdgeInsets.only(bottom: 5),
margin: const EdgeInsets.only(bottom: 5, top: 5),
child: Text(
"${formatDateUS(_data.createdAt!, withTime: true)} · Coach ${_data.agentName ?? ""}",
style: Theme.of(context).textTheme.labelSmall, // 小号文字
@@ -130,7 +149,7 @@ class _HistoryItemState extends State<HistoryItem> {
children: [
Expanded(
child: LinearProgressIndicator(
value: (_data.completedSteps! / _data.totalSteps!),
value: progress,
borderRadius: BorderRadius.circular(5),
),
),