mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-08-05 10:10:14 +08:00
@@ -1,7 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
import 'dart:io' show File;
|
||||
import 'dart:math' show min;
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:PiliPlus/common/style.dart';
|
||||
import 'package:PiliPlus/common/widgets/pair.dart';
|
||||
@@ -66,7 +64,7 @@ import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:PiliPlus/utils/video_utils.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart';
|
||||
import 'package:flutter/foundation.dart' show kDebugMode;
|
||||
import 'package:flutter/foundation.dart' show kDebugMode, clampDouble;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'dart:io';
|
||||
import 'dart:io' show File;
|
||||
|
||||
import 'package:PiliPlus/common/style.dart';
|
||||
import 'package:PiliPlus/common/widgets/badge.dart';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'dart:async';
|
||||
import 'dart:math' show max;
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:PiliPlus/http/constants.dart';
|
||||
import 'package:PiliPlus/http/fav.dart';
|
||||
@@ -82,10 +81,10 @@ class PgcIntroController extends CommonIntroController {
|
||||
final hasFav = response.favorite == 1;
|
||||
late final stat = pgcItem.stat;
|
||||
if (hasLike) {
|
||||
stat?.like = max(1, stat.like);
|
||||
stat?.like = math.max(1, stat.like);
|
||||
}
|
||||
if (hasFav) {
|
||||
stat?.favorite = max(1, stat.favorite);
|
||||
stat?.favorite = math.max(1, stat.favorite);
|
||||
}
|
||||
this.hasLike.value = hasLike;
|
||||
coinNum.value = response.coinNumber!;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'dart:async';
|
||||
import 'dart:async' show StreamSubscription;
|
||||
|
||||
import 'package:PiliPlus/common/assets.dart';
|
||||
import 'package:PiliPlus/models_new/pgc/pgc_info_model/episode.dart';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'dart:async';
|
||||
import 'dart:math';
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:PiliPlus/common/widgets/button/icon_button.dart';
|
||||
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
||||
@@ -176,10 +175,10 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
||||
if (result case Success(:final response)) {
|
||||
late final stat = videoDetail.value.stat;
|
||||
if (response.like!) {
|
||||
stat?.like = max(1, stat.like);
|
||||
stat?.like = math.max(1, stat.like);
|
||||
}
|
||||
if (response.favorite!) {
|
||||
stat?.favorite = max(1, stat.favorite);
|
||||
stat?.favorite = math.max(1, stat.favorite);
|
||||
}
|
||||
hasLike.value = response.like!;
|
||||
hasDislike.value = response.dislike!;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'dart:math';
|
||||
import 'dart:async' show StreamSubscription;
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:PiliPlus/common/assets.dart';
|
||||
import 'package:PiliPlus/models_new/video/video_detail/page.dart';
|
||||
@@ -62,7 +62,7 @@ class _PagesPanelState extends State<PagesPanel> {
|
||||
offset = targetOffset;
|
||||
_listener = _videoDetailController.cid.listen((cid) {
|
||||
this.cid = cid;
|
||||
pageIndex = max(0, pages.indexWhere((e) => e.cid == cid));
|
||||
pageIndex = math.max(0, pages.indexWhere((e) => e.cid == cid));
|
||||
if (!mounted) return;
|
||||
setState(() {});
|
||||
jumpToCurr();
|
||||
@@ -73,7 +73,7 @@ class _PagesPanelState extends State<PagesPanel> {
|
||||
|
||||
double get targetOffset {
|
||||
const double itemWidth = 150;
|
||||
return max(0, pageIndex * itemWidth - itemWidth / 2);
|
||||
return math.max(0, pageIndex * itemWidth - itemWidth / 2);
|
||||
}
|
||||
|
||||
void jumpToCurr() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'dart:async';
|
||||
import 'dart:async' show StreamSubscription;
|
||||
|
||||
import 'package:PiliPlus/common/assets.dart';
|
||||
import 'package:PiliPlus/models_new/video/video_detail/data.dart';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'dart:async';
|
||||
import 'dart:async' show Timer;
|
||||
|
||||
import 'package:PiliPlus/utils/platform_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'dart:async' show Timer;
|
||||
import 'dart:math' as math;
|
||||
import 'dart:math' show max;
|
||||
|
||||
import 'package:PiliPlus/common/assets.dart';
|
||||
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
||||
@@ -405,7 +404,7 @@ class _PayCoinsPageState extends State<PayCoinsPage>
|
||||
const SizedBox(height: 10),
|
||||
Center(
|
||||
child: Text(
|
||||
'${_coins != null ? '硬币余额:${max(0.0, _coins.toDouble().toPrecision(1))}' : ''}${widget.hasCoin ? '${_coins != null ? ',' : ''}已投1枚硬币' : ''}',
|
||||
'${_coins != null ? '硬币余额:${math.max(0.0, _coins.toDouble().toPrecision(1))}' : ''}${widget.hasCoin ? '${_coins != null ? ',' : ''}已投1枚硬币' : ''}',
|
||||
style: const TextStyle(color: Colors.white, fontSize: 13),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'dart:math';
|
||||
import 'dart:async' show Timer;
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:PiliPlus/common/widgets/button/icon_button.dart';
|
||||
import 'package:PiliPlus/common/widgets/loading_widget/loading_widget.dart';
|
||||
@@ -145,7 +145,7 @@ class PostPanel extends CommonSlidePage {
|
||||
.toList();
|
||||
double duration = 0;
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
duration += split[i] * pow(60, i);
|
||||
duration += split[i] * math.pow(60, i);
|
||||
}
|
||||
if (duration <= videoDuration) {
|
||||
updateSegment(
|
||||
@@ -477,7 +477,7 @@ class _PostPanelState extends State<PostPanel>
|
||||
}
|
||||
return;
|
||||
}
|
||||
final seek = max(0, start - 2000);
|
||||
final seek = math.max(0, start - 2000);
|
||||
await player.seek(Duration(milliseconds: seek));
|
||||
if (!player.state.playing) {
|
||||
await player.play();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
import 'dart:math' show max;
|
||||
import 'dart:io' show File;
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:PiliPlus/common/widgets/button/toolbar_icon_button.dart';
|
||||
import 'package:PiliPlus/common/widgets/custom_icon.dart';
|
||||
@@ -228,7 +227,7 @@ class _ReplyPageState extends CommonRichTextPubPageState<ReplyPage> {
|
||||
double height = context.isTablet ? 300 : 170;
|
||||
final keyboardHeight = controller.keyboardHeight;
|
||||
if (keyboardHeight != 0) {
|
||||
height = max(height, keyboardHeight);
|
||||
height = math.max(height, keyboardHeight);
|
||||
}
|
||||
|
||||
Widget item({
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:PiliPlus/common/widgets/button/icon_button.dart';
|
||||
import 'package:PiliPlus/common/widgets/view_safe_area.dart';
|
||||
import 'package:PiliPlus/http/danmaku.dart';
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
import 'dart:math';
|
||||
import 'dart:ui';
|
||||
import 'dart:io' show Platform;
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:PiliPlus/common/assets.dart';
|
||||
import 'package:PiliPlus/common/style.dart';
|
||||
@@ -59,7 +57,7 @@ import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/storage_key.dart';
|
||||
import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart';
|
||||
import 'package:floating/floating.dart';
|
||||
import 'package:flutter/foundation.dart' show kDebugMode;
|
||||
import 'package:flutter/foundation.dart' show kDebugMode, clampDouble;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart' show SystemUiOverlayStyle;
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
@@ -390,7 +388,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
|
||||
final shortestSide = size.shortestSide;
|
||||
final minVideoHeight = shortestSide / Style.aspectRatio16x9;
|
||||
final maxVideoHeight = max(size.longestSide * 0.65, shortestSide);
|
||||
final maxVideoHeight = math.max(size.longestSide * 0.65, shortestSide);
|
||||
videoDetailController
|
||||
..isPortrait = isPortrait = maxHeight >= maxWidth
|
||||
..minVideoHeight = minVideoHeight
|
||||
@@ -1344,7 +1342,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
if (videoDetailController.plPlayerController.enableBlock)
|
||||
Positioned(
|
||||
left: 16,
|
||||
bottom: isFullScreen ? max(75, maxHeight * 0.25) : 75,
|
||||
bottom: isFullScreen ? math.max(75, maxHeight * 0.25) : 75,
|
||||
width: 120,
|
||||
child: AnimatedList(
|
||||
padding: EdgeInsets.zero,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'dart:async';
|
||||
import 'dart:async' show Timer;
|
||||
import 'dart:io' show exit, Platform;
|
||||
import 'dart:math' as math;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user