mirror of
https://github.com/qinglong-app/qinglong_app.git
synced 2025-10-09 16:48:19 +08:00
format code
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:qinglong_app/base/common_dialog.dart';
|
||||
import 'package:qinglong_app/base/http/api.dart';
|
||||
import 'package:qinglong_app/base/http/http.dart';
|
||||
import 'package:qinglong_app/base/ql_app_bar.dart';
|
||||
import 'package:qinglong_app/module/task/task_bean.dart';
|
||||
import 'package:qinglong_app/module/task/task_detail/task_detail_bean.dart';
|
||||
import 'package:qinglong_app/module/task/task_viewmodel.dart';
|
||||
import 'package:qinglong_app/utils/extension.dart';
|
||||
|
||||
class AddTaskPage extends ConsumerStatefulWidget {
|
||||
final TaskBean? taskBean;
|
||||
@@ -180,15 +180,15 @@ class _AddTaskPageState extends ConsumerState<AddTaskPage> {
|
||||
|
||||
void submit() async {
|
||||
if (_nameController.text.isEmpty) {
|
||||
failDialog(context, "任务名称不能为空");
|
||||
"任务名称不能为空".toast();
|
||||
return;
|
||||
}
|
||||
if (_commandController.text.isEmpty) {
|
||||
failDialog(context, "命令不能为空");
|
||||
"命令不能为空".toast();
|
||||
return;
|
||||
}
|
||||
if (_cronController.text.isEmpty) {
|
||||
failDialog(context, "定时不能为空");
|
||||
"定时不能为空".toast();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -200,12 +200,11 @@ class _AddTaskPageState extends ConsumerState<AddTaskPage> {
|
||||
id: taskBean.sId);
|
||||
|
||||
if (response.success) {
|
||||
successDialog(context, "操作成功").then((value) {
|
||||
ref.read(taskProvider).updateBean(taskBean);
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
"操作成功".toast();
|
||||
ref.read(taskProvider).updateBean(taskBean);
|
||||
Navigator.of(context).pop();
|
||||
} else {
|
||||
failDialog(context, response.message ?? "");
|
||||
response.message.toast();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,8 @@ class InTimeLogPage extends StatefulWidget {
|
||||
final String cronId;
|
||||
final bool needTimer;
|
||||
|
||||
const InTimeLogPage(this.cronId, this.needTimer, {Key? key}) : super(key: key);
|
||||
const InTimeLogPage(this.cronId, this.needTimer, {Key? key})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_InTimeLogPageState createState() => _InTimeLogPageState();
|
||||
|
||||
@@ -17,17 +17,17 @@ class TaskDetailBean {
|
||||
|
||||
TaskDetailBean(
|
||||
{this.name,
|
||||
this.command,
|
||||
this.schedule,
|
||||
this.saved,
|
||||
this.sId,
|
||||
this.created,
|
||||
this.status,
|
||||
this.timestamp,
|
||||
this.isSystem,
|
||||
this.isDisabled,
|
||||
this.logPath,
|
||||
this.isPinned});
|
||||
this.command,
|
||||
this.schedule,
|
||||
this.saved,
|
||||
this.sId,
|
||||
this.created,
|
||||
this.status,
|
||||
this.timestamp,
|
||||
this.isSystem,
|
||||
this.isDisabled,
|
||||
this.logPath,
|
||||
this.isPinned});
|
||||
|
||||
TaskDetailBean.fromJson(Map<String, dynamic> json) {
|
||||
name = json['name'];
|
||||
|
||||
@@ -27,7 +27,7 @@ class _TaskDetailPageState extends ConsumerState<TaskDetailPage> {
|
||||
builder: (WidgetRef context, TaskDetailViewModel value, Widget? child) {
|
||||
return Container();
|
||||
},
|
||||
onReady: (model){
|
||||
onReady: (model) {
|
||||
model.loadDetail(widget.taskBean.sId!);
|
||||
},
|
||||
),
|
||||
|
||||
@@ -4,7 +4,8 @@ import 'package:qinglong_app/base/http/api.dart';
|
||||
import 'package:qinglong_app/base/http/http.dart';
|
||||
import 'package:qinglong_app/module/task/task_detail/task_detail_bean.dart';
|
||||
|
||||
var taskDetailProvider = AutoDisposeChangeNotifierProvider<TaskDetailViewModel>((ref) {
|
||||
var taskDetailProvider =
|
||||
AutoDisposeChangeNotifierProvider<TaskDetailViewModel>((ref) {
|
||||
return TaskDetailViewModel();
|
||||
});
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ class TaskItemCell extends StatelessWidget {
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
Navigator.of(context)
|
||||
.pushNamed(Routes.route_AddTask, arguments: bean);
|
||||
.pushNamed(Routes.routeAddTask, arguments: bean);
|
||||
},
|
||||
trailingIcon: CupertinoIcons.pencil_outline,
|
||||
),
|
||||
@@ -435,7 +435,7 @@ class TaskItemCell extends StatelessWidget {
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
Navigator.of(context)
|
||||
.pushNamed(Routes.route_AddTask, arguments: bean);
|
||||
.pushNamed(Routes.routeAddTask, arguments: bean);
|
||||
},
|
||||
),
|
||||
CupertinoActionSheetAction(
|
||||
|
||||
Reference in New Issue
Block a user