This commit is contained in:
jyuesong
2022-01-21 16:34:05 +08:00
parent b390876bd5
commit 744e421eb7
4 changed files with 44 additions and 30 deletions

View File

@@ -149,6 +149,7 @@ class _LoginPageState extends ConsumerState<LoginPage> {
),
FlipCard(
key: cardKey,
flipOnTouch: false,
onFlipDone: (back) {
useSecretLogin = back;
setState(() {});
@@ -298,13 +299,13 @@ class _LoginPageState extends ConsumerState<LoginPage> {
});
},
child: Text(
loginByUserName() ? "client_id登录" : "用户名密码登录",
loginByUserName() ? "client_id登录" : "账号登录",
style: const TextStyle(
fontSize: 14,
),
),
),
SizedBox(
const SizedBox(
width: 10,
),
],

View File

@@ -178,7 +178,11 @@ class TaskItemCell extends StatelessWidget {
trailingIcon: bean.status! == 1 ? CupertinoIcons.memories : CupertinoIcons.stop_circle,
onPressed: () {
Navigator.of(context).pop();
startCron(context, ref);
if (bean.status! == 1) {
startCron(context, ref);
} else {
stopCron(context, ref);
}
},
),
QLCupertinoContextMenuAction(
@@ -236,8 +240,8 @@ class TaskItemCell extends StatelessWidget {
top: 5,
bottom: isDark ? 5 : 20,
),
child: ClipRRect(
borderRadius: BorderRadius.circular(15),
child: SizedBox(
height: 200,
child: TaskDetailPage(
bean,
hideAppbar: true,
@@ -266,33 +270,40 @@ class TaskItemCell extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
child: Material(
color: Colors.transparent,
child: Text(
bean.name ?? "",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
overflow: TextOverflow.ellipsis,
color: ref.watch(themeProvider).themeColor.titleColor(),
fontSize: 18,
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start,
children: [
bean.status == 1
? const SizedBox.shrink()
: const SizedBox(
width: 15,
height: 15,
child: CircularProgressIndicator(
strokeWidth: 2,
),
),
const SizedBox(
width: 5,
),
),
),
),
const SizedBox(
width: 5,
),
bean.status == 1
? const SizedBox.shrink()
: const SizedBox(
width: 15,
height: 15,
child: CircularProgressIndicator(
strokeWidth: 2,
Expanded(
child: Material(
color: Colors.transparent,
child: Text(
bean.name ?? "",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
overflow: TextOverflow.ellipsis,
color: ref.watch(themeProvider).themeColor.titleColor(),
fontSize: 18,
),
),
),
),
const Spacer(),
],
),
),
Material(
color: Colors.transparent,
child: Text(

View File

@@ -48,6 +48,7 @@ class TaskViewModel extends BaseViewModel {
HttpResponse<NullResponse> result = await Api.startTasks([cron]);
if (result.success) {
list.firstWhere((element) => element.sId == cron).status = 0;
sortList();
notifyListeners();
} else {
failToast(result.message, notify: true);
@@ -58,6 +59,7 @@ class TaskViewModel extends BaseViewModel {
HttpResponse<NullResponse> result = await Api.stopTasks([cron]);
if (result.success) {
list.firstWhere((element) => element.sId == cron).status = 1;
sortList();
notifyListeners();
} else {
failToast(result.message, notify: true);