Files
plan_flutter/lib/page/plan/detail/widgets/plan_item.dart
zhutao 0231dcfe1a 1
2025-09-04 17:57:35 +08:00

72 lines
2.0 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import 'package:flutter/material.dart';
import 'package:plan/widgets/business/delete_row_item.dart';
import 'package:remixicon/remixicon.dart';
class PlanItem extends StatefulWidget {
final String title;
final String desc;
final bool showEdit;
final Function(int) onDelete;
const PlanItem({
super.key,
required this.title,
required this.desc,
this.showEdit = false,
required this.onDelete,
});
@override
State<PlanItem> createState() => _PlanItemState();
}
class _PlanItemState extends State<PlanItem> with AutomaticKeepAliveClientMixin {
@override
Widget build(BuildContext context) {
super.build(context);
return Container(
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
child: DeleteRowItem(
showDelete: widget.showEdit,
onDelete: () {},
builder: (_, animate) {
return [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(bottom: 3),
child: Text(
"完成以上步骤后,给自己倒杯水休息一下。",
style: Theme.of(context).textTheme.bodyMedium,
),
),
Text(
"就从这里开始写下基本信息只需要2分钟这是最简单的一部",
style: Theme.of(context).textTheme.labelSmall,
),
],
),
),
SizeTransition(
axis: Axis.horizontal,
sizeFactor: animate,
child: Container(
margin: EdgeInsets.only(left: 10),
child: Opacity(
opacity: 0.4,
child: Icon(RemixIcons.menu_line),
),
),
),
];
},
),
);
}
@override
bool get wantKeepAlive => true;
}