opt scheme

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-07-09 20:22:53 +08:00
parent 829b966382
commit e240a6caae
2 changed files with 28 additions and 31 deletions

View File

@@ -715,24 +715,22 @@ class ReplyItemGrpc extends StatelessWidget {
} else if (_timeRegExp.hasMatch(matchStr)) {
matchStr = matchStr.replaceAll('', ':');
bool isValid = false;
if (Get.currentRoute.startsWith('/video')) {
try {
final ctr = Get.find<VideoDetailController>(
tag: getTag?.call() ?? Get.arguments['heroTag']);
int duration = ctr.data.timeLength!;
List<int> split = matchStr
.split(':')
.reversed
.map((item) => int.parse(item))
.toList();
int seek = 0;
for (int i = 0; i < split.length; i++) {
seek += split[i] * pow(60, i).toInt();
}
isValid = seek * 1000 <= duration;
} catch (e) {
if (kDebugMode) debugPrint('failed to validate: $e');
try {
final ctr = Get.find<VideoDetailController>(
tag: getTag?.call() ?? Get.arguments['heroTag']);
int duration = ctr.data.timeLength!;
List<int> split = matchStr
.split(':')
.reversed
.map((item) => int.parse(item))
.toList();
int seek = 0;
for (int i = 0; i < split.length; i++) {
seek += split[i] * pow(60, i).toInt();
}
isValid = seek * 1000 <= duration;
} catch (e) {
if (kDebugMode) debugPrint('failed to validate: $e');
}
spanChildren.add(
TextSpan(