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

@@ -0,0 +1,39 @@
import 'package:flutter/material.dart';
class DoneStamp extends StatefulWidget {
const DoneStamp({super.key});
@override
State<DoneStamp> createState() => _DoneStampState();
}
class _DoneStampState extends State<DoneStamp> {
@override
Widget build(BuildContext context) {
return Align(
alignment: Alignment(0.7, -0.3),
child: Transform.rotate(
angle: -0.4,
child: Container(
padding: EdgeInsets.symmetric(vertical: 3, horizontal: 5),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
border: Border.all(color: Colors.red, width: 5),
),
child: DefaultTextStyle(
style: TextStyle(color: Colors.red),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
"Completed",
style: TextStyle(fontWeight: FontWeight.w700),
),
],
),
),
),
),
);
}
}

View File

@@ -5,6 +5,7 @@ import 'package:plan/theme/decorations/app_shadows.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'other/bar_actions.dart'; import 'other/bar_actions.dart';
import 'other/done_stamp.dart';
import 'other/footer_btn.dart'; import 'other/footer_btn.dart';
import 'widgets/avatar_card.dart'; import 'widgets/avatar_card.dart';
import 'widgets/coach_message.dart'; import 'widgets/coach_message.dart';
@@ -28,6 +29,7 @@ class PlanDetailPage extends StatefulWidget {
class _PlanDetailPageState extends State<PlanDetailPage> { class _PlanDetailPageState extends State<PlanDetailPage> {
final ScrollController scrollController = ScrollController(); final ScrollController scrollController = ScrollController();
///store对象 ///store对象
late PlanDetailStore store; late PlanDetailStore store;
@@ -57,21 +59,28 @@ class _PlanDetailPageState extends State<PlanDetailPage> {
padding: EdgeInsets.only(left: 15, right: 15, bottom: 1), padding: EdgeInsets.only(left: 15, right: 15, bottom: 1),
child: Container( child: Container(
decoration: shadowDecoration, decoration: shadowDecoration,
child: Column( child: Stack(
children: [ children: [
Expanded( Column(
child: ScrollBox( children: [
child: Column( Expanded(
children: [ child: ScrollBox(
CoachMessage(), child: Column(
PlanList(), children: [
SuggestedTitle(), CoachMessage(),
SuggestedList(), PlanList(),
], SuggestedTitle(),
SuggestedList(),
],
),
),
), ),
), FooterBtn(),
],
),
Positioned(
child: DoneStamp(),
), ),
FooterBtn()
], ],
), ),
), ),

View File

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