1
This commit is contained in:
39
lib/page/plan/detail/other/done_stamp.dart
Normal file
39
lib/page/plan/detail/other/done_stamp.dart
Normal 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),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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<PlanDetailPage> {
|
||||
final ScrollController scrollController = ScrollController();
|
||||
|
||||
///store对象
|
||||
late PlanDetailStore store;
|
||||
|
||||
@@ -57,21 +59,28 @@ class _PlanDetailPageState extends State<PlanDetailPage> {
|
||||
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()
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -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),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user