diff --git a/lib/page/plan/detail/other/done_stamp.dart b/lib/page/plan/detail/other/done_stamp.dart new file mode 100644 index 0000000..295ed80 --- /dev/null +++ b/lib/page/plan/detail/other/done_stamp.dart @@ -0,0 +1,39 @@ +import 'package:flutter/material.dart'; + +class DoneStamp extends StatefulWidget { + const DoneStamp({super.key}); + + @override + State createState() => _DoneStampState(); +} + +class _DoneStampState extends State { + @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), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/page/plan/detail/plan_detail_page.dart b/lib/page/plan/detail/plan_detail_page.dart index 6133fb3..d354b8a 100644 --- a/lib/page/plan/detail/plan_detail_page.dart +++ b/lib/page/plan/detail/plan_detail_page.dart @@ -5,6 +5,7 @@ import 'package:plan/theme/decorations/app_shadows.dart'; import 'package:provider/provider.dart'; import 'other/bar_actions.dart'; +import 'other/done_stamp.dart'; import 'other/footer_btn.dart'; import 'widgets/avatar_card.dart'; import 'widgets/coach_message.dart'; @@ -28,6 +29,7 @@ class PlanDetailPage extends StatefulWidget { class _PlanDetailPageState extends State { final ScrollController scrollController = ScrollController(); + ///store对象 late PlanDetailStore store; @@ -57,21 +59,28 @@ class _PlanDetailPageState extends State { padding: EdgeInsets.only(left: 15, right: 15, bottom: 1), child: Container( decoration: shadowDecoration, - child: Column( + child: Stack( children: [ - Expanded( - child: ScrollBox( - child: Column( - children: [ - CoachMessage(), - PlanList(), - SuggestedTitle(), - SuggestedList(), - ], + Column( + children: [ + Expanded( + child: ScrollBox( + child: Column( + children: [ + CoachMessage(), + PlanList(), + SuggestedTitle(), + SuggestedList(), + ], + ), + ), ), - ), + FooterBtn(), + ], + ), + Positioned( + child: DoneStamp(), ), - FooterBtn() ], ), ), diff --git a/lib/page/plan/history/widgets/history_item.dart b/lib/page/plan/history/widgets/history_item.dart index 7db74ca..3b3cc64 100644 --- a/lib/page/plan/history/widgets/history_item.dart +++ b/lib/page/plan/history/widgets/history_item.dart @@ -47,8 +47,8 @@ class _HistoryItemState extends State { } ///跳转详情 - 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 { @override Widget build(BuildContext context) { + var progress = (_data.completedSteps! / _data.totalSteps!); return CupertinoContextMenu( enableHapticFeedback: true, actions: [ @@ -114,12 +115,30 @@ class _HistoryItemState extends State { 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 { children: [ Expanded( child: LinearProgressIndicator( - value: (_data.completedSteps! / _data.totalSteps!), + value: progress, borderRadius: BorderRadius.circular(5), ), ),