mirror of
https://github.com/qinglong-app/qinglong_app.git
synced 2025-10-09 16:48:19 +08:00
add enable
This commit is contained in:
@@ -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!);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user