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 createState() => _PlanItemState(); } class _PlanItemState extends State 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; }