Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-09-19 11:50:24 +08:00
parent c3bcd323fb
commit 6559aa767d
3 changed files with 29 additions and 30 deletions

View File

@@ -2,6 +2,7 @@ import 'dart:async';
import 'dart:math' show pi;
import 'package:PiliPlus/pages/common/common_intro_controller.dart';
import 'package:PiliPlus/utils/utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
@@ -40,8 +41,12 @@ abstract class TripleState<T extends StatefulWidget> extends State<T>
super.dispose();
}
static final _duration = Utils.isMobile
? const Duration(milliseconds: 200)
: const Duration(milliseconds: 230);
void onStartTriple() {
_timer ??= Timer(const Duration(milliseconds: 200), () {
_timer ??= Timer(_duration, () {
HapticFeedback.lightImpact();
if (introController.hasTriple) {
SmartDialog.showToast('已完成三连');

View File

@@ -8,7 +8,7 @@ import 'package:PiliPlus/utils/storage.dart';
import 'package:PiliPlus/utils/storage_key.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart'
show KeyDownEvent, KeyRepeatEvent, KeyUpEvent, LogicalKeyboardKey;
show KeyDownEvent, KeyUpEvent, LogicalKeyboardKey;
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
@@ -177,7 +177,7 @@ class PlayerFocus extends StatelessWidget {
if (key == LogicalKeyboardKey.arrowRight) {
if (!plPlayerController.isLive && hasPlayer) {
if (event is KeyRepeatEvent) {
if (event is KeyDownEvent) {
if (!plPlayerController.longPressStatus.value) {
plPlayerController.longPressTimer ??= Timer(
const Duration(milliseconds: 200),