1.列表,筛选完成和未完成
2.详情,增加checkout
This commit is contained in:
75
lib/page/plan/history/widgets/bar_actions.dart
Normal file
75
lib/page/plan/history/widgets/bar_actions.dart
Normal file
@@ -0,0 +1,75 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:plan/widgets/ui_kit/popup/popup_action.dart';
|
||||
import 'package:remixicon/remixicon.dart';
|
||||
|
||||
import '../viewmodel/plan_list_store.dart';
|
||||
|
||||
class BarActions extends StatefulWidget {
|
||||
final PlanListStore store;
|
||||
const BarActions({super.key, required this.store});
|
||||
|
||||
@override
|
||||
State<BarActions> createState() => _BarActionsState();
|
||||
}
|
||||
|
||||
class _BarActionsState extends State<BarActions> {
|
||||
void _onSelected(String value) {
|
||||
switch (value) {
|
||||
case "Unarchived":
|
||||
widget.store.setPlanStatus(
|
||||
widget.store.planStatus.copyWith(
|
||||
unarchived: !widget.store.planStatus.unarchived,
|
||||
),
|
||||
);
|
||||
break;
|
||||
case "Archived":
|
||||
widget.store.setPlanStatus(
|
||||
widget.store.planStatus.copyWith(
|
||||
archived: !widget.store.planStatus.archived,
|
||||
),
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
PopupAction(
|
||||
onSelected: _onSelected,
|
||||
items: [
|
||||
PopupMenuItem(
|
||||
value: "Unarchived",
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("Unarchived"),
|
||||
Visibility(
|
||||
visible: widget.store.planStatus.unarchived,
|
||||
child: Icon(RemixIcons.check_fill, size: 20),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: "Archived",
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("Archived"),
|
||||
Visibility(
|
||||
visible: widget.store.planStatus.archived,
|
||||
child: Icon(RemixIcons.check_fill, size: 20),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
child: Icon(RemixIcons.more_fill),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user