60 lines
1.9 KiB
Dart
60 lines
1.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:plan/page/plan/detail/viewmodel/plan_detail_store.dart';
|
|
import 'package:plan/utils/common.dart';
|
|
import 'package:plan/utils/format.dart';
|
|
import 'package:provider/provider.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 Consumer<PlanDetailStore>(
|
|
builder: (context, store, _) {
|
|
//是否全部完成
|
|
bool allDone = store.planDetail.stepsList.every((item) => item.stepStatus == 2);
|
|
if (!allDone || store.planDetail.stepsList.isEmpty) {
|
|
return Container();
|
|
}
|
|
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),
|
|
),
|
|
Visibility(
|
|
visible: getNotEmpty(store.planDetail.planEndTime) != null,
|
|
child: Text(
|
|
formatDateUS(store.planDetail.planEndTime!),
|
|
style: TextStyle(fontSize: 12),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
},
|
|
);
|
|
}
|
|
}
|