add enable

This commit is contained in:
jyuesong
2022-01-13 18:50:54 +08:00
parent 6555031948
commit 51b745af19
5 changed files with 53 additions and 4 deletions

View File

@@ -156,7 +156,7 @@ class TaskItemCell extends StatelessWidget {
],
),
child: Container(
color: bean.isPinned == 1 ? ref.watch(themeProvider).themeColor.searchBarBg() : Colors.transparent,
color: bean.isPinned == 1 ? ref.watch(themeProvider).themeColor.pinColor() : Colors.transparent,
padding: const EdgeInsets.symmetric(
horizontal: 15,
vertical: 8,
@@ -310,6 +310,7 @@ class TaskItemCell extends StatelessWidget {
child: Text(bean.isDisabled! == 1 ? "启用" : "禁用"),
onPressed: () {
Navigator.pop(context);
enableTask();
},
),
CupertinoActionSheetAction(
@@ -331,6 +332,10 @@ class TaskItemCell extends StatelessWidget {
);
}
void enableTask() {
ref.read(taskProvider).enableTask(bean.sId!, bean.isDisabled!);
}
void pinTask() {
ref.read(taskProvider).pinTask(bean.sId!, bean.isPinned!);
}