From f305e0864f6f12d46b53e3a4cb9e662c3a5a1127 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Mon, 10 Jul 2023 11:01:22 +0800 Subject: [PATCH] =?UTF-8?q?mod:=20=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E3=80=81=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Podfile.lock | 2 +- lib/http/video.dart | 4 +-- lib/pages/history/widgets/item.dart | 3 +- lib/pages/main/view.dart | 23 +++++++------ lib/pages/video/detail/controller.dart | 10 +++++- .../detail/introduction/widgets/season.dart | 9 +++-- .../detail/reply/widgets/reply_item.dart | 9 ++--- lib/pages/video/detail/view.dart | 34 ++++--------------- pubspec.lock | 34 +++++++++---------- pubspec.yaml | 2 +- 10 files changed, 63 insertions(+), 67 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 2e360365..656da14e 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -119,7 +119,7 @@ SPEC CHECKSUMS: FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a image_gallery_saver: 259eab68fb271cfd57d599904f7acdc7832e7ef2 media_kit_libs_ios_video: 96259eccffaa309b63a7ee610c2c7786a3b335e5 - media_kit_native_event_loop: 9f9eb778d0d806ab9486eff7513f7f90f07d50f8 + media_kit_native_event_loop: 1eac6db2378101404392c80606103b42f7c2c491 media_kit_video: c6ae801433b484912087b519b45f1beac97b960b path_provider_foundation: c68054786f1b4f3343858c1e1d0caaded73f0be9 permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce diff --git a/lib/http/video.dart b/lib/http/video.dart index dd756386..50b78e94 100644 --- a/lib/http/video.dart +++ b/lib/http/video.dart @@ -305,11 +305,11 @@ class VideoHttp { } // 视频播放进度 - static Future heartBeat({bvid, progress, realtime}) async { + static Future heartBeat({bvid, cid, progress, realtime}) async { var res = await Request().post(Api.heartBeat, queryParameters: { // 'aid': aid, 'bvid': bvid, - // 'cid': '', + 'cid': cid, // 'epid': '', // 'sid': '', // 'mid': '', diff --git a/lib/pages/history/widgets/item.dart b/lib/pages/history/widgets/item.dart index f0bbd1a8..05796f17 100644 --- a/lib/pages/history/widgets/item.dart +++ b/lib/pages/history/widgets/item.dart @@ -20,10 +20,9 @@ class HistoryItem extends StatelessWidget { return InkWell( onTap: () async { int cid = videoItem.history.cid ?? - videoItem.history.oid ?? + // videoItem.history.oid ?? await SearchHttp.ab2c(aid: aid, bvid: bvid); await Future.delayed(const Duration(milliseconds: 200)); - print(videoItem.history.business); if (videoItem.history.business.contains('article')) { Get.toNamed( '/webview', diff --git a/lib/pages/main/view.dart b/lib/pages/main/view.dart index 237e27dc..acd5a41c 100644 --- a/lib/pages/main/view.dart +++ b/lib/pages/main/view.dart @@ -2,7 +2,6 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:pilipala/pages/home/index.dart'; import 'package:pilipala/pages/hot/index.dart'; -import 'package:salomon_bottom_bar/salomon_bottom_bar.dart'; import './controller.dart'; class MainApp extends StatefulWidget { @@ -103,7 +102,6 @@ class _MainAppState extends State with SingleTickerProviderStateMixin { ), child: PageView( controller: _pageController, - // physics: const NeverScrollableScrollPhysics(), onPageChanged: (index) { selectedIndex = index; setState(() {}); @@ -112,16 +110,21 @@ class _MainAppState extends State with SingleTickerProviderStateMixin { ), ), ), - bottomNavigationBar: SalomonBottomBar( + bottomNavigationBar: BottomNavigationBar( currentIndex: selectedIndex, + type: BottomNavigationBarType.shifting, + selectedItemColor: Theme.of(context).colorScheme.primary, + unselectedItemColor: Theme.of(context).colorScheme.onSurfaceVariant, + selectedFontSize: 12.4, onTap: (value) => setIndex(value), - items: _mainController.navigationBars.map((e) { - return SalomonBottomBarItem( - icon: e['icon'], - title: Text(e['label']), - selectedColor: Theme.of(context).colorScheme.primary, - ); - }).toList(), + items: [ + ..._mainController.navigationBars.map((e) { + return BottomNavigationBarItem( + icon: e['icon'], + label: e['label'], + ); + }).toList(), + ], ), ); } diff --git a/lib/pages/video/detail/controller.dart b/lib/pages/video/detail/controller.dart index 87f05ed6..f90ddc56 100644 --- a/lib/pages/video/detail/controller.dart +++ b/lib/pages/video/detail/controller.dart @@ -49,6 +49,8 @@ class VideoDetailController extends GetxController Timer? timer; + RxString bgCover = ''.obs; + @override void onInit() { super.onInit(); @@ -58,10 +60,12 @@ class VideoDetailController extends GetxController var args = Get.arguments['videoItem']; if (args.pic != null && args.pic != '') { videoItem['pic'] = args.pic; + bgCover.value = args.pic; } } if (Get.arguments.containsKey('pic')) { videoItem['pic'] = Get.arguments['pic']; + bgCover.value = Get.arguments['pic']; } heroTag = Get.arguments['heroTag']; } @@ -135,7 +139,11 @@ class VideoDetailController extends GetxController void markHeartBeat() async { Duration progress = meeduPlayerController.position.value; - await VideoHttp.heartBeat(bvid: bvid, progress: progress.inSeconds); + await VideoHttp.heartBeat( + bvid: bvid, + cid: cid, + progress: progress.inSeconds, + ); } @override diff --git a/lib/pages/video/detail/introduction/widgets/season.dart b/lib/pages/video/detail/introduction/widgets/season.dart index 61598f8c..94bcccb5 100644 --- a/lib/pages/video/detail/introduction/widgets/season.dart +++ b/lib/pages/video/detail/introduction/widgets/season.dart @@ -78,8 +78,13 @@ Widget seasonPanel(UgcSeason ugcSeason, cid) { padding: const EdgeInsets.fromLTRB(10, 10, 10, 10), child: Row( children: [ - Text('合集:${ugcSeason.title!}'), - const Spacer(), + Expanded( + child: Text( + '合集:${ugcSeason.title!}', + overflow: TextOverflow.ellipsis, + ), + ), + const SizedBox(width: 15), Text( '${currentIndex + 1} / ${ugcSeason.epCount}', style: Theme.of(context).textTheme.labelSmall, diff --git a/lib/pages/video/detail/reply/widgets/reply_item.dart b/lib/pages/video/detail/reply/widgets/reply_item.dart index 2b412d03..2ea5f5c6 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item.dart @@ -345,10 +345,11 @@ class ReplyItemRow extends StatelessWidget { child: Container( width: double.infinity, padding: EdgeInsets.fromLTRB( - 8, - i == 0 && (extraRow == 1 || replies!.length > 1) ? 8 : 5, - 8, - 5), + 8, + i == 0 && (extraRow == 1 || replies!.length > 1) ? 8 : 5, + 8, + i == 0 && (extraRow == 1 || replies!.length > 1) ? 5 : 6, + ), child: Text.rich( overflow: extraRow == 1 ? TextOverflow.ellipsis diff --git a/lib/pages/video/detail/view.dart b/lib/pages/video/detail/view.dart index cd9a9277..153d1857 100644 --- a/lib/pages/video/detail/view.dart +++ b/lib/pages/video/detail/view.dart @@ -31,11 +31,6 @@ class _VideoDetailPageState extends State final ScrollController _extendNestCtr = ScrollController(); late AnimationController animationController; - // final _meeduPlayerController = MeeduPlayerController( - // pipEnabled: true, - // controlsStyle: ControlsStyle.secondary, - // enabledButtons: const EnabledButtons(pip: true), - // ); StreamSubscription? _playerEventSubs; bool isPlay = false; PlayerStatus playerStatus = PlayerStatus.paused; @@ -154,11 +149,13 @@ class _VideoDetailPageState extends State top: 0, left: 0, right: 0, - child: NetworkImgLayer( - type: 'emote', - src: videoDetailController.videoItem['pic'], - width: Get.size.width, - height: videoHeight + 100, + child: Obx( + () => NetworkImgLayer( + type: 'emote', + src: videoDetailController.bgCover.value, + width: Get.size.width, + height: videoHeight, + ), ), ), Positioned.fill( @@ -226,15 +223,6 @@ class _VideoDetailPageState extends State size: 19, ), ), - title: Text( - '视频详情', - style: TextStyle( - color: Colors.white, - fontSize: Theme.of(context) - .textTheme - .titleSmall! - .fontSize), - ), ); }, ), @@ -304,14 +292,6 @@ class _VideoDetailPageState extends State ), ), ), - // 弹幕开关 - // const Spacer(), - // Flexible( - // flex: 2, - // child: Container( - // height: 50, - // ), - // ), ], ), ), diff --git a/pubspec.lock b/pubspec.lock index bb360460..618b46b5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -400,7 +400,7 @@ packages: description: path: package ref: feature-custom - resolved-ref: b8a145a796c537e312fd8e5e1ba299020f8032db + resolved-ref: ea73de29401ab35126ef3eac68270b2e6c3ef4e0 url: "https://github.com/guozhigq/flutter_meedu_media_kit.git" source: git version: "4.2.12" @@ -618,18 +618,18 @@ packages: dependency: transitive description: name: media_kit - sha256: "080cfb5af8d04f8cc454cb4c5ea34b19de5b8e1a1b3af62a34e766364b5244ad" + sha256: "8c7d9417bed724a3fcaadd91c722fea042737cafb153aa1f1e6461a0fee683a3" url: "https://pub.dev" source: hosted - version: "0.0.11" + version: "1.0.2" media_kit_libs_android_video: dependency: transitive description: name: media_kit_libs_android_video - sha256: daeaeb254aee1089fa77f11cbeb0864a1238cbd0cb2a1c5ab9b2a2e66cc5ff42 + sha256: "228c3b182831e194bb178d4d22a1839af812c917cb76fe87d6fdc9ea4328dc81" url: "https://pub.dev" source: hosted - version: "1.0.6" + version: "1.1.1" media_kit_libs_ios_video: dependency: transitive description: @@ -666,18 +666,18 @@ packages: dependency: transitive description: name: media_kit_native_event_loop - sha256: "521125e534603c3f603b93283db3938f557f33ecc383fbd62edd4beb3bf73747" + sha256: "5351f0c28124b5358756515d8619abad182cdefe967468d7fb5b274737cc2f59" url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.0.6" media_kit_video: dependency: transitive description: name: media_kit_video - sha256: "89d3c2cdb0f74d1bb597a9c9a7678f656fe538d20620ad1317b7354fd5d1af15" + sha256: d31a0eab80cafadccdedb663d8a127750e38b8c75c1aa83d8943f8119b88cf99 url: "https://pub.dev" source: hosted - version: "0.0.12" + version: "1.0.2" meedu: dependency: transitive description: @@ -902,14 +902,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.2" - salomon_bottom_bar: - dependency: "direct main" - description: - name: salomon_bottom_bar - sha256: e20abf2e449749432223a8b4e6647c212eef6c2b638e0ed8cc92eff9529c2b48 - url: "https://pub.dev" - source: hosted - version: "3.3.2" screen_brightness: dependency: transitive description: @@ -966,6 +958,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.1.6" + screenshot: + dependency: "direct main" + description: + name: screenshot + sha256: "30bb9fade6eb2578a1fc2e84f6b184141fc86883cda10988d4500ff00eb728e2" + url: "https://pub.dev" + source: hosted + version: "1.3.0" share_plus: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index c5132002..3956f7dc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -79,7 +79,7 @@ dependencies: url: https://github.com/guozhigq/flutter_meedu_media_kit.git ref: feature-custom path: package - salomon_bottom_bar: ^3.3.2 + screenshot: ^1.3.0 dev_dependencies: flutter_test: