add setting

This commit is contained in:
NewTab
2022-01-17 20:52:22 +08:00
parent f8db860d56
commit 917425c5de
12 changed files with 109 additions and 78 deletions

View File

@@ -56,7 +56,13 @@ class _AddTaskPageState extends ConsumerState<AddTaskPage> {
horizontal: 15,
),
child: Center(
child: Text("提交"),
child: Text(
"提交",
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
),
)
@@ -189,7 +195,9 @@ class _AddTaskPageState extends ConsumerState<AddTaskPage> {
taskBean.name = _nameController.text;
taskBean.command = _commandController.text;
taskBean.schedule = _cronController.text;
HttpResponse<TaskDetailBean> response = await Api.addTask(_nameController.text, _commandController.text, _cronController.text, id: taskBean.sId);
HttpResponse<TaskDetailBean> response = await Api.addTask(
_nameController.text, _commandController.text, _cronController.text,
id: taskBean.sId);
if (response.success) {
successDialog(context, "操作成功").then((value) {
@@ -197,7 +205,7 @@ class _AddTaskPageState extends ConsumerState<AddTaskPage> {
Navigator.of(context).pop();
});
} else {
failDialog(context, response.message ??"");
failDialog(context, response.message ?? "");
}
}
}

View File

@@ -397,29 +397,31 @@ class TaskItemCell extends StatelessWidget {
}
logCron(BuildContext context, WidgetRef ref) {
showCupertinoDialog(
builder: (BuildContext context) {
return CupertinoAlertDialog(
title: Text(
"${bean.name}运行日志",
maxLines: 1,
style: const TextStyle(overflow: TextOverflow.ellipsis),
),
content: InTimeLogPage(bean.sId!, bean.status == 0),
actions: [
CupertinoDialogAction(
child: Text(
"知道了",
style: TextStyle(color: Theme.of(context).primaryColor),
),
onPressed: () {
Navigator.of(context).pop();
},
WidgetsBinding.instance?.addPostFrameCallback((timeStamp) {
showCupertinoDialog(
builder: (BuildContext context) {
return CupertinoAlertDialog(
title: Text(
"${bean.name}运行日志",
maxLines: 1,
style: const TextStyle(overflow: TextOverflow.ellipsis),
),
],
);
},
context: context);
content: InTimeLogPage(bean.sId!, bean.status == 0),
actions: [
CupertinoDialogAction(
child: Text(
"知道了",
style: TextStyle(color: Theme.of(context).primaryColor),
),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
},
context: context);
});
}
more(BuildContext context, WidgetRef ref) {