From ea38305793ba0e6b3ce7f1535f699d6eb34414da Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sun, 12 Nov 2023 14:36:22 +0800 Subject: [PATCH 01/30] =?UTF-8?q?fix:=20=E7=9B=B4=E6=92=AD=E5=80=8D?= =?UTF-8?q?=E9=80=9F=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/plugin/pl_player/controller.dart | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/plugin/pl_player/controller.dart b/lib/plugin/pl_player/controller.dart index 4d4d1a9b..c267d65f 100644 --- a/lib/plugin/pl_player/controller.dart +++ b/lib/plugin/pl_player/controller.dart @@ -443,10 +443,14 @@ class PlPlayerController { Duration seekTo = Duration.zero, }) async { // 设置倍速 - if (_playbackSpeed.value != 1.0) { - await setPlaybackSpeed(_playbackSpeed.value); - } else { + if (videoType.value == 'live') { await setPlaybackSpeed(1.0); + } else { + if (_playbackSpeed.value != 1.0) { + await setPlaybackSpeed(_playbackSpeed.value); + } else { + await setPlaybackSpeed(1.0); + } } getVideoFit(); // if (_looping) { From db5132a568f60f82c38eba407c4bbfc479bda12e Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sun, 12 Nov 2023 15:04:58 +0800 Subject: [PATCH 02/30] =?UTF-8?q?fix:=20app=E5=90=8E=E5=8F=B0=E6=97=B6?= =?UTF-8?q?=E8=87=AA=E5=8A=A8pip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/video/detail/view.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/pages/video/detail/view.dart b/lib/pages/video/detail/view.dart index 21695e9e..d67f9b66 100644 --- a/lib/pages/video/detail/view.dart +++ b/lib/pages/video/detail/view.dart @@ -218,7 +218,10 @@ class _VideoDetailPageState extends State @override void didChangeAppLifecycleState(AppLifecycleState lifecycleState) { - if (lifecycleState == AppLifecycleState.inactive && autoPiP) { + var routePath = Get.currentRoute; + if (lifecycleState == AppLifecycleState.inactive && + autoPiP && + routePath.startsWith('/video')) { floating.enable( aspectRatio: Rational( videoDetailController.data.dash!.video!.first.width!, From 5d6a935f3dc8f345aa1214a655096b580a69059c Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sun, 12 Nov 2023 15:24:35 +0800 Subject: [PATCH 03/30] mod: issues #101 --- lib/pages/dynamics/widgets/up_panel.dart | 107 ++++++++++++----------- 1 file changed, 56 insertions(+), 51 deletions(-) diff --git a/lib/pages/dynamics/widgets/up_panel.dart b/lib/pages/dynamics/widgets/up_panel.dart index 3db6c357..d1e3149a 100644 --- a/lib/pages/dynamics/widgets/up_panel.dart +++ b/lib/pages/dynamics/widgets/up_panel.dart @@ -56,67 +56,72 @@ class _UpPanelState extends State { floating: true, pinned: false, delegate: _SliverHeaderDelegate( - height: 90, - child: Container( - height: 90, - color: Theme.of(context).colorScheme.background, - child: Row( - children: [ - Expanded( - child: ListView( - scrollDirection: Axis.horizontal, - controller: scrollController, + height: 126, + child: Column( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.only(left: 16, right: 16), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - const SizedBox(width: 10), - if (liveList.isNotEmpty) ...[ - for (int i = 0; i < liveList.length; i++) ...[ - upItemBuild(liveList[i], i) - ], - VerticalDivider( - indent: 20, - endIndent: 40, - width: 26, - color: Theme.of(context) - .colorScheme - .primary - .withOpacity(0.5), + const Text('最新关注'), + GestureDetector( + onTap: () { + feedBack(); + Get.toNamed('/follow?mid=${userInfo.mid}'); + }, + child: Container( + padding: const EdgeInsets.only(top: 0, bottom: 4), + child: Text( + '查看全部', + style: TextStyle( + color: Theme.of(context).colorScheme.outline), + ), ), - ], - for (int i = 0; i < upList.length; i++) ...[ - upItemBuild(upList[i], i) - ], - const SizedBox(width: 10), + ), ], ), ), - Material( - child: InkWell( - onTap: () => { - feedBack(), - Get.toNamed('/follow?mid=${userInfo.mid}') - }, - child: Container( - height: 100, - padding: const EdgeInsets.only(left: 10, right: 10), - color: Theme.of(context) - .colorScheme - .secondaryContainer - .withOpacity(0.3), - child: Center( - child: Text( - '全部', - style: TextStyle( + ), + Container( + height: 90, + color: Theme.of(context).colorScheme.background, + child: Row( + children: [ + Expanded( + child: ListView( + scrollDirection: Axis.horizontal, + controller: scrollController, + children: [ + const SizedBox(width: 10), + if (liveList.isNotEmpty) ...[ + for (int i = 0; i < liveList.length; i++) ...[ + upItemBuild(liveList[i], i) + ], + VerticalDivider( + indent: 20, + endIndent: 40, + width: 26, color: Theme.of(context) .colorScheme - .onSecondaryContainer), - ), + .primary + .withOpacity(0.5), + ), + ], + for (int i = 0; i < upList.length; i++) ...[ + upItemBuild(upList[i], i) + ], + const SizedBox(width: 10), + ], ), ), - ), + ], ), - ], - )), - ), + ), + ], + )), ); } From 39a2c3f91fa770b05915a0bc80692396c9b298eb Mon Sep 17 00:00:00 2001 From: Infinite Date: Sun, 12 Nov 2023 15:58:42 +0800 Subject: [PATCH 04/30] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6d2c1d56..917ab2fd 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@

PiliPala

+ [![GitHub all releases](https://img.shields.io/github/downloads/guozhigq/pilipala/total)](https://github.com/guozhigq/pilipala/releases) +

使用Flutter开发的BiliBili第三方客户端


home From 95bd0ddfee15b9ec5427f7f2b9788c44bb5b192a Mon Sep 17 00:00:00 2001 From: Infinite Date: Sun, 12 Nov 2023 16:04:42 +0800 Subject: [PATCH 05/30] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 917ab2fd..ab317f13 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@

PiliPala

- [![GitHub all releases](https://img.shields.io/github/downloads/guozhigq/pilipala/total)](https://github.com/guozhigq/pilipala/releases) -

使用Flutter开发的BiliBili第三方客户端

+ ![GitHub all releases](https://img.shields.io/github/downloads/guozhigq/pilipala/total)] +
home home From 685cc35bb75df6ef058a8e07bf4ad9f0688aa7c5 Mon Sep 17 00:00:00 2001 From: Infinite Date: Sun, 12 Nov 2023 16:22:31 +0800 Subject: [PATCH 06/30] Update README.md --- README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ab317f13..b35870ef 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,18 @@
+

PiliPala

+
+ +![GitHub repo size](https://img.shields.io/github/repo-size/guozhigq/pilipala) +![GitHub Repo stars](https://img.shields.io/github/stars/guozhigq/pilipala) +![GitHub all releases](https://img.shields.io/github/downloads/guozhigq/pilipala/total) +

使用Flutter开发的BiliBili第三方客户端

- ![GitHub all releases](https://img.shields.io/github/downloads/guozhigq/pilipala/total)] - -
- home + + home home home
From 56b754e8d1cdd33a60538d422135fceccc254f61 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sun, 12 Nov 2023 16:26:41 +0800 Subject: [PATCH 07/30] =?UTF-8?q?fix:=20iOS=E7=AB=AF=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=A3=B0=E9=9F=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/plugin/pl_player/controller.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/plugin/pl_player/controller.dart b/lib/plugin/pl_player/controller.dart index c267d65f..17f461ac 100644 --- a/lib/plugin/pl_player/controller.dart +++ b/lib/plugin/pl_player/controller.dart @@ -1,6 +1,7 @@ // ignore_for_file: avoid_print import 'dart:async'; +import 'dart:io'; import 'dart:typed_data'; import 'package:easy_debounce/easy_throttle.dart'; @@ -380,8 +381,10 @@ class PlPlayerController { // 解除倍速限制 await pp.setProperty("af", "scaletempo2=max-speed=8"); // 音量不一致 - await pp.setProperty("volume-max", "100"); - await pp.setProperty("ao", "audiotrack,opensles"); + if (Platform.isAndroid) { + await pp.setProperty("volume-max", "100"); + await pp.setProperty("ao", "audiotrack,opensles"); + } // 音轨 if (dataSource.audioSource != '' && dataSource.audioSource != null) { From 0ed4e3393490160a4e93b6c7b8dfb9b09ed9bc22 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sun, 12 Nov 2023 17:20:42 +0800 Subject: [PATCH 08/30] =?UTF-8?q?fix:=20=E5=8A=A8=E6=80=81=E9=A1=B5?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/dynamics/view.dart | 9 +++++ lib/pages/dynamics/widgets/up_panel.dart | 47 ++++++++++++------------ 2 files changed, 33 insertions(+), 23 deletions(-) diff --git a/lib/pages/dynamics/view.dart b/lib/pages/dynamics/view.dart index cad4bbd7..facb89c9 100644 --- a/lib/pages/dynamics/view.dart +++ b/lib/pages/dynamics/view.dart @@ -231,6 +231,15 @@ class _DynamicsPageState extends State } }, ), + SliverToBoxAdapter( + child: Container( + height: 6, + color: Theme.of(context) + .colorScheme + .onInverseSurface + .withOpacity(0.5), + ), + ), FutureBuilder( future: _futureBuilderFuture, builder: (context, snapshot) { diff --git a/lib/pages/dynamics/widgets/up_panel.dart b/lib/pages/dynamics/widgets/up_panel.dart index d1e3149a..8a2c5dac 100644 --- a/lib/pages/dynamics/widgets/up_panel.dart +++ b/lib/pages/dynamics/widgets/up_panel.dart @@ -56,33 +56,34 @@ class _UpPanelState extends State { floating: true, pinned: false, delegate: _SliverHeaderDelegate( - height: 126, + height: 124, child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.only(left: 16, right: 16), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - const Text('最新关注'), - GestureDetector( - onTap: () { - feedBack(); - Get.toNamed('/follow?mid=${userInfo.mid}'); - }, - child: Container( - padding: const EdgeInsets.only(top: 0, bottom: 4), - child: Text( - '查看全部', - style: TextStyle( - color: Theme.of(context).colorScheme.outline), - ), + Container( + color: Theme.of(context).colorScheme.background, + padding: const EdgeInsets.only(left: 16, right: 16), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const Text('最新关注'), + GestureDetector( + onTap: () { + feedBack(); + Get.toNamed('/follow?mid=${userInfo.mid}'); + }, + child: Container( + padding: const EdgeInsets.only(top: 5, bottom: 5), + child: Text( + '查看全部', + style: TextStyle( + color: Theme.of(context).colorScheme.outline), ), ), - ], - ), + ), + ], ), ), Container( From c965c42a32f30d9b8a0c8f1a2b9f39a81ed555b6 Mon Sep 17 00:00:00 2001 From: Infinite Date: Sun, 12 Nov 2023 23:28:40 +0800 Subject: [PATCH 09/30] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b35870ef..46f6d986 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,12 @@

使用Flutter开发的BiliBili第三方客户端

- home - home - home -
- home -
+home +home +home +
+home +
## 开发环境 From 98c2a4243df38d49ac96ce8fdd8e954756c9cd73 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Mon, 13 Nov 2023 23:53:20 +0800 Subject: [PATCH 10/30] =?UTF-8?q?fix:=20duration=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84=E5=BC=B9=E5=B9=95=E5=8A=A0=E8=BD=BD=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20issues=20#241?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/plugin/pl_player/controller.dart | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/plugin/pl_player/controller.dart b/lib/plugin/pl_player/controller.dart index 17f461ac..8f09d0ca 100644 --- a/lib/plugin/pl_player/controller.dart +++ b/lib/plugin/pl_player/controller.dart @@ -338,7 +338,7 @@ class PlPlayerController { if (!_listenersInitialized) { startListeners(); } - await _initializePlayer(seekTo: seekTo); + await _initializePlayer(seekTo: seekTo, duration: _duration.value); bool autoEnterFullcreen = setting.get(SettingBoxKey.enableAutoEnter, defaultValue: false); if (autoEnterFullcreen && _isFirstTime) { @@ -444,6 +444,7 @@ class PlPlayerController { // 开始播放 Future _initializePlayer({ Duration seekTo = Duration.zero, + Duration? duration, }) async { // 设置倍速 if (videoType.value == 'live') { @@ -467,7 +468,7 @@ class PlPlayerController { // 自动播放 if (_autoPlay) { - await play(); + await play(duration: duration); } } @@ -596,6 +597,7 @@ class PlPlayerController { /// 设置倍速 Future setPlaybackSpeed(double speed) async { + /// TODO _duration.value丢失 await _videoPlayerController?.setRate(speed); try { DanmakuOption currentOption = danmakuController!.option; @@ -631,7 +633,9 @@ class PlPlayerController { // } /// 播放视频 - Future play({bool repeat = false, bool hideControls = true}) async { + /// TODO _duration.value丢失 + Future play( + {bool repeat = false, bool hideControls = true, dynamic duration}) async { // 播放时自动隐藏控制条 controls = !hideControls; // repeat为true,将从头播放 @@ -645,6 +649,9 @@ class PlPlayerController { playerStatus.status.value = PlayerStatus.playing; // screenManager.setOverlays(false); + + /// 临时fix _duration.value丢失 + _duration.value = duration; audioSessionHandler.setActive(true); } From bbfb3175fea0855e0fee80b3356be3a5b621a5fc Mon Sep 17 00:00:00 2001 From: guozhigq Date: Tue, 14 Nov 2023 00:06:16 +0800 Subject: [PATCH 11/30] =?UTF-8?q?fix:=20=E4=BB=A3=E7=90=86=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=9A=84=E7=BD=91=E7=BB=9C=E5=BC=82=E5=B8=B8=20issues?= =?UTF-8?q?=20#242?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/http/init.dart | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/lib/http/init.dart b/lib/http/init.dart index 6a60dca0..1e55be38 100644 --- a/lib/http/init.dart +++ b/lib/http/init.dart @@ -115,30 +115,24 @@ class Request { idleTimeout: const Duration(milliseconds: 10000), onClientCreate: (_, config) => config.onBadCertificate = (_) => true, ), - ) + ); - /// 设置代理 - ..httpClientAdapter = IOHttpClientAdapter( + /// 设置代理 + if (enableSystemProxy) { + dio.httpClientAdapter = IOHttpClientAdapter( createHttpClient: () { final client = HttpClient(); // Config the client. client.findProxy = (uri) { - if (enableSystemProxy) { - print('🌹:$systemProxyHost'); - print('🌹:$systemProxyPort'); - - // return 'PROXY host:port'; - return 'PROXY $systemProxyHost:$systemProxyPort'; - } else { - // 不设置代理 - return 'DIRECT'; - } + // return 'PROXY host:port'; + return 'PROXY $systemProxyHost:$systemProxyPort'; }; client.badCertificateCallback = (X509Certificate cert, String host, int port) => true; return client; }, ); + } //添加拦截器 dio.interceptors.add(ApiInterceptor()); From 96455092d16eb3461c798b42be9b249f5fe7d436 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Tue, 14 Nov 2023 00:19:35 +0800 Subject: [PATCH 12/30] =?UTF-8?q?v1.0.12=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- change_log/1.0.12.1114.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 change_log/1.0.12.1114.md diff --git a/change_log/1.0.12.1114.md b/change_log/1.0.12.1114.md new file mode 100644 index 00000000..55553286 --- /dev/null +++ b/change_log/1.0.12.1114.md @@ -0,0 +1,11 @@ +## 1.0.12 + + +### 修复 ++ iOS端视频播放时没有声音 ++ 超过6分钟弹幕不显示 ++ 视频详情页网络异常 + + +更多更新日志可在Github上查看 +问题反馈、功能建议请查看「关于」页面。 \ No newline at end of file From 1f1804b472b62cc483e0392fe2e5dbf7371694e7 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Tue, 14 Nov 2023 07:52:45 +0800 Subject: [PATCH 13/30] =?UTF-8?q?mod:=20=E4=BF=AE=E6=94=B9=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=B7=20v1.0.11=20->=20v1.0.12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 616e99e7..f600573b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.0.11 +version: 1.0.12 environment: sdk: ">=2.19.6 <3.0.0" From e73e02cf133b0a07940a5effbbae00031983beb6 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Mon, 27 Nov 2023 00:41:22 +0800 Subject: [PATCH 14/30] =?UTF-8?q?mod:=20=E4=B8=AA=E4=BA=BA=E4=B8=BB?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common/widgets/badge.dart | 32 -- lib/common/widgets/content_container.dart | 47 +++ lib/common/widgets/video_card_h.dart | 89 ++-- lib/http/api.dart | 34 +- lib/http/member.dart | 144 +++++++ lib/models/member/coin.dart | 89 ++++ lib/models/member/seasons.dart | 108 +++++ lib/pages/danmaku/view.dart | 8 +- lib/pages/member/archive/index.dart | 4 - lib/pages/member/archive/view.dart | 240 ----------- lib/pages/member/controller.dart | 43 +- lib/pages/member/dynamic/controller.dart | 31 -- lib/pages/member/dynamic/view.dart | 152 ------- lib/pages/member/view.dart | 393 ++++++++++-------- lib/pages/member/widgets/conis.dart | 31 ++ lib/pages/member/widgets/profile.dart | 5 +- lib/pages/member/widgets/seasons.dart | 85 ++++ .../controller.dart | 30 +- lib/pages/member_archive/index.dart | 4 + lib/pages/member_archive/view.dart | 120 ++++++ lib/pages/member_coin/controller.dart | 3 + .../dynamic => member_coin}/index.dart | 2 +- lib/pages/member_coin/view.dart | 15 + lib/pages/member_coin/widgets/item.dart | 95 +++++ lib/pages/member_dynamics/controller.dart | 41 ++ lib/pages/member_dynamics/index.dart | 4 + lib/pages/member_dynamics/view.dart | 86 ++++ lib/pages/member_like/controller.dart | 3 + lib/pages/member_like/index.dart | 4 + lib/pages/member_like/view.dart | 15 + lib/pages/member_seasons/controller.dart | 47 +++ lib/pages/member_seasons/index.dart | 4 + lib/pages/member_seasons/view.dart | 103 +++++ lib/pages/member_seasons/widgets/item.dart | 98 +++++ .../video/detail/introduction/controller.dart | 9 +- lib/pages/video/detail/introduction/view.dart | 8 +- lib/router/app_pages.dart | 18 + lib/utils/utils.dart | 2 +- 38 files changed, 1550 insertions(+), 696 deletions(-) create mode 100644 lib/common/widgets/content_container.dart create mode 100644 lib/models/member/coin.dart create mode 100644 lib/models/member/seasons.dart delete mode 100644 lib/pages/member/archive/index.dart delete mode 100644 lib/pages/member/archive/view.dart delete mode 100644 lib/pages/member/dynamic/controller.dart delete mode 100644 lib/pages/member/dynamic/view.dart create mode 100644 lib/pages/member/widgets/conis.dart create mode 100644 lib/pages/member/widgets/seasons.dart rename lib/pages/{member/archive => member_archive}/controller.dart (54%) create mode 100644 lib/pages/member_archive/index.dart create mode 100644 lib/pages/member_archive/view.dart create mode 100644 lib/pages/member_coin/controller.dart rename lib/pages/{member/dynamic => member_coin}/index.dart (68%) create mode 100644 lib/pages/member_coin/view.dart create mode 100644 lib/pages/member_coin/widgets/item.dart create mode 100644 lib/pages/member_dynamics/controller.dart create mode 100644 lib/pages/member_dynamics/index.dart create mode 100644 lib/pages/member_dynamics/view.dart create mode 100644 lib/pages/member_like/controller.dart create mode 100644 lib/pages/member_like/index.dart create mode 100644 lib/pages/member_like/view.dart create mode 100644 lib/pages/member_seasons/controller.dart create mode 100644 lib/pages/member_seasons/index.dart create mode 100644 lib/pages/member_seasons/view.dart create mode 100644 lib/pages/member_seasons/widgets/item.dart diff --git a/lib/common/widgets/badge.dart b/lib/common/widgets/badge.dart index baa2bff2..a8f2fc67 100644 --- a/lib/common/widgets/badge.dart +++ b/lib/common/widgets/badge.dart @@ -1,37 +1,5 @@ import 'package:flutter/material.dart'; -// Widget pBadge( -// text, -// context, -// double? top, -// double? right, -// double? bottom, -// double? left, { -// type = 'primary', -// }) { -// Color bgColor = Theme.of(context).colorScheme.primary; -// Color color = Theme.of(context).colorScheme.onPrimary; -// if (type == 'gray') { -// bgColor = Colors.black54.withOpacity(0.4); -// color = Colors.white; -// } -// return Positioned( -// top: top, -// left: left, -// right: right, -// bottom: bottom, -// child: Container( -// padding: const EdgeInsets.symmetric(vertical: 1, horizontal: 6), -// decoration: -// BoxDecoration(borderRadius: BorderRadius.circular(4), color: bgColor), -// child: Text( -// text, -// style: TextStyle(fontSize: 11, color: color), -// ), -// ), -// ); -// } - class PBadge extends StatelessWidget { final String? text; final double? top; diff --git a/lib/common/widgets/content_container.dart b/lib/common/widgets/content_container.dart new file mode 100644 index 00000000..076a02e9 --- /dev/null +++ b/lib/common/widgets/content_container.dart @@ -0,0 +1,47 @@ +import 'package:flutter/material.dart'; + +class ContentContainer extends StatelessWidget { + final Widget? contentWidget; + final Widget? bottomWidget; + final bool isScrollable; + final Clip? childClipBehavior; + + const ContentContainer( + {Key? key, + this.contentWidget, + this.bottomWidget, + this.isScrollable = true, + this.childClipBehavior}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return LayoutBuilder( + builder: (BuildContext context, BoxConstraints constraints) { + return SingleChildScrollView( + clipBehavior: childClipBehavior ?? Clip.hardEdge, + physics: isScrollable ? null : NeverScrollableScrollPhysics(), + child: ConstrainedBox( + constraints: constraints.copyWith( + minHeight: constraints.maxHeight, + maxHeight: double.infinity, + ), + child: IntrinsicHeight( + child: Column( + children: [ + if (contentWidget != null) + Expanded( + child: contentWidget!, + ) + else + Spacer(), + if (bottomWidget != null) bottomWidget!, + ], + ), + ), + ), + ); + }, + ); + } +} diff --git a/lib/common/widgets/video_card_h.dart b/lib/common/widgets/video_card_h.dart index 6d4fa61a..551f4063 100644 --- a/lib/common/widgets/video_card_h.dart +++ b/lib/common/widgets/video_card_h.dart @@ -17,6 +17,10 @@ class VideoCardH extends StatelessWidget { final Function()? longPress; final Function()? longPressEnd; final String source; + final bool showOwner; + final bool showView; + final bool showDanmaku; + final bool showPubdate; const VideoCardH({ Key? key, @@ -24,6 +28,10 @@ class VideoCardH extends StatelessWidget { this.longPress, this.longPressEnd, this.source = 'normal', + this.showOwner = true, + this.showView = true, + this.showDanmaku = true, + this.showPubdate = false, }) : super(key: key); @override @@ -103,7 +111,14 @@ class VideoCardH extends StatelessWidget { }, ), ), - VideoContent(videoItem: videoItem, source: source) + VideoContent( + videoItem: videoItem, + source: source, + showOwner: showOwner, + showView: showView, + showDanmaku: showDanmaku, + showPubdate: showPubdate, + ) ], ), ); @@ -119,8 +134,20 @@ class VideoContent extends StatelessWidget { // ignore: prefer_typing_uninitialized_variables final videoItem; final String source; - const VideoContent( - {super.key, required this.videoItem, this.source = 'normal'}); + final bool showOwner; + final bool showView; + final bool showDanmaku; + final bool showPubdate; + + const VideoContent({ + super.key, + required this.videoItem, + this.source = 'normal', + this.showOwner = true, + this.showView = true, + this.showDanmaku = true, + this.showPubdate = false, + }); @override Widget build(BuildContext context) { @@ -179,34 +206,40 @@ class VideoContent extends StatelessWidget { // ), // ), // const SizedBox(height: 4), - Row( - children: [ - Text( - videoItem.owner.name, - style: TextStyle( - fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, - color: Theme.of(context).colorScheme.outline, + if (showPubdate) + Text( + Utils.dateFormat(videoItem.pubdate!), + style: TextStyle( + fontSize: 11, color: Theme.of(context).colorScheme.outline), + ), + if (showOwner) + Row( + children: [ + Text( + videoItem.owner.name, + style: TextStyle( + fontSize: + Theme.of(context).textTheme.labelMedium!.fontSize, + color: Theme.of(context).colorScheme.outline, + ), ), - ), - ], - ), + ], + ), Row( children: [ - StatView( - theme: 'gray', - view: videoItem.stat.view, - ), - const SizedBox(width: 8), - StatDanMu( - theme: 'gray', - danmu: videoItem.stat.danmaku, - ), - // Text( - // Utils.dateFormat(videoItem.pubdate!), - // style: TextStyle( - // fontSize: 11, - // color: Theme.of(context).colorScheme.outline), - // ) + if (showView) ...[ + StatView( + theme: 'gray', + view: videoItem.stat.view, + ), + const SizedBox(width: 8), + ], + if (showDanmaku) + StatDanMu( + theme: 'gray', + danmu: videoItem.stat.danmaku, + ), + const Spacer(), // SizedBox( // width: 20, diff --git a/lib/http/api.dart b/lib/http/api.dart index 042d8e11..af7d8b9e 100644 --- a/lib/http/api.dart +++ b/lib/http/api.dart @@ -215,7 +215,7 @@ class Api { // 粉丝 // vmid 用户id pn 页码 ps 每页个数,最大50 order: desc // order_type 排序规则 最近访问传空,最常访问传 attention - static const String fans = 'https://api.bilibili.com/x/relation/fans'; + static const String fans = '/x/relation/fans'; // 直播 // ?page=1&page_size=30&platform=web @@ -372,4 +372,36 @@ class Api { /// local_id static const getWebKey = 'https://passport.bilibili.com/x/passport-login/web/key'; + + /// 置顶视频 + static const getTopVideoApi = '/x/space/top/arc'; + + /// 主页 - 最近投币的视频 + /// vmid + /// gaia_source = main_web + /// web_location + /// w_rid + /// wts + static const getRecentCoinVideoApi = '/x/space/coin/video'; + + /// 最近点赞的视频 + static const getRecentLikeVideoApi = '/x/space/like/video'; + + /// 最近追番 + static const getRecentBangumiApi = '/x/space/bangumi/follow/list'; + + /// 用户专栏 + static const getMemberSeasonsApi = '/x/polymer/web-space/home/seasons_series'; + + /// 获赞数 播放数 + static const getMemberViewApi = '/x/space/upstat'; + + /// 查询某个专栏 + /// mid + /// season_id + /// sort_reverse + /// page_num + /// page_size + static const getSeasonDetailApi = + '/x/polymer/web-space/seasons_archives_list'; } diff --git a/lib/http/member.dart b/lib/http/member.dart index a48dbffd..9dc6da85 100644 --- a/lib/http/member.dart +++ b/lib/http/member.dart @@ -1,8 +1,12 @@ +import 'dart:ffi'; + import 'package:pilipala/http/index.dart'; import 'package:pilipala/models/dynamics/result.dart'; import 'package:pilipala/models/follow/result.dart'; import 'package:pilipala/models/member/archive.dart'; +import 'package:pilipala/models/member/coin.dart'; import 'package:pilipala/models/member/info.dart'; +import 'package:pilipala/models/member/seasons.dart'; import 'package:pilipala/models/member/tags.dart'; import 'package:pilipala/utils/wbi_sign.dart'; @@ -215,4 +219,144 @@ class MemberHttp { }; } } + + // 获取up置顶 + static Future getTopVideo(String? vmid) async { + var res = await Request().get(Api.getTopVideoApi); + if (res.data['code'] == 0) { + return { + 'status': true, + 'data': res.data['data'] + .map((e) => MemberTagItemModel.fromJson(e)) + .toList() + }; + } else { + return { + 'status': false, + 'data': [], + 'msg': res.data['message'], + }; + } + } + + // 获取uo专栏 + static Future getMemberSeasons(int? mid, int? pn, int? ps) async { + var res = await Request().get(Api.getMemberSeasonsApi, data: { + 'mid': mid, + 'page_num': pn, + 'page_size': ps, + }); + if (res.data['code'] == 0) { + return { + 'status': true, + 'data': MemberSeasonsDataModel.fromJson(res.data['data']['items_lists']) + }; + } else { + return { + 'status': false, + 'data': [], + 'msg': res.data['message'], + }; + } + } + + // 最近投币 + static Future getRecentCoinVideo({required int mid}) async { + Map params = await WbiSign().makSign({ + 'mid': mid, + 'gaia_source': 'main_web', + 'web_location': 333.999, + }); + var res = await Request().get( + Api.getRecentCoinVideoApi, + data: { + 'vmid': mid, + 'gaia_source': 'main_web', + 'web_location': 333.999, + 'w_rid': params['w_rid'], + 'wts': params['wts'], + }, + ); + if (res.data['code'] == 0) { + return { + 'status': true, + 'data': res.data['data'] + .map((e) => MemberCoinsDataModel.fromJson(e)) + .toList(), + }; + } else { + return { + 'status': false, + 'data': [], + 'msg': res.data['message'], + }; + } + } + + // 最近点赞 + static Future getRecentLikeVideo({required int mid}) async { + Map params = await WbiSign().makSign({ + 'mid': mid, + 'gaia_source': 'main_web', + 'web_location': 333.999, + }); + var res = await Request().get( + Api.getRecentLikeVideoApi, + data: { + 'vmid': mid, + 'gaia_source': 'main_web', + 'web_location': 333.999, + 'w_rid': params['w_rid'], + 'wts': params['wts'], + }, + ); + if (res.data['code'] == 0) { + return { + 'status': true, + 'data': MemberSeasonsDataModel.fromJson(res.data['data']['items_lists']) + }; + } else { + return { + 'status': false, + 'data': [], + 'msg': res.data['message'], + }; + } + } + + // 查看某个专栏 + static Future getSeasonDetail({ + required int mid, + required int seasonId, + bool sortReverse = false, + required int pn, + required int ps, + }) async { + var res = await Request().get( + Api.getSeasonDetailApi, + data: { + 'mid': mid, + 'season_id': seasonId, + 'sort_reverse': sortReverse, + 'page_num': pn, + 'page_size': ps, + }, + ); + if (res.data['code'] == 0) { + try { + return { + 'status': true, + 'data': MemberSeasonsList.fromJson(res.data['data']) + }; + } catch (err) { + print(err); + } + } else { + return { + 'status': false, + 'data': [], + 'msg': res.data['message'], + }; + } + } } diff --git a/lib/models/member/coin.dart b/lib/models/member/coin.dart new file mode 100644 index 00000000..701131f1 --- /dev/null +++ b/lib/models/member/coin.dart @@ -0,0 +1,89 @@ +class MemberCoinsDataModel { + MemberCoinsDataModel({ + this.aid, + this.bvid, + this.cid, + this.coins, + this.copyright, + this.ctime, + this.desc, + this.duration, + this.owner, + this.pic, + this.pubLocation, + this.pubdate, + this.resourceType, + this.state, + this.subtitle, + this.time, + this.title, + this.tname, + this.videos, + this.view, + this.danmaku, + }); + + int? aid; + String? bvid; + int? cid; + int? coins; + int? copyright; + int? ctime; + String? desc; + int? duration; + Owner? owner; + String? pic; + String? pubLocation; + int? pubdate; + String? resourceType; + int? state; + String? subtitle; + int? time; + String? title; + String? tname; + int? videos; + int? view; + int? danmaku; + + MemberCoinsDataModel.fromJson(Map json) { + aid = json['aid']; + bvid = json['bvid']; + cid = json['cid']; + coins = json['coins']; + copyright = json['copyright']; + ctime = json['ctime']; + desc = json['desc']; + duration = json['duration']; + owner = Owner.fromJson(json['owner']); + pic = json['pic']; + pubLocation = json['pub_location']; + pubdate = json['pubdate']; + resourceType = json['resource_type']; + state = json['state']; + subtitle = json['subtitle']; + time = json['time']; + title = json['title']; + tname = json['tname']; + videos = json['videos']; + view = json['stat']['view']; + danmaku = json['stat']['danmaku']; + } +} + +class Owner { + Owner({ + this.mid, + this.name, + this.face, + }); + + int? mid; + String? name; + String? face; + + Owner.fromJson(Map json) { + mid = json['mid']; + name = json['name']; + face = json['face']; + } +} diff --git a/lib/models/member/seasons.dart b/lib/models/member/seasons.dart new file mode 100644 index 00000000..70230367 --- /dev/null +++ b/lib/models/member/seasons.dart @@ -0,0 +1,108 @@ +class MemberSeasonsDataModel { + MemberSeasonsDataModel({ + this.page, + this.seasonsList, + }); + + Map? page; + List? seasonsList; + + MemberSeasonsDataModel.fromJson(Map json) { + page = json['page']; + seasonsList = json['seasons_list'] != null + ? json['seasons_list'] + .map((e) => MemberSeasonsList.fromJson(e)) + .toList() + : []; + } +} + +class MemberSeasonsList { + MemberSeasonsList({ + this.archives, + this.meta, + this.recentAids, + this.page, + }); + + List? archives; + MamberMeta? meta; + List? recentAids; + Map? page; + + MemberSeasonsList.fromJson(Map json) { + archives = json['archives'] != null + ? json['archives'] + .map((e) => MemberArchiveItem.fromJson(e)) + .toList() + : []; + meta = MamberMeta.fromJson(json['meta']); + page = json['page']; + } +} + +class MemberArchiveItem { + MemberArchiveItem({ + this.aid, + this.bvid, + this.ctime, + this.duration, + this.pic, + this.cover, + this.pubdate, + this.view, + this.title, + }); + + int? aid; + String? bvid; + int? ctime; + int? duration; + String? pic; + String? cover; + int? pubdate; + int? view; + String? title; + + MemberArchiveItem.fromJson(Map json) { + aid = json['aid']; + bvid = json['bvid']; + ctime = json['ctime']; + duration = json['duration']; + pic = json['pic']; + cover = json['pic']; + pubdate = json['pubdate']; + view = json['stat']['view']; + title = json['title']; + } +} + +class MamberMeta { + MamberMeta({ + this.cover, + this.description, + this.mid, + this.name, + this.ptime, + this.seasonId, + this.total, + }); + + String? cover; + String? description; + int? mid; + String? name; + int? ptime; + int? seasonId; + int? total; + + MamberMeta.fromJson(Map json) { + cover = json['cover']; + description = json['description']; + mid = json['mid']; + name = json['name']; + ptime = json['ptime']; + seasonId = json['season_id']; + total = json['total']; + } +} diff --git a/lib/pages/danmaku/view.dart b/lib/pages/danmaku/view.dart index 317d47e9..4f5527ff 100644 --- a/lib/pages/danmaku/view.dart +++ b/lib/pages/danmaku/view.dart @@ -95,8 +95,12 @@ class _PlDanmakuState extends State { // 根据position判断是否有已缓存弹幕。没有则请求对应段 int segIndex = (currentPosition / (6 * 60 * 1000)).ceil(); segIndex = segIndex < 1 ? 1 : segIndex; - if (ctr.dmSegList[segIndex - 1].elems.isEmpty && - !ctr.hasrequestSeg.contains(segIndex - 1)) { + print('🌹🌹: ${segIndex}'); + print('🌹🌹: ${ctr.dmSegList.length}'); + print('🌹🌹: ${ctr.hasrequestSeg.contains(segIndex - 1)}'); + if (segIndex - 1 >= ctr.dmSegList.length || + (ctr.dmSegList[segIndex - 1].elems.isEmpty && + !ctr.hasrequestSeg.contains(segIndex - 1))) { ctr.hasrequestSeg.add(segIndex - 1); ctr.currentSegIndex = segIndex; EasyThrottle.throttle('follow', const Duration(seconds: 1), () { diff --git a/lib/pages/member/archive/index.dart b/lib/pages/member/archive/index.dart deleted file mode 100644 index 8be45429..00000000 --- a/lib/pages/member/archive/index.dart +++ /dev/null @@ -1,4 +0,0 @@ -library archive_panel; - -export './controller.dart'; -export 'index.dart'; diff --git a/lib/pages/member/archive/view.dart b/lib/pages/member/archive/view.dart deleted file mode 100644 index f34a396c..00000000 --- a/lib/pages/member/archive/view.dart +++ /dev/null @@ -1,240 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; -import 'package:loading_more_list/loading_more_list.dart'; -import 'package:pilipala/common/widgets/video_card_h.dart'; -import 'package:pilipala/models/member/archive.dart'; -import 'package:pilipala/pages/member/archive/index.dart'; -import 'package:pilipala/utils/utils.dart'; -import 'package:pull_to_refresh_notification/pull_to_refresh_notification.dart'; - -class ArchivePanel extends StatefulWidget { - final int? mid; - const ArchivePanel({super.key, this.mid}); - - @override - State createState() => _ArchivePanelState(); -} - -class _ArchivePanelState extends State - with AutomaticKeepAliveClientMixin { - DateTime lastRefreshTime = DateTime.now(); - late final LoadMoreListSource source; - late final ArchiveController _archiveController; - - @override - bool get wantKeepAlive => true; - - @override - void initState() { - super.initState(); - print('🐶🐶: ${widget.mid}'); - _archiveController = Get.put(ArchiveController(widget.mid), - tag: Utils.makeHeroTag(widget.mid)); - source = LoadMoreListSource(_archiveController); - } - - @override - Widget build(BuildContext context) { - super.build(context); - return PullToRefreshNotification( - onRefresh: () async { - await Future.delayed(const Duration(seconds: 1)); - return true; - }, - maxDragOffset: 50, - child: GlowNotificationWidget( - Column( - children: [ - // 下拉刷新指示器 - // PullToRefreshContainer( - // (PullToRefreshScrollNotificationInfo? info) { - // return PullToRefreshHeader(info, lastRefreshTime); - // }, - // ), - Padding( - padding: - const EdgeInsets.only(left: 14, top: 8, bottom: 8, right: 8), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - const Text('排序方式'), - SizedBox( - height: 35, - width: 85, - child: TextButton( - style: ButtonStyle( - padding: MaterialStateProperty.all(EdgeInsets.zero), - ), - onPressed: () { - // _archiveController.order = 'click'; - // _archiveController.pn = 1; - _archiveController.toggleSort(); - source.refresh(true); - // LoadMoreListSource().loadData(); - }, - child: Obx( - () => AnimatedSwitcher( - duration: const Duration(milliseconds: 400), - transitionBuilder: - (Widget child, Animation animation) { - return ScaleTransition( - scale: animation, child: child); - }, - child: Text( - _archiveController.currentOrder['label']!, - key: ValueKey( - _archiveController.currentOrder['label']!), - ), - ), - ), - ), - ), - ], - ), - ), - Expanded( - child: LoadingMoreList( - ListConfig( - sourceList: source, - itemBuilder: - (BuildContext c, VListItemModel item, int index) { - if (index == 0) { - return Column( - children: [ - const SizedBox(height: 6), - VideoCardH(videoItem: item) - ], - ); - } else { - return VideoCardH(videoItem: item); - } - }, - indicatorBuilder: _buildIndicator, - ), - ), - ) - ], - ), - showGlowLeading: false, - ), - ); - } - - Widget _buildIndicator(BuildContext context, IndicatorStatus status) { - TextStyle style = - TextStyle(fontSize: 13, color: Theme.of(context).colorScheme.outline); - Widget? widget; - switch (status) { - case IndicatorStatus.none: - widget = Container(height: 0.0); - break; - case IndicatorStatus.loadingMoreBusying: - widget = Text('加载中...', style: style); - widget = _setbackground(false, widget, height: 60.0); - break; - case IndicatorStatus.fullScreenBusying: - widget = Text('加载中...', style: style); - widget = _setbackground(true, widget); - break; - case IndicatorStatus.error: - - /// TODO 异常逻辑 - widget = Text('没有更多了', style: style); - widget = _setbackground(false, widget); - - widget = GestureDetector( - onTap: () {}, - child: widget, - ); - - break; - case IndicatorStatus.fullScreenError: - - /// TODO 异常逻辑 - widget = Text('没有更多了', style: style); - widget = _setbackground(true, widget); - widget = GestureDetector( - onTap: () {}, - child: widget, - ); - break; - case IndicatorStatus.noMoreLoad: - widget = Text('没有更多了', style: style); - widget = _setbackground(false, widget, height: 60.0); - break; - case IndicatorStatus.empty: - widget = Text('用户没有投稿', style: style); - widget = _setbackground(true, widget); - break; - } - return widget; - } - - Widget _setbackground(bool full, Widget widget, {double height = 100}) { - widget = Padding( - padding: height == double.infinity - ? EdgeInsets.zero - : EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom), - child: Container( - width: double.infinity, - height: height, - color: Theme.of(context).colorScheme.background, - alignment: Alignment.center, - child: widget, - ), - ); - return widget; - } - - Widget getIndicator(BuildContext context) { - final TargetPlatform platform = Theme.of(context).platform; - return platform == TargetPlatform.iOS - ? const CupertinoActivityIndicator( - animating: true, - radius: 16.0, - ) - : CircularProgressIndicator( - strokeWidth: 2.0, - valueColor: - AlwaysStoppedAnimation(Theme.of(context).primaryColor), - ); - } -} - -class LoadMoreListSource extends LoadingMoreBase { - late ArchiveController ctr; - LoadMoreListSource(this.ctr); - bool forceRefresh = false; - - @override - Future loadData([bool isloadMoreAction = false]) async { - bool isSuccess = false; - var res = await ctr.getMemberArchive(); - if (res['status']) { - if (ctr.pn == 2) { - clear(); - } - addAll(res['data'].list.vlist); - } - if (length < res['data'].page['count']) { - isSuccess = true; - } else { - isSuccess = false; - } - return isSuccess; - } - - @override - Future refresh([bool clearBeforeRequest = false]) async { - // _hasMore = true; - // pageindex = 1; - // //force to refresh list when you don't want clear list before request - // //for the case, if your list already has 20 items. - forceRefresh = !clearBeforeRequest; - var result = await super.refresh(clearBeforeRequest); - - forceRefresh = false; - return result; - } -} diff --git a/lib/pages/member/controller.dart b/lib/pages/member/controller.dart index 0d40ec65..49a448f1 100644 --- a/lib/pages/member/controller.dart +++ b/lib/pages/member/controller.dart @@ -6,6 +6,7 @@ import 'package:pilipala/http/member.dart'; import 'package:pilipala/http/user.dart'; import 'package:pilipala/http/video.dart'; import 'package:pilipala/models/member/archive.dart'; +import 'package:pilipala/models/member/coin.dart'; import 'package:pilipala/models/member/info.dart'; import 'package:pilipala/utils/storage.dart'; import 'package:share_plus/share_plus.dart'; @@ -20,9 +21,10 @@ class MemberController extends GetxController { late int ownerMid; // 投稿列表 RxList? archiveList = [VListItemModel()].obs; - var userInfo; + dynamic userInfo; RxInt attribute = (-1).obs; RxString attributeText = '关注'.obs; + RxList recentCoinsList = [].obs; @override void onInit() { @@ -55,14 +57,6 @@ class MemberController extends GetxController { return res; } - // Future getMemberCardInfo() async { - // var res = await MemberHttp.memberCardInfo(mid: mid); - // if (res['status']) { - // print(userStat); - // } - // return res; - // } - // 关注/取关up Future actionRelationMod() async { if (userInfo == null) { @@ -173,4 +167,35 @@ class MemberController extends GetxController { void shareUser() { Share.share('${memberInfo.value.name} - https://space.bilibili.com/$mid'); } + + // 请求专栏 + Future getMemberSeasons() async { + if (userInfo == null) return; + var res = await MemberHttp.getMemberSeasons(mid, 1, 10); + if (!res['status']) { + SmartDialog.showToast("用户专栏请求异常:${res['msg']}"); + } + return res; + } + + // 请求投币视频 + Future getRecentCoinVideo() async { + if (userInfo == null) return; + var res = await MemberHttp.getRecentCoinVideo(mid: mid); + recentCoinsList.value = res['data']; + return res; + } + + // 跳转查看动态 + void pushDynamicsPage() => Get.toNamed('/memberDynamics?mid=$mid'); + + // 跳转查看投稿 + void pushArchivesPage() => Get.toNamed('/memberArchive?mid=$mid'); + + // 跳转查看专栏 + void pushSeasonsPage() {} + // 跳转查看最近投币 + void pushRecentCoinsPage() async { + if (recentCoinsList.isNotEmpty) {} + } } diff --git a/lib/pages/member/dynamic/controller.dart b/lib/pages/member/dynamic/controller.dart deleted file mode 100644 index 056240ad..00000000 --- a/lib/pages/member/dynamic/controller.dart +++ /dev/null @@ -1,31 +0,0 @@ -import 'package:get/get.dart'; -import 'package:pilipala/http/member.dart'; - -class MemberDynamicPanelController extends GetxController { - MemberDynamicPanelController(this.mid); - int? mid; - String offset = ''; - int count = 0; - bool hasMore = true; - - @override - void onInit() { - super.onInit(); - mid ??= int.parse(Get.parameters['mid']!); - } - - Future getMemberDynamic() async { - if (!hasMore) { - return {'status': false}; - } - var res = await MemberHttp.memberDynamic( - offset: offset, - mid: mid, - ); - if (res['status']) { - offset = res['data'].offset; - hasMore = res['data'].hasMore; - } - return res; - } -} diff --git a/lib/pages/member/dynamic/view.dart b/lib/pages/member/dynamic/view.dart deleted file mode 100644 index 15d7376e..00000000 --- a/lib/pages/member/dynamic/view.dart +++ /dev/null @@ -1,152 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; -import 'package:loading_more_list/loading_more_list.dart'; -import 'package:pilipala/models/dynamics/result.dart'; -import 'package:pilipala/pages/dynamics/widgets/dynamic_panel.dart'; -import 'package:pilipala/utils/utils.dart'; - -import 'controller.dart'; - -class MemberDynamicPanel extends StatefulWidget { - final int? mid; - const MemberDynamicPanel({super.key, this.mid}); - - @override - State createState() => _MemberDynamicPanelState(); -} - -class _MemberDynamicPanelState extends State - with AutomaticKeepAliveClientMixin { - DateTime lastRefreshTime = DateTime.now(); - late final LoadMoreListSource source; - late final MemberDynamicPanelController _dynamicController; - - @override - bool get wantKeepAlive => true; - - @override - void initState() { - super.initState(); - _dynamicController = Get.put(MemberDynamicPanelController(widget.mid), - tag: Utils.makeHeroTag(widget.mid)); - source = LoadMoreListSource(_dynamicController); - } - - @override - Widget build(BuildContext context) { - super.build(context); - return LoadingMoreList( - ListConfig( - sourceList: source, - itemBuilder: (BuildContext c, DynamicItemModel item, int index) { - return DynamicPanel(item: item); - }, - indicatorBuilder: _buildIndicator, - ), - ); - } - - Widget _buildIndicator(BuildContext context, IndicatorStatus status) { - TextStyle style = - TextStyle(fontSize: 13, color: Theme.of(context).colorScheme.outline); - Widget? widget; - switch (status) { - case IndicatorStatus.none: - widget = Container(height: 0.0); - break; - case IndicatorStatus.loadingMoreBusying: - widget = Text('加载中...', style: style); - widget = _setbackground(false, widget, height: 60.0); - break; - case IndicatorStatus.fullScreenBusying: - widget = Text('加载中...', style: style); - widget = _setbackground(true, widget); - break; - case IndicatorStatus.error: - - /// TODO 异常逻辑 - widget = Text('没有更多了', style: style); - widget = _setbackground(false, widget); - - widget = GestureDetector( - onTap: () {}, - child: widget, - ); - - break; - case IndicatorStatus.fullScreenError: - - /// TODO 异常逻辑 - widget = Text('没有更多了', style: style); - widget = _setbackground(true, widget); - widget = GestureDetector( - onTap: () {}, - child: widget, - ); - break; - case IndicatorStatus.noMoreLoad: - widget = Text('没有更多了', style: style); - widget = _setbackground(false, widget, height: 60.0); - break; - case IndicatorStatus.empty: - widget = Text('用户没有投稿', style: style); - widget = _setbackground(true, widget); - break; - } - return widget; - } - - Widget _setbackground(bool full, Widget widget, {double height = 100}) { - widget = Padding( - padding: height == double.infinity - ? EdgeInsets.zero - : EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom), - child: Container( - width: double.infinity, - height: height, - color: Theme.of(context).colorScheme.background, - alignment: Alignment.center, - child: widget, - ), - ); - return widget; - } - - Widget getIndicator(BuildContext context) { - final TargetPlatform platform = Theme.of(context).platform; - return platform == TargetPlatform.iOS - ? const CupertinoActivityIndicator( - animating: true, - radius: 16.0, - ) - : CircularProgressIndicator( - strokeWidth: 2.0, - valueColor: - AlwaysStoppedAnimation(Theme.of(context).primaryColor), - ); - } -} - -class LoadMoreListSource extends LoadingMoreBase { - late MemberDynamicPanelController ctr; - LoadMoreListSource(this.ctr); - - @override - Future loadData([bool isloadMoreAction = false]) async { - bool isSuccess = false; - var res = await ctr.getMemberDynamic(); - if (res['status']) { - addAll(res['data'].items); - } - try { - if (res['data'].hasMore) { - isSuccess = true; - } else { - isSuccess = false; - } - } catch (_) {} - - return isSuccess; - } -} diff --git a/lib/pages/member/view.dart b/lib/pages/member/view.dart index 6fb8e228..08645777 100644 --- a/lib/pages/member/view.dart +++ b/lib/pages/member/view.dart @@ -1,16 +1,16 @@ import 'dart:async'; -import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:get/get.dart'; +import 'package:pilipala/common/constants.dart'; import 'package:pilipala/common/widgets/network_img_layer.dart'; -import 'package:pilipala/pages/member/archive/view.dart'; -import 'package:pilipala/pages/member/dynamic/index.dart'; import 'package:pilipala/pages/member/index.dart'; import 'package:pilipala/utils/utils.dart'; +import 'widgets/conis.dart'; import 'widgets/profile.dart'; +import 'widgets/seasons.dart'; class MemberPage extends StatefulWidget { const MemberPage({super.key}); @@ -23,9 +23,10 @@ class _MemberPageState extends State with SingleTickerProviderStateMixin { late String heroTag; late MemberController _memberController; - Future? _futureBuilderFuture; + late Future _futureBuilderFuture; + late Future _memberSeasonsFuture; + late Future _memberCoinsFuture; final ScrollController _extendNestCtr = ScrollController(); - late TabController _tabController; final StreamController appbarStream = StreamController(); late int mid; @@ -35,12 +36,13 @@ class _MemberPageState extends State mid = int.parse(Get.parameters['mid']!); heroTag = Get.arguments['heroTag'] ?? Utils.makeHeroTag(mid); _memberController = Get.put(MemberController(), tag: heroTag); - _tabController = TabController(length: 3, vsync: this, initialIndex: 2); _futureBuilderFuture = _memberController.getInfo(); + _memberSeasonsFuture = _memberController.getMemberSeasons(); + _memberCoinsFuture = _memberController.getRecentCoinVideo(); _extendNestCtr.addListener( () { double offset = _extendNestCtr.position.pixels; - if (offset > 230) { + if (offset > 100) { appbarStream.add(true); } else { appbarStream.add(false); @@ -59,183 +61,222 @@ class _MemberPageState extends State Widget build(BuildContext context) { return Scaffold( primary: true, - body: ExtendedNestedScrollView( - controller: _extendNestCtr, - headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { - return [ - SliverAppBar( - pinned: false, - primary: true, - elevation: 0, - scrolledUnderElevation: 1, - forceElevated: innerBoxIsScrolled, - expandedHeight: 290, - titleSpacing: 0, - title: StreamBuilder( - stream: appbarStream.stream, - initialData: false, - builder: (context, AsyncSnapshot snapshot) { - return AnimatedOpacity( - opacity: snapshot.data ? 1 : 0, - curve: Curves.easeOut, - duration: const Duration(milliseconds: 500), - child: Row( - children: [ - Row( - children: [ - Obx( - () => NetworkImgLayer( - width: 35, - height: 35, - type: 'avatar', - src: _memberController.face.value, - ), + body: Column( + children: [ + AppBar( + title: StreamBuilder( + stream: appbarStream.stream, + initialData: false, + builder: (context, AsyncSnapshot snapshot) { + return AnimatedOpacity( + opacity: snapshot.data ? 1 : 0, + curve: Curves.easeOut, + duration: const Duration(milliseconds: 500), + child: Row( + children: [ + Row( + children: [ + Obx( + () => NetworkImgLayer( + width: 35, + height: 35, + type: 'avatar', + src: _memberController.face.value, ), - const SizedBox(width: 10), - Obx( - () => Text( - _memberController.memberInfo.value.name ?? '', - style: TextStyle( - color: Theme.of(context) - .colorScheme - .onBackground, - fontSize: 14), - ), + ), + const SizedBox(width: 10), + Obx( + () => Text( + _memberController.memberInfo.value.name ?? '', + style: TextStyle( + color: Theme.of(context) + .colorScheme + .onBackground, + fontSize: 14), ), - ], - ) - ], - ), - ); - }, - ), - actions: [ - IconButton( - onPressed: () => Get.toNamed( - '/memberSearch?mid=${Get.parameters['mid']}&uname=${_memberController.memberInfo.value.name!}'), - icon: const Icon(Icons.search_outlined), - ), - PopupMenuButton( - icon: const Icon(Icons.more_vert), - itemBuilder: (BuildContext context) => [ - if (_memberController.ownerMid != - _memberController.mid) ...[ - PopupMenuItem( - onTap: () => _memberController.blockUser(), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - const Icon(Icons.block, size: 19), - const SizedBox(width: 10), - Text(_memberController.attribute.value != 128 - ? '加入黑名单' - : '移除黑名单'), - ], - ), + ), + ], ) ], + ), + ); + }, + ), + actions: [ + IconButton( + onPressed: () => Get.toNamed( + '/memberSearch?mid=${Get.parameters['mid']}&uname=${_memberController.memberInfo.value.name!}'), + icon: const Icon(Icons.search_outlined), + ), + PopupMenuButton( + icon: const Icon(Icons.more_vert), + itemBuilder: (BuildContext context) => [ + if (_memberController.ownerMid != _memberController.mid) ...[ PopupMenuItem( - onTap: () => _memberController.shareUser(), + onTap: () => _memberController.blockUser(), child: Row( mainAxisSize: MainAxisSize.min, children: [ - const Icon(Icons.share_outlined, size: 19), + const Icon(Icons.block, size: 19), const SizedBox(width: 10), - Text(_memberController.ownerMid != - _memberController.mid - ? '分享UP主' - : '分享我的主页'), + Text(_memberController.attribute.value != 128 + ? '加入黑名单' + : '移除黑名单'), ], ), - ), + ) ], + PopupMenuItem( + onTap: () => _memberController.shareUser(), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + const Icon(Icons.share_outlined, size: 19), + const SizedBox(width: 10), + Text(_memberController.ownerMid != _memberController.mid + ? '分享UP主' + : '分享我的主页'), + ], + ), + ), + ], + ), + const SizedBox(width: 4), + ], + ), + Expanded( + child: SingleChildScrollView( + controller: _extendNestCtr, + child: Padding( + padding: EdgeInsets.only( + bottom: MediaQuery.of(context).padding.bottom + 20, ), - const SizedBox(width: 4), - ], - flexibleSpace: FlexibleSpaceBar( - background: Stack( + child: Column( children: [ + profileWidget(), + + /// 动态链接 + ListTile( + onTap: _memberController.pushDynamicsPage, + title: const Text('Ta的动态'), + trailing: + const Icon(Icons.arrow_forward_outlined, size: 19), + ), + + /// 视频 + ListTile( + onTap: _memberController.pushArchivesPage, + title: const Text('Ta的投稿'), + trailing: + const Icon(Icons.arrow_forward_outlined, size: 19), + ), + + /// 专栏 + ListTile( + onTap: () {}, + title: const Text('Ta的专栏'), + ), + MediaQuery.removePadding( + removeTop: true, + removeBottom: true, + context: context, + child: Padding( + padding: const EdgeInsets.only( + left: StyleString.safeSpace, + right: StyleString.safeSpace, + ), + child: FutureBuilder( + future: _memberSeasonsFuture, + builder: (context, snapshot) { + if (snapshot.connectionState == + ConnectionState.done) { + if (snapshot.data == null) { + return const SizedBox(); + } + if (snapshot.data['status']) { + Map data = snapshot.data as Map; + if (data['data'].seasonsList.isEmpty) { + return commenWidget('用户没有设置专栏'); + } else { + return MemberSeasonsPanel(data: data['data']); + } + } else { + // 请求错误 + return const SizedBox(); + } + } else { + return const SizedBox(); + } + }, + ), + ), + ), + + /// 收藏 + + /// 追番 + /// 最近投币 Obx( - () => _memberController.face.value != '' - ? Positioned.fill( - bottom: 10, - child: Container( - decoration: BoxDecoration( - image: DecorationImage( - fit: BoxFit.fitWidth, - image: NetworkImage( - _memberController.face.value), - alignment: Alignment.topCenter, - isAntiAlias: true, - ), - ), - foregroundDecoration: BoxDecoration( - gradient: LinearGradient( - colors: [ - Theme.of(context) - .colorScheme - .background - .withOpacity(0.44), - Theme.of(context).colorScheme.background, - ], - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - stops: const [0.0, 0.46], - ), - ), - ), + () => _memberController.recentCoinsList.isNotEmpty + ? ListTile( + onTap: () {}, + title: const Text('最近投币的视频'), + // trailing: const Icon(Icons.arrow_forward_outlined, + // size: 19), ) : const SizedBox(), ), - Positioned( - left: 0, - right: 0, - bottom: 0, - height: 20, - child: Container( - color: Theme.of(context).colorScheme.background, + MediaQuery.removePadding( + removeTop: true, + removeBottom: true, + context: context, + child: Padding( + padding: const EdgeInsets.only( + left: StyleString.safeSpace, + right: StyleString.safeSpace, + ), + child: FutureBuilder( + future: _memberCoinsFuture, + builder: (context, snapshot) { + if (snapshot.connectionState == + ConnectionState.done) { + if (snapshot.data == null) { + return const SizedBox(); + } + if (snapshot.data['status']) { + Map data = snapshot.data as Map; + return MemberCoinsPanel(data: data['data']); + } else { + // 请求错误 + return const SizedBox(); + } + } else { + return const SizedBox(); + } + }, + ), ), ), - profileWidget(), + // 最近点赞 + // ListTile( + // onTap: () {}, + // title: const Text('最近点赞的视频'), + // trailing: + // const Icon(Icons.arrow_forward_outlined, size: 19), + // ), ], ), ), ), - ]; - }, - pinnedHeaderSliverHeightBuilder: () { - return MediaQuery.of(context).padding.top + kToolbarHeight; - }, - onlyOneScrollInBody: true, - body: Column( - children: [ - SizedBox( - width: double.infinity, - height: 50, - child: TabBar(controller: _tabController, tabs: const [ - Tab(text: '主页'), - Tab(text: '动态'), - Tab(text: '投稿'), - ]), - ), - Expanded( - child: TabBarView( - controller: _tabController, - children: [ - const Text('主页'), - MemberDynamicPanel(mid: mid), - ArchivePanel(mid: mid), - ], - )) - ], - ), + ), + ], ), ); } Widget profileWidget() { return Padding( - padding: const EdgeInsets.only(left: 18, right: 18), + padding: const EdgeInsets.only(left: 18, right: 18, bottom: 20), child: FutureBuilder( future: _futureBuilderFuture, builder: (context, snapshot) { @@ -250,7 +291,7 @@ class _MemberPageState extends State crossAxisAlignment: CrossAxisAlignment.start, children: [ profile(_memberController), - const SizedBox(height: 14), + const SizedBox(height: 20), Row( children: [ Flexible( @@ -260,7 +301,7 @@ class _MemberPageState extends State overflow: TextOverflow.ellipsis, style: Theme.of(context) .textTheme - .bodyLarge! + .titleMedium! .copyWith(fontWeight: FontWeight.bold), )), const SizedBox(width: 2), @@ -332,29 +373,11 @@ class _MemberPageState extends State softWrap: true, ), ], - const SizedBox(height: 4), + const SizedBox(height: 6), if (_memberController.memberInfo.value.sign != '') SelectableText( _memberController.memberInfo.value.sign!, - maxLines: _memberController - .memberInfo.value.official!['title'] != - '' - ? 1 - : 2, - style: const TextStyle( - overflow: TextOverflow.ellipsis), - onTap: () { - showDialog( - context: context, - builder: (context) { - return AlertDialog( - content: SelectableText(_memberController - .memberInfo.value.sign!), - ); - }, - ); - }, - ) + ), ], ), ], @@ -371,4 +394,22 @@ class _MemberPageState extends State ), ); } + + Widget commenWidget(msg) { + return Padding( + padding: const EdgeInsets.only( + top: 20, + bottom: 30, + ), + child: Center( + child: Text( + msg, + style: Theme.of(context) + .textTheme + .labelMedium! + .copyWith(color: Theme.of(context).colorScheme.outline), + ), + ), + ); + } } diff --git a/lib/pages/member/widgets/conis.dart b/lib/pages/member/widgets/conis.dart new file mode 100644 index 00000000..57a8a583 --- /dev/null +++ b/lib/pages/member/widgets/conis.dart @@ -0,0 +1,31 @@ +import 'package:flutter/material.dart'; +import 'package:pilipala/common/constants.dart'; +import 'package:pilipala/models/member/coin.dart'; +import 'package:pilipala/pages/member_coin/widgets/item.dart'; + +class MemberCoinsPanel extends StatelessWidget { + final List? data; + const MemberCoinsPanel({super.key, this.data}); + + @override + Widget build(BuildContext context) { + return LayoutBuilder( + builder: (context, boxConstraints) { + return GridView.builder( + gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, // Use a fixed count for GridView + crossAxisSpacing: StyleString.safeSpace, + mainAxisSpacing: StyleString.safeSpace, + childAspectRatio: 0.94, + ), + physics: const NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: data!.length, + itemBuilder: (context, i) { + return MemberCoinsItem(coinItem: data![i]); + }, + ); + }, + ); + } +} diff --git a/lib/pages/member/widgets/profile.dart b/lib/pages/member/widgets/profile.dart index 22e88106..a8791631 100644 --- a/lib/pages/member/widgets/profile.dart +++ b/lib/pages/member/widgets/profile.dart @@ -11,7 +11,7 @@ Widget profile(ctr, {loadingStatus = false}) { return Builder( builder: ((context) { return Padding( - padding: EdgeInsets.only(top: 3 * MediaQuery.of(context).padding.top), + padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top - 20), child: Row( children: [ Hero( @@ -78,7 +78,8 @@ Widget profile(ctr, {loadingStatus = false}) { mainAxisSize: MainAxisSize.min, children: [ Padding( - padding: const EdgeInsets.only(left: 10, right: 10), + padding: + const EdgeInsets.only(top: 10, left: 10, right: 10), child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceAround, diff --git a/lib/pages/member/widgets/seasons.dart b/lib/pages/member/widgets/seasons.dart new file mode 100644 index 00000000..68c4077f --- /dev/null +++ b/lib/pages/member/widgets/seasons.dart @@ -0,0 +1,85 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:pilipala/common/constants.dart'; +import 'package:pilipala/common/widgets/badge.dart'; +import 'package:pilipala/models/member/seasons.dart'; +import 'package:pilipala/pages/member_seasons/widgets/item.dart'; + +class MemberSeasonsPanel extends StatelessWidget { + final MemberSeasonsDataModel? data; + const MemberSeasonsPanel({super.key, this.data}); + + @override + Widget build(BuildContext context) { + return ListView.builder( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemCount: data!.seasonsList!.length, + itemBuilder: (context, index) { + MemberSeasonsList item = data!.seasonsList![index]; + return Padding( + padding: const EdgeInsets.only(bottom: 12, right: 4), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only(bottom: 12, left: 4), + child: Row( + children: [ + Text( + item.meta!.name!, + maxLines: 1, + style: Theme.of(context).textTheme.titleSmall!, + ), + const SizedBox(width: 10), + PBadge( + stack: 'relative', + size: 'small', + text: item.meta!.total.toString(), + ), + const Spacer(), + SizedBox( + width: 35, + height: 35, + child: IconButton( + onPressed: () => Get.toNamed( + '/memberSeasons?mid=${item.meta!.mid}&seasonId=${item.meta!.seasonId}'), + style: ButtonStyle( + padding: MaterialStateProperty.all(EdgeInsets.zero), + ), + icon: const Icon( + Icons.arrow_forward, + size: 20, + ), + ), + ) + ], + ), + ), + LayoutBuilder( + builder: (context, boxConstraints) { + return GridView.builder( + gridDelegate: + const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, // Use a fixed count for GridView + crossAxisSpacing: StyleString.safeSpace, + mainAxisSpacing: StyleString.safeSpace, + childAspectRatio: 0.94, + ), + physics: const NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: item.archives!.length, + itemBuilder: (context, i) { + return MemberSeasonsItem(seasonItem: item.archives![i]); + }, + ); + }, + ), + ], + ), + ); + }, + ); + } +} diff --git a/lib/pages/member/archive/controller.dart b/lib/pages/member_archive/controller.dart similarity index 54% rename from lib/pages/member/archive/controller.dart rename to lib/pages/member_archive/controller.dart index 3fc90328..785cd764 100644 --- a/lib/pages/member/archive/controller.dart +++ b/lib/pages/member_archive/controller.dart @@ -1,9 +1,11 @@ +import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:pilipala/http/member.dart'; +import 'package:pilipala/models/member/archive.dart'; -class ArchiveController extends GetxController { - ArchiveController(this.mid); - int? mid; +class MemberArchiveController extends GetxController { + final ScrollController scrollController = ScrollController(); + late int mid; int pn = 1; int count = 0; RxMap currentOrder = {}.obs; @@ -12,20 +14,27 @@ class ArchiveController extends GetxController { {'type': 'click', 'label': '最多播放'}, {'type': 'stow', 'label': '最多收藏'}, ]; + RxList archivesList = [].obs; @override void onInit() { super.onInit(); - mid ??= int.parse(Get.parameters['mid']!); - print('🐶🐶: $mid'); + mid = int.parse(Get.parameters['mid']!); currentOrder.value = orderList.first; } // 获取用户投稿 - Future getMemberArchive() async { + Future getMemberArchive(type) async { + if (type == 'onRefresh') { + pn = 1; + } var res = await MemberHttp.memberArchive( - mid: mid, pn: pn, order: currentOrder['type']!); + mid: mid, + pn: pn, + order: currentOrder['type']!, + ); if (res['status']) { + archivesList.addAll(res['data'].list.vlist); count = res['data'].page['count']; pn += 1; } @@ -34,11 +43,16 @@ class ArchiveController extends GetxController { toggleSort() async { pn = 1; - int index = orderList.indexOf(currentOrder.value); + int index = orderList.indexOf(currentOrder); if (index == orderList.length - 1) { currentOrder.value = orderList.first; } else { currentOrder.value = orderList[index + 1]; } } + + // 上拉加载 + Future onLoad() async { + getMemberArchive('onLoad'); + } } diff --git a/lib/pages/member_archive/index.dart b/lib/pages/member_archive/index.dart new file mode 100644 index 00000000..4c7551da --- /dev/null +++ b/lib/pages/member_archive/index.dart @@ -0,0 +1,4 @@ +library member_archive; + +export './controller.dart'; +export './view.dart'; diff --git a/lib/pages/member_archive/view.dart b/lib/pages/member_archive/view.dart new file mode 100644 index 00000000..21773f2d --- /dev/null +++ b/lib/pages/member_archive/view.dart @@ -0,0 +1,120 @@ +import 'package:easy_debounce/easy_throttle.dart'; +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:pilipala/common/widgets/video_card_h.dart'; +import 'controller.dart'; + +class MemberArchivePage extends StatefulWidget { + const MemberArchivePage({super.key}); + + @override + State createState() => _MemberArchivePageState(); +} + +class _MemberArchivePageState extends State { + final MemberArchiveController _memberArchivesController = + Get.put(MemberArchiveController()); + late Future _futureBuilderFuture; + late ScrollController scrollController; + + @override + void initState() { + super.initState(); + _futureBuilderFuture = + _memberArchivesController.getMemberArchive('onRefresh'); + scrollController = _memberArchivesController.scrollController; + scrollController.addListener( + () { + if (scrollController.position.pixels >= + scrollController.position.maxScrollExtent - 200) { + EasyThrottle.throttle( + 'member_archives', const Duration(milliseconds: 500), () { + _memberArchivesController.onLoad(); + }); + } + }, + ); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('他的投稿'), + // actions: [ + // Obx( + // () => PopupMenuButton( + // padding: EdgeInsets.zero, + // tooltip: '投稿排序', + // icon: Icon( + // Icons.more_vert_outlined, + // color: Theme.of(context).colorScheme.outline, + // ), + // position: PopupMenuPosition.under, + // onSelected: (String type) {}, + // itemBuilder: (BuildContext context) => >[ + // for (var i in _memberArchivesController.orderList) ...[ + // PopupMenuItem( + // onTap: () {}, + // value: _memberArchivesController.currentOrder['label'], + // child: Row( + // mainAxisSize: MainAxisSize.min, + // children: [ + // Text(i['label']!), + // if (_memberArchivesController.currentOrder['label'] == + // i['label']) ...[ + // const SizedBox(width: 10), + // const Icon(Icons.done, size: 20), + // ], + // ], + // ), + // ), + // ] + // ], + // ), + // ), + // ], + ), + body: CustomScrollView( + controller: _memberArchivesController.scrollController, + slivers: [ + FutureBuilder( + future: _futureBuilderFuture, + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.done) { + if (snapshot.data != null) { + Map data = snapshot.data as Map; + List list = _memberArchivesController.archivesList; + if (data['status']) { + return Obx( + () => list.isNotEmpty + ? SliverList( + delegate: SliverChildBuilderDelegate( + (context, index) { + return VideoCardH( + videoItem: list[index], + showOwner: false, + showPubdate: true, + ); + }, + childCount: list.length, + ), + ) + : const SliverToBoxAdapter(), + ); + } else { + return const SliverToBoxAdapter(); + } + } else { + return const SliverToBoxAdapter(); + } + } else { + return const SliverToBoxAdapter(); + } + }, + ), + ], + ), + ); + } +} diff --git a/lib/pages/member_coin/controller.dart b/lib/pages/member_coin/controller.dart new file mode 100644 index 00000000..dc3f5d8f --- /dev/null +++ b/lib/pages/member_coin/controller.dart @@ -0,0 +1,3 @@ +import 'package:get/get.dart'; + +class MemberCoinController extends GetxController {} diff --git a/lib/pages/member/dynamic/index.dart b/lib/pages/member_coin/index.dart similarity index 68% rename from lib/pages/member/dynamic/index.dart rename to lib/pages/member_coin/index.dart index de6f3f89..3009dd2b 100644 --- a/lib/pages/member/dynamic/index.dart +++ b/lib/pages/member_coin/index.dart @@ -1,4 +1,4 @@ -library dynamic_panel; +library member_coin; export './controller.dart'; export './view.dart'; diff --git a/lib/pages/member_coin/view.dart b/lib/pages/member_coin/view.dart new file mode 100644 index 00000000..f74880a5 --- /dev/null +++ b/lib/pages/member_coin/view.dart @@ -0,0 +1,15 @@ +import 'package:flutter/material.dart'; + +class MemberCoinPage extends StatefulWidget { + const MemberCoinPage({super.key}); + + @override + State createState() => _MemberCoinPageState(); +} + +class _MemberCoinPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold(); + } +} diff --git a/lib/pages/member_coin/widgets/item.dart b/lib/pages/member_coin/widgets/item.dart new file mode 100644 index 00000000..ea6e7ee1 --- /dev/null +++ b/lib/pages/member_coin/widgets/item.dart @@ -0,0 +1,95 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:pilipala/common/constants.dart'; +import 'package:pilipala/common/widgets/badge.dart'; +import 'package:pilipala/common/widgets/network_img_layer.dart'; +import 'package:pilipala/common/widgets/stat/view.dart'; +import 'package:pilipala/http/search.dart'; +import 'package:pilipala/models/member/coin.dart'; +import 'package:pilipala/utils/utils.dart'; + +class MemberCoinsItem extends StatelessWidget { + final MemberCoinsDataModel coinItem; + + const MemberCoinsItem({ + Key? key, + required this.coinItem, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + String heroTag = Utils.makeHeroTag(coinItem.aid); + return Card( + elevation: 0, + clipBehavior: Clip.hardEdge, + margin: EdgeInsets.zero, + child: InkWell( + onTap: () async { + int cid = + await SearchHttp.ab2c(aid: coinItem.aid, bvid: coinItem.bvid); + Get.toNamed('/video?bvid=${coinItem.bvid}&cid=$cid', + arguments: {'videoItem': coinItem, 'heroTag': heroTag}); + }, + child: Column( + children: [ + AspectRatio( + aspectRatio: StyleString.aspectRatio, + child: LayoutBuilder(builder: (context, boxConstraints) { + double maxWidth = boxConstraints.maxWidth; + double maxHeight = boxConstraints.maxHeight; + return Stack( + children: [ + NetworkImgLayer( + src: coinItem.pic, + width: maxWidth, + height: maxHeight, + ), + if (coinItem.duration != null) + PBadge( + bottom: 6, + right: 6, + type: 'gray', + text: Utils.timeFormat(coinItem.duration), + ) + ], + ); + }), + ), + Padding( + padding: const EdgeInsets.fromLTRB(5, 6, 0, 0), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + coinItem.title!, + maxLines: 2, + overflow: TextOverflow.ellipsis, + ), + const SizedBox(height: 4), + Row( + children: [ + StatView( + view: coinItem.view, + theme: 'gray', + ), + const Spacer(), + Text( + Utils.CustomStamp_str( + timestamp: coinItem.pubdate, date: 'MM-DD'), + style: TextStyle( + fontSize: 11, + color: Theme.of(context).colorScheme.outline, + ), + ), + const SizedBox(width: 6) + ], + ), + ], + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/member_dynamics/controller.dart b/lib/pages/member_dynamics/controller.dart new file mode 100644 index 00000000..b6cd1b74 --- /dev/null +++ b/lib/pages/member_dynamics/controller.dart @@ -0,0 +1,41 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:pilipala/http/member.dart'; +import 'package:pilipala/models/dynamics/result.dart'; + +class MemberDynamicsController extends GetxController { + final ScrollController scrollController = ScrollController(); + late int mid; + String offset = ''; + int count = 0; + bool hasMore = true; + RxList dynamicsList = [].obs; + + @override + void onInit() { + super.onInit(); + mid = int.parse(Get.parameters['mid']!); + } + + Future getMemberDynamic(type) async { + if (type == 'onRefresh') { + offset = ''; + dynamicsList.clear(); + } + var res = await MemberHttp.memberDynamic( + offset: offset, + mid: mid, + ); + if (res['status']) { + dynamicsList.addAll(res['data'].items); + offset = res['data'].offset; + hasMore = res['data'].hasMore; + } + return res; + } + + // 上拉加载 + Future onLoad() async { + getMemberDynamic('onLoad'); + } +} diff --git a/lib/pages/member_dynamics/index.dart b/lib/pages/member_dynamics/index.dart new file mode 100644 index 00000000..52951909 --- /dev/null +++ b/lib/pages/member_dynamics/index.dart @@ -0,0 +1,4 @@ +library member_dynamics; + +export './controller.dart'; +export './view.dart'; diff --git a/lib/pages/member_dynamics/view.dart b/lib/pages/member_dynamics/view.dart new file mode 100644 index 00000000..0682c5a6 --- /dev/null +++ b/lib/pages/member_dynamics/view.dart @@ -0,0 +1,86 @@ +import 'package:easy_debounce/easy_throttle.dart'; +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:pilipala/pages/member_dynamics/index.dart'; + +import '../dynamics/widgets/dynamic_panel.dart'; + +class MemberDynamicsPage extends StatefulWidget { + const MemberDynamicsPage({super.key}); + + @override + State createState() => _MemberDynamicsPageState(); +} + +class _MemberDynamicsPageState extends State { + final MemberDynamicsController _memberDynamicController = + Get.put(MemberDynamicsController()); + late Future _futureBuilderFuture; + late ScrollController scrollController; + + @override + void initState() { + super.initState(); + _futureBuilderFuture = + _memberDynamicController.getMemberDynamic('onRefresh'); + scrollController = _memberDynamicController.scrollController; + scrollController.addListener( + () { + if (scrollController.position.pixels >= + scrollController.position.maxScrollExtent - 200) { + EasyThrottle.throttle( + 'member_dynamics', const Duration(milliseconds: 500), () { + _memberDynamicController.onLoad(); + }); + } + }, + ); + } + + @override + void dispose() { + _memberDynamicController.scrollController.removeListener(() {}); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('他的动态'), + ), + body: CustomScrollView( + controller: _memberDynamicController.scrollController, + slivers: [ + FutureBuilder( + future: _futureBuilderFuture, + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.done) { + Map data = snapshot.data as Map; + List list = _memberDynamicController.dynamicsList; + if (data['status']) { + return Obx( + () => list.isNotEmpty + ? SliverList( + delegate: SliverChildBuilderDelegate( + (context, index) { + return DynamicPanel(item: list[index]); + }, + childCount: list.length, + ), + ) + : const SliverToBoxAdapter(), + ); + } else { + return const SliverToBoxAdapter(); + } + } else { + return const SliverToBoxAdapter(); + } + }, + ), + ], + ), + ); + } +} diff --git a/lib/pages/member_like/controller.dart b/lib/pages/member_like/controller.dart new file mode 100644 index 00000000..1d2e9c7c --- /dev/null +++ b/lib/pages/member_like/controller.dart @@ -0,0 +1,3 @@ +import 'package:get/get.dart'; + +class MemberLikeController extends GetxController {} diff --git a/lib/pages/member_like/index.dart b/lib/pages/member_like/index.dart new file mode 100644 index 00000000..e84771e3 --- /dev/null +++ b/lib/pages/member_like/index.dart @@ -0,0 +1,4 @@ +library member_like; + +export './controller.dart'; +export './view.dart'; diff --git a/lib/pages/member_like/view.dart b/lib/pages/member_like/view.dart new file mode 100644 index 00000000..ca33d569 --- /dev/null +++ b/lib/pages/member_like/view.dart @@ -0,0 +1,15 @@ +import 'package:flutter/material.dart'; + +class MemberLikePage extends StatefulWidget { + const MemberLikePage({super.key}); + + @override + State createState() => _MemberLikePageState(); +} + +class _MemberLikePageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold(); + } +} diff --git a/lib/pages/member_seasons/controller.dart b/lib/pages/member_seasons/controller.dart new file mode 100644 index 00000000..82ef0af0 --- /dev/null +++ b/lib/pages/member_seasons/controller.dart @@ -0,0 +1,47 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:pilipala/http/member.dart'; +import 'package:pilipala/models/member/seasons.dart'; + +class MemberSeasonsController extends GetxController { + final ScrollController scrollController = ScrollController(); + late int mid; + late int seasonId; + int pn = 1; + int ps = 30; + int count = 0; + RxList seasonsList = [].obs; + late Map page; + + @override + void onInit() { + super.onInit(); + mid = int.parse(Get.parameters['mid']!); + seasonId = int.parse(Get.parameters['seasonId']!); + } + + // 获取专栏详情 + Future getSeasonDetail(type) async { + if (type == 'onRefresh') { + pn = 1; + } + var res = await MemberHttp.getSeasonDetail( + mid: mid, + seasonId: seasonId, + pn: pn, + ps: ps, + sortReverse: false, + ); + if (res['status']) { + seasonsList.addAll(res['data'].archives); + page = res['data'].page; + pn += 1; + } + return res; + } + + // 上拉加载 + Future onLoad() async { + getSeasonDetail('onLoad'); + } +} diff --git a/lib/pages/member_seasons/index.dart b/lib/pages/member_seasons/index.dart new file mode 100644 index 00000000..4a4dc63d --- /dev/null +++ b/lib/pages/member_seasons/index.dart @@ -0,0 +1,4 @@ +library member_seasons; + +export 'controller.dart'; +export 'view.dart'; diff --git a/lib/pages/member_seasons/view.dart b/lib/pages/member_seasons/view.dart new file mode 100644 index 00000000..97a43358 --- /dev/null +++ b/lib/pages/member_seasons/view.dart @@ -0,0 +1,103 @@ +import 'package:easy_debounce/easy_throttle.dart'; +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:pilipala/common/constants.dart'; +import 'controller.dart'; +import 'widgets/item.dart'; + +class MemberSeasonsPage extends StatefulWidget { + const MemberSeasonsPage({super.key}); + + @override + State createState() => _MemberSeasonsPageState(); +} + +class _MemberSeasonsPageState extends State { + final MemberSeasonsController _memberSeasonsController = + Get.put(MemberSeasonsController()); + late Future _futureBuilderFuture; + late ScrollController scrollController; + + @override + void initState() { + super.initState(); + _futureBuilderFuture = + _memberSeasonsController.getSeasonDetail('onRefresh'); + scrollController = _memberSeasonsController.scrollController; + scrollController.addListener( + () { + if (scrollController.position.pixels >= + scrollController.position.maxScrollExtent - 200) { + EasyThrottle.throttle( + 'member_archives', const Duration(milliseconds: 500), () { + _memberSeasonsController.onLoad(); + }); + } + }, + ); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('他的专栏'), + ), + body: Padding( + padding: const EdgeInsets.only( + left: StyleString.safeSpace, + right: StyleString.safeSpace, + ), + child: SingleChildScrollView( + controller: _memberSeasonsController.scrollController, + child: FutureBuilder( + future: _futureBuilderFuture, + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.done) { + if (snapshot.data != null) { + Map data = snapshot.data as Map; + List list = _memberSeasonsController.seasonsList; + if (data['status']) { + return Obx( + () => list.isNotEmpty + ? LayoutBuilder( + builder: (context, boxConstraints) { + return GridView.builder( + gridDelegate: + const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + crossAxisSpacing: StyleString.safeSpace, + mainAxisSpacing: StyleString.safeSpace, + childAspectRatio: 0.94, + ), + physics: const NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: _memberSeasonsController + .seasonsList.length, + itemBuilder: (context, i) { + return MemberSeasonsItem( + seasonItem: _memberSeasonsController + .seasonsList[i], + ); + }, + ); + }, + ) + : const SizedBox(), + ); + } else { + return const SizedBox(); + } + } else { + return const SizedBox(); + } + } else { + return const SizedBox(); + } + }, + ), + ), + ), + ); + } +} diff --git a/lib/pages/member_seasons/widgets/item.dart b/lib/pages/member_seasons/widgets/item.dart new file mode 100644 index 00000000..157adb66 --- /dev/null +++ b/lib/pages/member_seasons/widgets/item.dart @@ -0,0 +1,98 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:pilipala/common/constants.dart'; +import 'package:pilipala/common/widgets/badge.dart'; +import 'package:pilipala/common/widgets/network_img_layer.dart'; +import 'package:pilipala/common/widgets/stat/view.dart'; +import 'package:pilipala/http/search.dart'; +import 'package:pilipala/utils/utils.dart'; + +class MemberSeasonsItem extends StatelessWidget { + final dynamic seasonItem; + + const MemberSeasonsItem({ + Key? key, + required this.seasonItem, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + String heroTag = Utils.makeHeroTag(seasonItem.aid); + return Card( + elevation: 0, + clipBehavior: Clip.hardEdge, + margin: EdgeInsets.zero, + child: InkWell( + onTap: () async { + int cid = + await SearchHttp.ab2c(aid: seasonItem.aid, bvid: seasonItem.bvid); + Get.toNamed('/video?bvid=${seasonItem.bvid}&cid=$cid', + arguments: {'videoItem': seasonItem, 'heroTag': heroTag}); + }, + child: Column( + children: [ + AspectRatio( + aspectRatio: StyleString.aspectRatio, + child: LayoutBuilder(builder: (context, boxConstraints) { + double maxWidth = boxConstraints.maxWidth; + double maxHeight = boxConstraints.maxHeight; + return Stack( + children: [ + Hero( + tag: heroTag, + child: NetworkImgLayer( + src: seasonItem.pic, + width: maxWidth, + height: maxHeight, + ), + ), + if (seasonItem.duration != null) + PBadge( + bottom: 6, + right: 6, + type: 'gray', + text: Utils.timeFormat(seasonItem.duration), + ) + ], + ); + }), + ), + Padding( + padding: const EdgeInsets.fromLTRB(5, 6, 0, 0), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + seasonItem.title, + maxLines: 2, + overflow: TextOverflow.ellipsis, + ), + const SizedBox(height: 4), + Row( + children: [ + StatView( + view: seasonItem.view, + theme: 'gray', + ), + const Spacer(), + Text( + Utils.CustomStamp_str( + timestamp: seasonItem.pubdate, date: 'MM-DD'), + style: TextStyle( + fontSize: 11, + color: Theme.of(context).colorScheme.outline, + ), + ), + const SizedBox(width: 6) + ], + ), + ], + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/video/detail/introduction/controller.dart b/lib/pages/video/detail/introduction/controller.dart index 4590ec44..16cacdbf 100644 --- a/lib/pages/video/detail/introduction/controller.dart +++ b/lib/pages/video/detail/introduction/controller.dart @@ -76,6 +76,7 @@ class VideoIntroController extends GetxController { if (Get.arguments.containsKey('videoItem')) { preRender = true; var args = Get.arguments['videoItem']; + var keys = Get.arguments.keys.toList(); videoItem!['pic'] = args.pic; if (args.title is String) { videoItem!['title'] = args.title; @@ -86,11 +87,9 @@ class VideoIntroController extends GetxController { } videoItem!['title'] = str; } - if (args.stat != null) { - videoItem!['stat'] = args.stat; - } - videoItem!['pubdate'] = args.pubdate; - videoItem!['owner'] = args.owner; + videoItem!['stat'] = keys.contains('stat') && args.stat; + videoItem!['pubdate'] = keys.contains('pubdate') && args.pubdate; + videoItem!['owner'] = keys.contains('owner') && args.owner; } } userLogin = userInfo != null; diff --git a/lib/pages/video/detail/introduction/view.dart b/lib/pages/video/detail/introduction/view.dart index eb954510..2a9b774d 100644 --- a/lib/pages/video/detail/introduction/view.dart +++ b/lib/pages/video/detail/introduction/view.dart @@ -247,7 +247,7 @@ class _VideoInfoState extends State with TickerProviderStateMixin { padding: const EdgeInsets.only( left: StyleString.safeSpace, right: StyleString.safeSpace, top: 10), sliver: SliverToBoxAdapter( - child: !loadingStatus || videoItem.isNotEmpty + child: !loadingStatus ? Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -277,7 +277,7 @@ class _VideoInfoState extends State with TickerProviderStateMixin { children: [ StatView( theme: 'gray', - view: !widget.loadingStatus + view: !loadingStatus ? widget.videoDetail!.stat!.view : videoItem['stat'].view, size: 'medium', @@ -285,7 +285,7 @@ class _VideoInfoState extends State with TickerProviderStateMixin { const SizedBox(width: 10), StatDanMu( theme: 'gray', - danmu: !widget.loadingStatus + danmu: !loadingStatus ? widget.videoDetail!.stat!.danmaku : videoItem['stat'].danmaku, size: 'medium', @@ -293,7 +293,7 @@ class _VideoInfoState extends State with TickerProviderStateMixin { const SizedBox(width: 10), Text( Utils.dateFormat( - !widget.loadingStatus + !loadingStatus ? widget.videoDetail!.pubdate : videoItem['pubdate'], formatType: 'detail'), diff --git a/lib/router/app_pages.dart b/lib/router/app_pages.dart index 6accf4f1..cec93c26 100644 --- a/lib/router/app_pages.dart +++ b/lib/router/app_pages.dart @@ -21,7 +21,12 @@ import 'package:pilipala/pages/later/index.dart'; import 'package:pilipala/pages/liveRoom/view.dart'; import 'package:pilipala/pages/login/index.dart'; import 'package:pilipala/pages/member/index.dart'; +import 'package:pilipala/pages/member_archive/index.dart'; +import 'package:pilipala/pages/member_coin/index.dart'; +import 'package:pilipala/pages/member_dynamics/index.dart'; +import 'package:pilipala/pages/member_like/index.dart'; import 'package:pilipala/pages/member_search/index.dart'; +import 'package:pilipala/pages/member_seasons/index.dart'; import 'package:pilipala/pages/preview/index.dart'; import 'package:pilipala/pages/search/index.dart'; import 'package:pilipala/pages/searchResult/index.dart'; @@ -125,6 +130,19 @@ class Routes { CustomGetPage(name: '/favSearch', page: () => const FavSearchPage()), // 登录页面 CustomGetPage(name: '/loginPage', page: () => const LoginPage()), + // 用户动态 + CustomGetPage( + name: '/memberDynamics', page: () => const MemberDynamicsPage()), + // 用户投稿 + CustomGetPage( + name: '/memberArchive', page: () => const MemberArchivePage()), + // 用户最近投币 + CustomGetPage(name: '/memberCoin', page: () => const MemberCoinPage()), + // 用户最近喜欢 + CustomGetPage(name: '/memberLike', page: () => const MemberLikePage()), + // 用户专栏 + CustomGetPage( + name: '/memberSeasons', page: () => const MemberSeasonsPage()), ]; } diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index 8982c178..19979df6 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -146,7 +146,7 @@ class Utils { int.parse(MM) == DateTime.now().month) { // 当天 if (int.parse(DD) == DateTime.now().day) { - return date.split(' ')[1]; + return '今天'; } } return date; From ebb1d78dbb383a2b2c5a83116184fed0f85705d5 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Fri, 1 Dec 2023 21:21:09 +0800 Subject: [PATCH 15/30] =?UTF-8?q?fix:=20accessKey=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common/constants.dart | 6 +- lib/http/api.dart | 12 ++++ lib/http/member.dart | 92 +++++++++++++++++++++++++- lib/pages/setting/privacy_setting.dart | 11 +++ lib/utils/utils.dart | 16 +++++ 5 files changed, 134 insertions(+), 3 deletions(-) diff --git a/lib/common/constants.dart b/lib/common/constants.dart index 08a54805..cac13688 100644 --- a/lib/common/constants.dart +++ b/lib/common/constants.dart @@ -9,7 +9,11 @@ class StyleString { } class Constants { - static const String appKey = '27eb53fc9058f8c3'; + // 27eb53fc9058f8c3 移动端 Android + // 4409e2ce8ffd12b8 TV端 + static const String appKey = '4409e2ce8ffd12b8'; + // 59b43e04ad6965f34319062b478f83dd TV端 + static const String appSec = '59b43e04ad6965f34319062b478f83dd'; static const String thirdSign = '04224646d1fea004e79606d3b038c84a'; static const String thirdApi = 'https://www.mcbbs.net/template/mcbbs/image/special_photo_bg.png'; diff --git a/lib/http/api.dart b/lib/http/api.dart index af7d8b9e..0125c742 100644 --- a/lib/http/api.dart +++ b/lib/http/api.dart @@ -373,6 +373,18 @@ class Api { static const getWebKey = 'https://passport.bilibili.com/x/passport-login/web/key'; + /// cookie转access_key + static const cookieToKey = + 'https://passport.bilibili.com/x/passport-tv-login/h5/qrcode/confirm'; + + /// 申请二维码(TV端) + static const getTVCode = + 'https://passport.snm0516.aisee.tv/x/passport-tv-login/qrcode/auth_code'; + + ///扫码登录(TV端) + static const qrcodePoll = + 'https://passport.bilibili.com/x/passport-tv-login/qrcode/poll'; + /// 置顶视频 static const getTopVideoApi = '/x/space/top/arc'; diff --git a/lib/http/member.dart b/lib/http/member.dart index 9dc6da85..a2af8d82 100644 --- a/lib/http/member.dart +++ b/lib/http/member.dart @@ -1,5 +1,6 @@ -import 'dart:ffi'; - +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:hive/hive.dart'; +import 'package:pilipala/common/constants.dart'; import 'package:pilipala/http/index.dart'; import 'package:pilipala/models/dynamics/result.dart'; import 'package:pilipala/models/follow/result.dart'; @@ -8,6 +9,8 @@ import 'package:pilipala/models/member/coin.dart'; import 'package:pilipala/models/member/info.dart'; import 'package:pilipala/models/member/seasons.dart'; import 'package:pilipala/models/member/tags.dart'; +import 'package:pilipala/utils/storage.dart'; +import 'package:pilipala/utils/utils.dart'; import 'package:pilipala/utils/wbi_sign.dart'; class MemberHttp { @@ -359,4 +362,89 @@ class MemberHttp { }; } } + + // 获取TV authCode + static Future getTVCode() async { + SmartDialog.showLoading(); + var params = { + 'appkey': Constants.appKey, + 'local_id': '0', + 'ts': (DateTime.now().millisecondsSinceEpoch ~/ 1000).toString(), + }; + String sign = Utils.appSign( + params, + Constants.appKey, + Constants.appSec, + ); + var res = await Request() + .post(Api.getTVCode, queryParameters: {...params, 'sign': sign}); + if (res.data['code'] == 0) { + return { + 'status': true, + 'data': res.data['data']['auth_code'], + 'msg': '操作成功' + }; + } else { + return { + 'status': false, + 'data': [], + 'msg': res.data['message'], + }; + } + } + + // 获取access_key + static Future cookieToKey() async { + var authCodeRes = await getTVCode(); + if (authCodeRes['status']) { + var res = await Request().post(Api.cookieToKey, queryParameters: { + 'auth_code': authCodeRes['data'], + 'build': 708200, + 'csrf': await Request.getCsrf(), + }); + await Future.delayed(const Duration(milliseconds: 300)); + qrcodePoll(authCodeRes['data']); + if (res.data['code'] == 0) { + return {'status': true, 'data': [], 'msg': '操作成功'}; + } else { + return { + 'status': false, + 'data': [], + 'msg': res.data['message'], + }; + } + } + } + + static Future qrcodePoll(authCode) async { + var params = { + 'appkey': Constants.appKey, + 'auth_code': authCode.toString(), + 'local_id': '0', + 'ts': (DateTime.now().millisecondsSinceEpoch ~/ 1000).toString(), + }; + String sign = Utils.appSign( + params, + Constants.appKey, + Constants.appSec, + ); + var res = await Request() + .post(Api.qrcodePoll, queryParameters: {...params, 'sign': sign}); + SmartDialog.dismiss(); + if (res.data['code'] == 0) { + String accessKey = res.data['data']['access_token']; + Box localCache = GStrorage.localCache; + Box userInfoCache = GStrorage.userInfo; + var userInfo = userInfoCache.get('userInfoCache'); + localCache.put( + LocalCacheKey.accessKey, {'mid': userInfo.mid, 'value': accessKey}); + return {'status': true, 'data': [], 'msg': '操作成功'}; + } else { + return { + 'status': false, + 'data': [], + 'msg': res.data['message'], + }; + } + } } diff --git a/lib/pages/setting/privacy_setting.dart b/lib/pages/setting/privacy_setting.dart index a6d085ab..07a02318 100644 --- a/lib/pages/setting/privacy_setting.dart +++ b/lib/pages/setting/privacy_setting.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:get/get.dart'; import 'package:hive/hive.dart'; +import 'package:pilipala/http/member.dart'; import 'package:pilipala/utils/storage.dart'; class PrivacySetting extends StatefulWidget { @@ -53,6 +54,16 @@ class _PrivacySettingState extends State { title: Text('黑名单管理', style: titleStyle), subtitle: Text('已拉黑用户', style: subTitleStyle), ), + ListTile( + onTap: () { + if (!userLogin) { + SmartDialog.showToast('请先登录'); + } + MemberHttp.cookieToKey(); + }, + dense: false, + title: Text('刷新access_key', style: titleStyle), + ), ], ), ); diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index 19979df6..25488d59 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -2,8 +2,10 @@ // ignore_for_file: non_constant_identifier_names import 'dart:async'; +import 'dart:convert'; import 'dart:io'; import 'dart:math'; +import 'package:crypto/crypto.dart'; import 'package:device_info_plus/device_info_plus.dart'; import 'package:flutter/material.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; @@ -297,4 +299,18 @@ class Utils { return '$formattedHours:$formattedMinutes'; } + + static String appSign( + Map params, String appkey, String appsec) { + params['appkey'] = appkey; + var searchParams = Uri(queryParameters: params).query; + var sortedParams = searchParams.split('&')..sort(); + var sortedQueryString = sortedParams.join('&'); + + var appsecString = sortedQueryString + appsec; + var md5Digest = md5.convert(utf8.encode(appsecString)); + var md5String = md5Digest.toString(); // 获取MD5哈希值 + + return md5String; + } } From 00f84e1a1c41cd9b484fbc0951588fe46907a9b8 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sat, 2 Dec 2023 21:33:46 +0800 Subject: [PATCH 16/30] =?UTF-8?q?mod:=20=E4=BE=9D=E8=B5=96=E5=8D=87?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Podfile.lock | 18 +++++ ios/Runner.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- lib/pages/history_search/view.dart | 1 - lib/pages/main/view.dart | 4 +- lib/pages/preview/view.dart | 1 - pubspec.lock | 68 +++++++++++-------- pubspec.yaml | 6 +- 8 files changed, 63 insertions(+), 39 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 9d796293..7a7e5357 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1,6 +1,12 @@ PODS: - appscheme (1.0.4): - Flutter + - audio_service (0.0.1): + - Flutter + - audio_session (0.0.1): + - Flutter + - auto_orientation (0.0.1): + - Flutter - connectivity_plus (0.0.1): - Flutter - ReachabilitySwift @@ -56,6 +62,9 @@ PODS: DEPENDENCIES: - appscheme (from `.symlinks/plugins/appscheme/ios`) + - audio_service (from `.symlinks/plugins/audio_service/ios`) + - audio_session (from `.symlinks/plugins/audio_session/ios`) + - auto_orientation (from `.symlinks/plugins/auto_orientation/ios`) - connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`) - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) - Flutter (from `Flutter`) @@ -88,6 +97,12 @@ SPEC REPOS: EXTERNAL SOURCES: appscheme: :path: ".symlinks/plugins/appscheme/ios" + audio_service: + :path: ".symlinks/plugins/audio_service/ios" + audio_session: + :path: ".symlinks/plugins/audio_session/ios" + auto_orientation: + :path: ".symlinks/plugins/auto_orientation/ios" connectivity_plus: :path: ".symlinks/plugins/connectivity_plus/ios" device_info_plus: @@ -135,6 +150,9 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: appscheme: b1c3f8862331cb20430cf9e0e4af85dbc1572ad8 + audio_service: f509d65da41b9521a61f1c404dd58651f265a567 + audio_session: 4f3e461722055d21515cf3261b64c973c062f345 + auto_orientation: 102ed811a5938d52c86520ddd7ecd3a126b5d39d connectivity_plus: 07c49e96d7fc92bc9920617b83238c4d178b446a device_info_plus: 7545d84d8d1b896cb16a4ff98c19f07ec4b298ea Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index eeb03bef..c0883366 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -157,7 +157,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index c87d15a3..a6b826db 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ { onChoose: null, onUpdateMultiple: () => null, ); - ; } }, ) diff --git a/lib/pages/main/view.dart b/lib/pages/main/view.dart index ee8d3829..33b46ad9 100644 --- a/lib/pages/main/view.dart +++ b/lib/pages/main/view.dart @@ -113,8 +113,8 @@ class _MainAppState extends State with SingleTickerProviderStateMixin { MediaQuery.of(context).size.width * 9 / 16; localCache.put('sheetHeight', sheetHeight); localCache.put('statusBarHeight', statusBarHeight); - return WillPopScope( - onWillPop: () => _mainController.onBackPressed(context), + return PopScope( + onPopInvoked: (bool status) => _mainController.onBackPressed(context), child: Scaffold( extendBody: true, body: FadeTransition( diff --git a/lib/pages/preview/view.dart b/lib/pages/preview/view.dart index 22cc8952..1c37c833 100644 --- a/lib/pages/preview/view.dart +++ b/lib/pages/preview/view.dart @@ -159,7 +159,6 @@ class _ImagePreviewState extends State _previewController.onChange(index), canScrollPage: (GestureDetails? gestureDetails) => gestureDetails!.totalScale! <= 1.0, - preloadPagesCount: 2, itemCount: widget.imgList!.length, itemBuilder: (BuildContext context, int index) { return ExtendedImage.network( diff --git a/pubspec.lock b/pubspec.lock index 3b97dbe7..763d23c7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -253,10 +253,10 @@ packages: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.18.0" connectivity_plus: dependency: "direct main" description: @@ -421,18 +421,18 @@ packages: dependency: "direct main" description: name: extended_image - sha256: e77d18f956649ba6e5ecebd0cb68542120886336a75ee673788145bd4c3f0767 + sha256: d7f091d068fcac7246c4b22a84b8dac59a62e04d29a5c172710c696e67a22f94 url: "https://pub.dev" source: hosted - version: "8.0.2" + version: "8.2.0" extended_image_library: dependency: transitive description: name: extended_image_library - sha256: bb8d08c504ebc73d476ec1c99451a61f12e95538869e734fc4f55a3a2d5c98ec + sha256: "9b55fc5ebc65fad984de66b8f177a1bef2a84d79203c9c213f75ff83c2c29edd" url: "https://pub.dev" source: hosted - version: "3.5.3" + version: "4.0.1" extended_list: dependency: transitive description: @@ -551,10 +551,10 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - sha256: "950e77c2bbe1692bc0874fc7fb491b96a4dc340457f4ea1641443d0a6c1ea360" + sha256: b068ffc46f82a55844acfa4fdbb61fad72fa2aef0905548419d97f0f95c456da url: "https://pub.dev" source: hosted - version: "2.0.15" + version: "2.0.17" flutter_smart_dialog: dependency: "direct main" description: @@ -580,10 +580,10 @@ packages: dependency: "direct main" description: name: flutter_volume_controller - sha256: "1161957826183b46916adb4f1c9f91befce0d8415bd3fcd781f7faed9df62d46" + sha256: "0f10cc759499cb6c3e152a8f6ff8e5ce385b99db7e1f586d1a29d8e6c11f4082" url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.3.1" flutter_web_plugins: dependency: transitive description: flutter @@ -721,10 +721,10 @@ packages: dependency: transitive description: name: intl - sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6 + sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" url: "https://pub.dev" source: hosted - version: "0.18.0" + version: "0.18.1" io: dependency: transitive description: @@ -793,18 +793,18 @@ packages: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" media_kit: dependency: "direct main" description: @@ -881,10 +881,10 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" mime: dependency: transitive description: @@ -1138,10 +1138,10 @@ packages: dependency: "direct main" description: name: saver_gallery - sha256: "3131bba4257f69901437c0f1ebd692201ca5f34512d42667513a3802f1c171d1" + sha256: "2657953427ebe5a3b2d08157d41587c01923ccce3f1a616d55082be7470f8530" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.1" screen_brightness: dependency: "direct main" description: @@ -1247,10 +1247,10 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" sqflite: dependency: transitive description: @@ -1271,10 +1271,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" status_bar_control: dependency: "direct main" description: @@ -1287,10 +1287,10 @@ packages: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" stream_transform: dependency: transitive description: @@ -1335,10 +1335,10 @@ packages: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.6.1" timing: dependency: transitive description: @@ -1531,6 +1531,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.2" + web: + dependency: transitive + description: + name: web + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + url: "https://pub.dev" + source: hosted + version: "0.3.0" web_socket_channel: dependency: transitive description: @@ -1620,5 +1628,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + dart: ">=3.2.0-194.0.dev <4.0.0" + flutter: ">=3.16.0" diff --git a/pubspec.yaml b/pubspec.yaml index f600573b..c294a325 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -49,8 +49,8 @@ dependencies: # 图片 cached_network_image: ^3.3.0 - extended_image: ^8.0.2 - saver_gallery: ^2.0.1 + extended_image: ^8.2.0 + saver_gallery: ^3.0.1 # 存储 path_provider: ^2.1.1 @@ -94,7 +94,7 @@ dependencies: audio_session: ^0.1.16 # 音量、亮度、屏幕控制 - flutter_volume_controller: ^1.3.0 + flutter_volume_controller: ^1.3.1 screen_brightness: ^0.2.2+1 wakelock_plus: ^1.1.1 universal_platform: ^1.0.0+1 From 7f7e1b2035f6590ab64feeb5e420759747c5ecef Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sat, 2 Dec 2023 21:35:55 +0800 Subject: [PATCH 17/30] mod --- pubspec.lock | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 3b97dbe7..a273b7ef 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -253,10 +253,10 @@ packages: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.18.0" connectivity_plus: dependency: "direct main" description: @@ -721,10 +721,10 @@ packages: dependency: transitive description: name: intl - sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6 + sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" url: "https://pub.dev" source: hosted - version: "0.18.0" + version: "0.18.1" io: dependency: transitive description: @@ -793,18 +793,18 @@ packages: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" media_kit: dependency: "direct main" description: @@ -881,10 +881,10 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" mime: dependency: transitive description: @@ -1247,10 +1247,10 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" sqflite: dependency: transitive description: @@ -1271,10 +1271,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" status_bar_control: dependency: "direct main" description: @@ -1287,10 +1287,10 @@ packages: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" stream_transform: dependency: transitive description: @@ -1335,10 +1335,10 @@ packages: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.6.1" timing: dependency: transitive description: @@ -1531,6 +1531,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.2" + web: + dependency: transitive + description: + name: web + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + url: "https://pub.dev" + source: hosted + version: "0.3.0" web_socket_channel: dependency: transitive description: @@ -1620,5 +1628,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.0.0 <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" flutter: ">=3.10.0" From 6ebfe5872e4631b7f764c02d089f2c86362848a0 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sat, 2 Dec 2023 22:41:24 +0800 Subject: [PATCH 18/30] =?UTF-8?q?feat:=20=E9=A6=96=E9=A1=B5=E9=A1=B6?= =?UTF-8?q?=E6=A0=8F&=E5=BA=95=E6=A0=8F=E5=9B=BA=E5=AE=9A=20issues=20#243?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/bangumi/view.dart | 5 +++++ lib/pages/home/controller.dart | 8 ++++++++ lib/pages/home/view.dart | 16 +++++++++++++--- lib/pages/hot/view.dart | 5 +++++ lib/pages/live/view.dart | 5 +++++ lib/pages/main/controller.dart | 2 ++ lib/pages/main/view.dart | 6 +++++- lib/pages/rcmd/view.dart | 5 +++++ lib/pages/setting/style_setting.dart | 21 ++++++++++++++------- lib/pages/setting/widgets/switch_item.dart | 6 ++++++ lib/utils/storage.dart | 2 ++ 11 files changed, 70 insertions(+), 11 deletions(-) diff --git a/lib/pages/bangumi/view.dart b/lib/pages/bangumi/view.dart index e48715eb..a2e8ae0f 100644 --- a/lib/pages/bangumi/view.dart +++ b/lib/pages/bangumi/view.dart @@ -6,6 +6,7 @@ import 'package:flutter/rendering.dart'; import 'package:get/get.dart'; import 'package:pilipala/common/constants.dart'; import 'package:pilipala/common/widgets/http_error.dart'; +import 'package:pilipala/pages/home/index.dart'; import 'package:pilipala/pages/main/index.dart'; import 'package:pilipala/pages/rcmd/view.dart'; @@ -35,6 +36,8 @@ class _BangumiPageState extends State scrollController = _bangumidController.scrollController; StreamController mainStream = Get.find().bottomBarStream; + StreamController searchBarStream = + Get.find().searchBarStream; _futureBuilderFuture = _bangumidController.queryBangumiListFeed(); _futureBuilderFutureFollow = _bangumidController.queryBangumiFollow(); scrollController.addListener( @@ -51,8 +54,10 @@ class _BangumiPageState extends State scrollController.position.userScrollDirection; if (direction == ScrollDirection.forward) { mainStream.add(true); + searchBarStream.add(true); } else if (direction == ScrollDirection.reverse) { mainStream.add(false); + searchBarStream.add(false); } }, ); diff --git a/lib/pages/home/controller.dart b/lib/pages/home/controller.dart index 4239096c..5b722527 100644 --- a/lib/pages/home/controller.dart +++ b/lib/pages/home/controller.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:hive/hive.dart'; @@ -15,6 +17,10 @@ class HomeController extends GetxController with GetTickerProviderStateMixin { RxBool userLogin = false.obs; RxString userFace = ''.obs; var userInfo; + Box setting = GStrorage.setting; + late final StreamController searchBarStream = + StreamController.broadcast(); + late bool hideSearchBar; @override void onInit() { @@ -33,6 +39,8 @@ class HomeController extends GetxController with GetTickerProviderStateMixin { length: tabs.length, vsync: this, ); + hideSearchBar = + setting.get(SettingBoxKey.hideSearchBar, defaultValue: true); } void onRefresh() { diff --git a/lib/pages/home/view.dart b/lib/pages/home/view.dart index 3cdf81c7..fa5a1cc9 100644 --- a/lib/pages/home/view.dart +++ b/lib/pages/home/view.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:pilipala/common/widgets/network_img_layer.dart'; @@ -18,11 +20,17 @@ class _HomePageState extends State with AutomaticKeepAliveClientMixin, TickerProviderStateMixin { final HomeController _homeController = Get.put(HomeController()); List videoList = []; - Stream stream = Get.find().bottomBarStream.stream; + late Stream stream; @override bool get wantKeepAlive => true; + @override + void initState() { + super.initState(); + stream = _homeController.searchBarStream.stream; + } + showUserBottonSheet() { feedBack(); showModalBottomSheet( @@ -46,7 +54,9 @@ class _HomePageState extends State body: Column( children: [ CustomAppBar( - stream: stream, + stream: _homeController.hideSearchBar + ? stream + : StreamController.broadcast().stream, ctr: _homeController, callback: showUserBottonSheet, ), @@ -118,7 +128,7 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget { duration: const Duration(milliseconds: 500), height: snapshot.data ? MediaQuery.of(context).padding.top + 52 - : MediaQuery.of(context).padding.top, + : MediaQuery.of(context).padding.top - 10, child: Container( padding: EdgeInsets.only( left: 20, diff --git a/lib/pages/hot/view.dart b/lib/pages/hot/view.dart index 16ee4348..4b098063 100644 --- a/lib/pages/hot/view.dart +++ b/lib/pages/hot/view.dart @@ -9,6 +9,7 @@ import 'package:pilipala/common/widgets/overlay_pop.dart'; import 'package:pilipala/common/skeleton/video_card_h.dart'; import 'package:pilipala/common/widgets/http_error.dart'; import 'package:pilipala/common/widgets/video_card_h.dart'; +import 'package:pilipala/pages/home/index.dart'; import 'package:pilipala/pages/hot/controller.dart'; import 'package:pilipala/pages/main/index.dart'; @@ -35,6 +36,8 @@ class _HotPageState extends State with AutomaticKeepAliveClientMixin { scrollController = _hotController.scrollController; StreamController mainStream = Get.find().bottomBarStream; + StreamController searchBarStream = + Get.find().searchBarStream; scrollController.addListener( () { if (scrollController.position.pixels >= @@ -49,8 +52,10 @@ class _HotPageState extends State with AutomaticKeepAliveClientMixin { scrollController.position.userScrollDirection; if (direction == ScrollDirection.forward) { mainStream.add(true); + searchBarStream.add(true); } else if (direction == ScrollDirection.reverse) { mainStream.add(false); + searchBarStream.add(false); } }, ); diff --git a/lib/pages/live/view.dart b/lib/pages/live/view.dart index 1fbff63c..c224dddf 100644 --- a/lib/pages/live/view.dart +++ b/lib/pages/live/view.dart @@ -9,6 +9,7 @@ import 'package:pilipala/common/skeleton/video_card_v.dart'; import 'package:pilipala/common/widgets/animated_dialog.dart'; import 'package:pilipala/common/widgets/http_error.dart'; import 'package:pilipala/common/widgets/overlay_pop.dart'; +import 'package:pilipala/pages/home/index.dart'; import 'package:pilipala/pages/main/index.dart'; import 'package:pilipala/pages/rcmd/index.dart'; @@ -38,6 +39,8 @@ class _LivePageState extends State scrollController = _liveController.scrollController; StreamController mainStream = Get.find().bottomBarStream; + StreamController searchBarStream = + Get.find().searchBarStream; scrollController.addListener( () { if (scrollController.position.pixels >= @@ -52,8 +55,10 @@ class _LivePageState extends State scrollController.position.userScrollDirection; if (direction == ScrollDirection.forward) { mainStream.add(true); + searchBarStream.add(true); } else if (direction == ScrollDirection.reverse) { mainStream.add(false); + searchBarStream.add(false); } }, ); diff --git a/lib/pages/main/controller.dart b/lib/pages/main/controller.dart index 1d296105..a322c5f3 100644 --- a/lib/pages/main/controller.dart +++ b/lib/pages/main/controller.dart @@ -55,6 +55,7 @@ class MainController extends GetxController { StreamController.broadcast(); Box setting = GStrorage.setting; DateTime? _lastPressedAt; + late bool hideTabBar; @override void onInit() { @@ -62,6 +63,7 @@ class MainController extends GetxController { if (setting.get(SettingBoxKey.autoUpdate, defaultValue: false)) { Utils.checkUpdata(); } + hideTabBar = setting.get(SettingBoxKey.hideTabBar, defaultValue: true); } Future onBackPressed(BuildContext context) { diff --git a/lib/pages/main/view.dart b/lib/pages/main/view.dart index 33b46ad9..fef5620d 100644 --- a/lib/pages/main/view.dart +++ b/lib/pages/main/view.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:hive/hive.dart'; @@ -142,7 +144,9 @@ class _MainAppState extends State with SingleTickerProviderStateMixin { ), ), bottomNavigationBar: StreamBuilder( - stream: _mainController.bottomBarStream.stream, + stream: _mainController.hideTabBar + ? _mainController.bottomBarStream.stream + : StreamController.broadcast().stream, initialData: true, builder: (context, AsyncSnapshot snapshot) { return AnimatedSlide( diff --git a/lib/pages/rcmd/view.dart b/lib/pages/rcmd/view.dart index 51771d3c..a0f867f7 100644 --- a/lib/pages/rcmd/view.dart +++ b/lib/pages/rcmd/view.dart @@ -11,6 +11,7 @@ import 'package:pilipala/common/widgets/animated_dialog.dart'; import 'package:pilipala/common/widgets/http_error.dart'; import 'package:pilipala/common/widgets/overlay_pop.dart'; import 'package:pilipala/common/widgets/video_card_v.dart'; +import 'package:pilipala/pages/home/index.dart'; import 'package:pilipala/pages/main/index.dart'; import 'controller.dart'; @@ -37,6 +38,8 @@ class _RcmdPageState extends State ScrollController scrollController = _rcmdController.scrollController; StreamController mainStream = Get.find().bottomBarStream; + StreamController searchBarStream = + Get.find().searchBarStream; scrollController.addListener( () { if (scrollController.position.pixels >= @@ -52,8 +55,10 @@ class _RcmdPageState extends State scrollController.position.userScrollDirection; if (direction == ScrollDirection.forward) { mainStream.add(true); + searchBarStream.add(true); } else if (direction == ScrollDirection.reverse) { mainStream.add(false); + searchBarStream.add(false); } }, ); diff --git a/lib/pages/setting/style_setting.dart b/lib/pages/setting/style_setting.dart index 2256b2fd..43335318 100644 --- a/lib/pages/setting/style_setting.dart +++ b/lib/pages/setting/style_setting.dart @@ -83,13 +83,20 @@ class _StyleSettingState extends State { setKey: SettingBoxKey.enableMYBar, defaultVal: true, ), - // SetSwitchItem( - // title: '首页单列', - // subTitle: '每行展示一个内容卡片', - // setKey: SettingBoxKey.enableSingleRow, - // defaultVal: false, - // callFn: (val) => {SmartDialog.showToast('下次启动时生效')}, - // ), + const SetSwitchItem( + title: '首页顶栏收起', + subTitle: '首页列表滑动时,收起顶栏', + setKey: SettingBoxKey.hideSearchBar, + defaultVal: true, + needReboot: true, + ), + const SetSwitchItem( + title: '首页底栏收起', + subTitle: '首页列表滑动时,收起底栏', + setKey: SettingBoxKey.hideTabBar, + defaultVal: true, + needReboot: true, + ), ListTile( dense: false, title: Text('自定义列数', style: titleStyle), diff --git a/lib/pages/setting/widgets/switch_item.dart b/lib/pages/setting/widgets/switch_item.dart index 0e091b9a..488ade14 100644 --- a/lib/pages/setting/widgets/switch_item.dart +++ b/lib/pages/setting/widgets/switch_item.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:hive/hive.dart'; import 'package:pilipala/utils/storage.dart'; import 'package:pilipala/utils/utils.dart'; @@ -9,6 +10,7 @@ class SetSwitchItem extends StatefulWidget { final String? setKey; final bool? defaultVal; final Function? callFn; + final bool? needReboot; const SetSwitchItem({ this.title, @@ -16,6 +18,7 @@ class SetSwitchItem extends StatefulWidget { this.setKey, this.defaultVal, this.callFn, + this.needReboot, Key? key, }) : super(key: key); @@ -43,6 +46,9 @@ class _SetSwitchItemState extends State { if (widget.callFn != null) { widget.callFn!.call(val); } + if (widget.needReboot != null && widget.needReboot!) { + SmartDialog.showToast('重启生效'); + } setState(() {}); } diff --git a/lib/utils/storage.dart b/lib/utils/storage.dart index 1d20877b..062b6df9 100644 --- a/lib/utils/storage.dart +++ b/lib/utils/storage.dart @@ -138,6 +138,8 @@ class SettingBoxKey { static const String displayMode = 'displayMode'; static const String customRows = 'customRows'; // 自定义列 static const String enableMYBar = 'enableMYBar'; + static const String hideSearchBar = 'hideSearchBar'; // 收起顶栏 + static const String hideTabBar = 'hideTabBar'; // 收起底栏 } class LocalCacheKey { From 4550ce26379cc58fd7c0692cd7ccb146f9402719 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sat, 2 Dec 2023 23:10:11 +0800 Subject: [PATCH 19/30] =?UTF-8?q?feat:=20ai=E6=80=BB=E7=BB=93=E5=BC=80?= =?UTF-8?q?=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/setting/extra_setting.dart | 6 ++++ .../video/detail/introduction/controller.dart | 8 +---- lib/pages/video/detail/introduction/view.dart | 31 ++++++++++--------- lib/utils/storage.dart | 1 + 4 files changed, 24 insertions(+), 22 deletions(-) diff --git a/lib/pages/setting/extra_setting.dart b/lib/pages/setting/extra_setting.dart index 6f1ff07e..520a7c85 100644 --- a/lib/pages/setting/extra_setting.dart +++ b/lib/pages/setting/extra_setting.dart @@ -169,6 +169,12 @@ class _ExtraSettingState extends State { setKey: SettingBoxKey.enableSaveLastData, defaultVal: false, ), + const SetSwitchItem( + title: '启用ai总结', + subTitle: '视频详情页开启ai总结', + setKey: SettingBoxKey.enableAi, + defaultVal: true, + ), ListTile( dense: false, title: Text('评论展示', style: titleStyle), diff --git a/lib/pages/video/detail/introduction/controller.dart b/lib/pages/video/detail/introduction/controller.dart index 16cacdbf..8de40602 100644 --- a/lib/pages/video/detail/introduction/controller.dart +++ b/lib/pages/video/detail/introduction/controller.dart @@ -568,13 +568,7 @@ class VideoIntroController extends GetxController { upMid: videoDetail.value.owner!.mid!, ); if (res['status']) { - if (res['data'].modelResult.resultType == 0) { - SmartDialog.showToast('该视频不支持ai总结'); - } - if (res['data'].modelResult.resultType == 2 || - res['data'].modelResult.resultType == 1) { - modelResult = res['data'].modelResult; - } + modelResult = res['data'].modelResult; } SmartDialog.dismiss(); return res; diff --git a/lib/pages/video/detail/introduction/view.dart b/lib/pages/video/detail/introduction/view.dart index 2a9b774d..c6bd7f97 100644 --- a/lib/pages/video/detail/introduction/view.dart +++ b/lib/pages/video/detail/introduction/view.dart @@ -134,6 +134,7 @@ class _VideoInfoState extends State with TickerProviderStateMixin { late final dynamic followStatus; late int mid; late String memberHeroTag; + late bool enableAi; @override void initState() { @@ -150,6 +151,7 @@ class _VideoInfoState extends State with TickerProviderStateMixin { ? '-' : Utils.numFormat(videoIntroController.userStat['follower']); followStatus = videoIntroController.followStatus; + enableAi = setting.get(SettingBoxKey.enableAi, defaultValue: true); } // 收藏 @@ -317,23 +319,22 @@ class _VideoInfoState extends State with TickerProviderStateMixin { ), ), ), - Positioned( - right: 10, - top: 6, - child: GestureDetector( - onTap: () async { - var res = await videoIntroController.aiConclusion(); - if (res['status']) { - if (res['data'].modelResult.resultType == 2 || - res['data'].modelResult.resultType == 1) { + if (enableAi) + Positioned( + right: 10, + top: 6, + child: GestureDetector( + onTap: () async { + var res = + await videoIntroController.aiConclusion(); + if (res['status']) { showAiBottomSheet(); } - } - }, - child: - Image.asset('assets/images/ai.png', height: 22), - ), - ) + }, + child: + Image.asset('assets/images/ai.png', height: 22), + ), + ) ], ), // 点赞收藏转发 布局样式1 diff --git a/lib/utils/storage.dart b/lib/utils/storage.dart index 1d20877b..89f352bb 100644 --- a/lib/utils/storage.dart +++ b/lib/utils/storage.dart @@ -138,6 +138,7 @@ class SettingBoxKey { static const String displayMode = 'displayMode'; static const String customRows = 'customRows'; // 自定义列 static const String enableMYBar = 'enableMYBar'; + static const String enableAi = 'enableAi'; } class LocalCacheKey { From f8ca41e4d140a2e22013142a191f424907e17f56 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sat, 2 Dec 2023 23:11:22 +0800 Subject: [PATCH 20/30] mod --- lib/utils/storage.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/storage.dart b/lib/utils/storage.dart index 89f352bb..633fab79 100644 --- a/lib/utils/storage.dart +++ b/lib/utils/storage.dart @@ -127,6 +127,7 @@ class SettingBoxKey { static const String enableRcmdDynamic = 'enableRcmdDynamic'; static const String enableSaveLastData = 'enableSaveLastData'; static const String enableSystemProxy = 'enableSystemProxy'; + static const String enableAi = 'enableAi'; /// 外观 static const String themeMode = 'themeMode'; @@ -138,7 +139,6 @@ class SettingBoxKey { static const String displayMode = 'displayMode'; static const String customRows = 'customRows'; // 自定义列 static const String enableMYBar = 'enableMYBar'; - static const String enableAi = 'enableAi'; } class LocalCacheKey { From c85f5abcdbb8c705541d70f06d7a3d5f4ae9103f Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sun, 3 Dec 2023 00:58:41 +0800 Subject: [PATCH 21/30] =?UTF-8?q?mod:=20=E7=99=BB=E5=BD=95=E6=97=B6?= =?UTF-8?q?=E8=8E=B7=E5=8F=96accessKey?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common/widgets/video_card_v.dart | 6 ++++-- lib/http/member.dart | 2 +- lib/http/user.dart | 2 +- lib/models/home/rcmd/result.dart | 2 +- lib/pages/webview/controller.dart | 3 ++- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/common/widgets/video_card_v.dart b/lib/common/widgets/video_card_v.dart index 39358fda..fa15a75c 100644 --- a/lib/common/widgets/video_card_v.dart +++ b/lib/common/widgets/video_card_v.dart @@ -333,8 +333,10 @@ class VideoStat extends StatelessWidget { color: Theme.of(context).colorScheme.outline, ), children: [ - TextSpan(text: '${videoItem.stat.view}观看'), - TextSpan(text: ' • ${videoItem.stat.danmu}弹幕'), + if (videoItem.stat.view != '-') + TextSpan(text: '${videoItem.stat.view}观看'), + if (videoItem.stat.danmu != '-') + TextSpan(text: ' • ${videoItem.stat.danmu}弹幕'), ], ), ); diff --git a/lib/http/member.dart b/lib/http/member.dart index a2af8d82..6854dfc6 100644 --- a/lib/http/member.dart +++ b/lib/http/member.dart @@ -403,7 +403,7 @@ class MemberHttp { 'csrf': await Request.getCsrf(), }); await Future.delayed(const Duration(milliseconds: 300)); - qrcodePoll(authCodeRes['data']); + await qrcodePoll(authCodeRes['data']); if (res.data['code'] == 0) { return {'status': true, 'data': [], 'msg': '操作成功'}; } else { diff --git a/lib/http/user.dart b/lib/http/user.dart index 1ab465e0..f439b815 100644 --- a/lib/http/user.dart +++ b/lib/http/user.dart @@ -199,7 +199,7 @@ class UserHttp { } } - // 获取用户凭证 + // 获取用户凭证 失效 static Future thirdLogin() async { var res = await Request().get( 'https://passport.bilibili.com/login/app/third', diff --git a/lib/models/home/rcmd/result.dart b/lib/models/home/rcmd/result.dart index 94ed0727..a2a8006d 100644 --- a/lib/models/home/rcmd/result.dart +++ b/lib/models/home/rcmd/result.dart @@ -118,7 +118,7 @@ class RcmdStat { RcmdStat.fromJson(Map json) { view = json["cover_left_text_1"]; - danmu = json['cover_left_text_2']; + danmu = json['cover_left_text_2'] ?? '-'; } } diff --git a/lib/pages/webview/controller.dart b/lib/pages/webview/controller.dart index fae5a5fc..2dfa9582 100644 --- a/lib/pages/webview/controller.dart +++ b/lib/pages/webview/controller.dart @@ -6,6 +6,7 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:get/get.dart'; import 'package:hive/hive.dart'; import 'package:pilipala/http/init.dart'; +import 'package:pilipala/http/member.dart'; import 'package:pilipala/http/user.dart'; import 'package:pilipala/pages/home/index.dart'; import 'package:pilipala/pages/media/index.dart'; @@ -102,7 +103,6 @@ class WebviewController extends GetxController { try { await SetCookie.onSet(); var result = await UserHttp.userInfo(); - UserHttp.thirdLogin(); if (result['status'] && result['data'].isLogin) { SmartDialog.showToast('登录成功'); try { @@ -115,6 +115,7 @@ class WebviewController extends GetxController { MediaController mediaCtr = Get.find(); mediaCtr.mid = result['data'].mid; await LoginUtils.refreshLoginStatus(true); + MemberHttp.cookieToKey(); } catch (err) { SmartDialog.show(builder: (context) { return AlertDialog( From bda56169b06f0054edb6a107301766671a1e8ab0 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Mon, 4 Dec 2023 00:01:07 +0800 Subject: [PATCH 22/30] mod --- lib/models/video/play/url.dart | 2 -- lib/pages/about/index.dart | 3 --- lib/pages/bangumi/introduction/view.dart | 1 - lib/pages/dynamics/widgets/rich_node_panel.dart | 4 ---- lib/pages/follow/widgets/follow_item.dart | 1 - lib/pages/follow/widgets/owner_follow_list.dart | 2 -- lib/pages/history/widgets/item.dart | 1 - lib/pages/home/view.dart | 2 +- lib/pages/html/view.dart | 1 - lib/pages/live/view.dart | 1 + lib/pages/liveRoom/view.dart | 1 - lib/pages/liveRoom/widgets/bottom_control.dart | 5 ----- lib/pages/rcmd/view.dart | 4 ++-- lib/pages/search/view.dart | 17 +++++++++-------- lib/pages/searchPanel/view.dart | 1 + lib/pages/searchResult/view.dart | 1 + lib/pages/video/detail/introduction/view.dart | 1 - lib/plugin/pl_player/controller.dart | 1 - lib/router/app_pages.dart | 1 - 19 files changed, 15 insertions(+), 35 deletions(-) diff --git a/lib/models/video/play/url.dart b/lib/models/video/play/url.dart index 71894406..4c43cb00 100644 --- a/lib/models/video/play/url.dart +++ b/lib/models/video/play/url.dart @@ -1,5 +1,3 @@ -import 'dart:developer'; - import 'package:pilipala/models/video/play/quality.dart'; class PlayUrlModel { diff --git a/lib/pages/about/index.dart b/lib/pages/about/index.dart index 31808e1c..33b2ee3e 100644 --- a/lib/pages/about/index.dart +++ b/lib/pages/about/index.dart @@ -1,6 +1,3 @@ -import 'dart:io'; - -import 'package:device_info_plus/device_info_plus.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; diff --git a/lib/pages/bangumi/introduction/view.dart b/lib/pages/bangumi/introduction/view.dart index af47d7da..62842075 100644 --- a/lib/pages/bangumi/introduction/view.dart +++ b/lib/pages/bangumi/introduction/view.dart @@ -5,7 +5,6 @@ import 'package:get/get.dart'; import 'package:hive/hive.dart'; import 'package:pilipala/common/constants.dart'; import 'package:pilipala/common/widgets/badge.dart'; -import 'package:pilipala/common/widgets/http_error.dart'; import 'package:pilipala/common/widgets/network_img_layer.dart'; import 'package:pilipala/common/widgets/stat/danmu.dart'; import 'package:pilipala/common/widgets/stat/view.dart'; diff --git a/lib/pages/dynamics/widgets/rich_node_panel.dart b/lib/pages/dynamics/widgets/rich_node_panel.dart index a66772a4..8b7dcd69 100644 --- a/lib/pages/dynamics/widgets/rich_node_panel.dart +++ b/lib/pages/dynamics/widgets/rich_node_panel.dart @@ -1,8 +1,6 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:pilipala/common/widgets/network_img_layer.dart'; -import 'package:pilipala/models/dynamics/result.dart'; -import 'package:pilipala/pages/preview/index.dart'; // 富文本 InlineSpan richNode(item, context) { @@ -11,13 +9,11 @@ InlineSpan richNode(item, context) { TextStyle authorStyle = TextStyle(color: Theme.of(context).colorScheme.primary); List spanChilds = []; - String contentType = 'desc'; dynamic richTextNodes; if (item.modules.moduleDynamic.desc != null) { richTextNodes = item.modules.moduleDynamic.desc.richTextNodes; } else if (item.modules.moduleDynamic.major != null) { - contentType = 'major'; // 动态页面 richTextNodes 层级可能与主页动态层级不同 richTextNodes = item.modules.moduleDynamic.major.opus.summary.richTextNodes; diff --git a/lib/pages/follow/widgets/follow_item.dart b/lib/pages/follow/widgets/follow_item.dart index 3f9e4f3c..ac9cc01b 100644 --- a/lib/pages/follow/widgets/follow_item.dart +++ b/lib/pages/follow/widgets/follow_item.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:get/get.dart'; import 'package:pilipala/common/widgets/network_img_layer.dart'; import 'package:pilipala/models/follow/result.dart'; diff --git a/lib/pages/follow/widgets/owner_follow_list.dart b/lib/pages/follow/widgets/owner_follow_list.dart index 0dcd785d..ccc11c44 100644 --- a/lib/pages/follow/widgets/owner_follow_list.dart +++ b/lib/pages/follow/widgets/owner_follow_list.dart @@ -1,5 +1,3 @@ -import 'dart:math'; - import 'package:easy_debounce/easy_throttle.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; diff --git a/lib/pages/history/widgets/item.dart b/lib/pages/history/widgets/item.dart index b80affc8..a83e118b 100644 --- a/lib/pages/history/widgets/item.dart +++ b/lib/pages/history/widgets/item.dart @@ -11,7 +11,6 @@ import 'package:pilipala/models/bangumi/info.dart'; import 'package:pilipala/models/common/business_type.dart'; import 'package:pilipala/models/common/search_type.dart'; import 'package:pilipala/models/live/item.dart'; -import 'package:pilipala/pages/history/index.dart'; import 'package:pilipala/pages/history_search/index.dart'; import 'package:pilipala/utils/feed_back.dart'; import 'package:pilipala/utils/id_utils.dart'; diff --git a/lib/pages/home/view.dart b/lib/pages/home/view.dart index fa5a1cc9..a6f3b42f 100644 --- a/lib/pages/home/view.dart +++ b/lib/pages/home/view.dart @@ -3,7 +3,6 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:pilipala/common/widgets/network_img_layer.dart'; -import 'package:pilipala/pages/main/index.dart'; import 'package:pilipala/pages/mine/index.dart'; import 'package:pilipala/pages/search/index.dart'; import 'package:pilipala/utils/feed_back.dart'; @@ -75,6 +74,7 @@ class _HomePageState extends State dividerColor: Colors.transparent, enableFeedback: true, splashBorderRadius: BorderRadius.circular(10), + tabAlignment: TabAlignment.center, onTap: (value) { feedBack(); if (_homeController.initialIndex == value) { diff --git a/lib/pages/html/view.dart b/lib/pages/html/view.dart index 64fabff8..478626af 100644 --- a/lib/pages/html/view.dart +++ b/lib/pages/html/view.dart @@ -9,7 +9,6 @@ import 'package:pilipala/common/widgets/html_render.dart'; import 'package:pilipala/common/widgets/http_error.dart'; import 'package:pilipala/common/widgets/network_img_layer.dart'; import 'package:pilipala/models/common/reply_type.dart'; -import 'package:pilipala/pages/mine/index.dart'; import 'package:pilipala/pages/video/detail/reply/widgets/reply_item.dart'; import 'package:pilipala/pages/video/detail/replyNew/index.dart'; import 'package:pilipala/pages/video/detail/replyReply/index.dart'; diff --git a/lib/pages/live/view.dart b/lib/pages/live/view.dart index c224dddf..302d226d 100644 --- a/lib/pages/live/view.dart +++ b/lib/pages/live/view.dart @@ -72,6 +72,7 @@ class _LivePageState extends State @override Widget build(BuildContext context) { + super.build(context); return Container( clipBehavior: Clip.hardEdge, margin: const EdgeInsets.only( diff --git a/lib/pages/liveRoom/view.dart b/lib/pages/liveRoom/view.dart index 36b1f979..125460b9 100644 --- a/lib/pages/liveRoom/view.dart +++ b/lib/pages/liveRoom/view.dart @@ -52,7 +52,6 @@ class _LiveRoomPageState extends State { @override Widget build(BuildContext context) { - final videoHeight = MediaQuery.of(context).size.width * 9 / 16; Widget childWhenDisabled = Scaffold( primary: true, appBar: AppBar( diff --git a/lib/pages/liveRoom/widgets/bottom_control.dart b/lib/pages/liveRoom/widgets/bottom_control.dart index 49343bb1..7347a8fc 100644 --- a/lib/pages/liveRoom/widgets/bottom_control.dart +++ b/lib/pages/liveRoom/widgets/bottom_control.dart @@ -3,7 +3,6 @@ import 'dart:io'; import 'package:floating/floating.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:get/get.dart'; import 'package:hive/hive.dart'; import 'package:pilipala/models/video/play/url.dart'; import 'package:pilipala/pages/liveRoom/index.dart'; @@ -43,10 +42,6 @@ class _BottomControlState extends State { @override Widget build(BuildContext context) { - const textStyle = TextStyle( - color: Colors.white, - fontSize: 12, - ); return AppBar( backgroundColor: Colors.transparent, foregroundColor: Colors.white, diff --git a/lib/pages/rcmd/view.dart b/lib/pages/rcmd/view.dart index a0f867f7..f9773271 100644 --- a/lib/pages/rcmd/view.dart +++ b/lib/pages/rcmd/view.dart @@ -196,8 +196,8 @@ class _RcmdPageState extends State } class LoadingMore extends StatelessWidget { - dynamic ctr; - LoadingMore({super.key, this.ctr}); + final dynamic ctr; + const LoadingMore({super.key, this.ctr}); @override Widget build(BuildContext context) { diff --git a/lib/pages/search/view.dart b/lib/pages/search/view.dart index 0ec910f1..55ee3b22 100644 --- a/lib/pages/search/view.dart +++ b/lib/pages/search/view.dart @@ -160,25 +160,25 @@ class _SearchPageState extends State with RouteAware { } Widget _searchSuggest() { - SSearchController _ssCtr = _searchController; + SSearchController ssCtr = _searchController; return Obx( - () => _ssCtr.searchSuggestList.isNotEmpty && - _ssCtr.searchSuggestList.first.term != null && - _ssCtr.controller.value.text != '' + () => ssCtr.searchSuggestList.isNotEmpty && + ssCtr.searchSuggestList.first.term != null && + ssCtr.controller.value.text != '' ? ListView.builder( physics: const NeverScrollableScrollPhysics(), shrinkWrap: true, - itemCount: _ssCtr.searchSuggestList.length, + itemCount: ssCtr.searchSuggestList.length, itemBuilder: (context, index) { return InkWell( customBorder: RoundedRectangleBorder( borderRadius: BorderRadius.circular(4), ), - onTap: () => _ssCtr - .onClickKeyword(_ssCtr.searchSuggestList[index].term!), + onTap: () => ssCtr + .onClickKeyword(ssCtr.searchSuggestList[index].term!), child: Padding( padding: const EdgeInsets.only(left: 20, top: 9, bottom: 9), - child: _ssCtr.searchSuggestList[index].textRich, + child: ssCtr.searchSuggestList[index].textRich, ), ); }, @@ -235,6 +235,7 @@ class _SearchPageState extends State with RouteAware { return Obx( () => HotKeyword( width: width, + // ignore: invalid_use_of_protected_member hotSearchList: _searchController.hotSearchList.value, onClick: (keyword) async { _searchController.searchFocusNode.unfocus(); diff --git a/lib/pages/searchPanel/view.dart b/lib/pages/searchPanel/view.dart index 9fd37b7e..10e52a54 100644 --- a/lib/pages/searchPanel/view.dart +++ b/lib/pages/searchPanel/view.dart @@ -83,6 +83,7 @@ class _SearchPanelState extends State case SearchType.video: return SearchVideoPanel( ctr: _searchPanelController, + // ignore: invalid_use_of_protected_member list: list.value, ); case SearchType.media_bangumi: diff --git a/lib/pages/searchResult/view.dart b/lib/pages/searchResult/view.dart index f2efb33a..ceb77190 100644 --- a/lib/pages/searchResult/view.dart +++ b/lib/pages/searchResult/view.dart @@ -82,6 +82,7 @@ class _SearchResultPageState extends State labelStyle: const TextStyle(fontSize: 13), dividerColor: Colors.transparent, unselectedLabelColor: Theme.of(context).colorScheme.outline, + tabAlignment: TabAlignment.start, onTap: (index) { if (index == _searchResultController!.tabIndex) { Get.find( diff --git a/lib/pages/video/detail/introduction/view.dart b/lib/pages/video/detail/introduction/view.dart index c6bd7f97..98ce9ba8 100644 --- a/lib/pages/video/detail/introduction/view.dart +++ b/lib/pages/video/detail/introduction/view.dart @@ -12,7 +12,6 @@ import 'package:pilipala/common/widgets/stat/view.dart'; import 'package:pilipala/models/video_detail_res.dart'; import 'package:pilipala/pages/video/detail/introduction/controller.dart'; import 'package:pilipala/pages/video/detail/widgets/ai_detail.dart'; -import 'package:pilipala/services/service_locator.dart'; import 'package:pilipala/utils/feed_back.dart'; import 'package:pilipala/utils/storage.dart'; import 'package:pilipala/utils/utils.dart'; diff --git a/lib/plugin/pl_player/controller.dart b/lib/plugin/pl_player/controller.dart index 8f09d0ca..569c2a1c 100644 --- a/lib/plugin/pl_player/controller.dart +++ b/lib/plugin/pl_player/controller.dart @@ -6,7 +6,6 @@ import 'dart:typed_data'; import 'package:easy_debounce/easy_throttle.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_volume_controller/flutter_volume_controller.dart'; import 'package:get/get.dart'; import 'package:hive/hive.dart'; diff --git a/lib/router/app_pages.dart b/lib/router/app_pages.dart index cec93c26..03e3d97f 100644 --- a/lib/router/app_pages.dart +++ b/lib/router/app_pages.dart @@ -27,7 +27,6 @@ import 'package:pilipala/pages/member_dynamics/index.dart'; import 'package:pilipala/pages/member_like/index.dart'; import 'package:pilipala/pages/member_search/index.dart'; import 'package:pilipala/pages/member_seasons/index.dart'; -import 'package:pilipala/pages/preview/index.dart'; import 'package:pilipala/pages/search/index.dart'; import 'package:pilipala/pages/searchResult/index.dart'; import 'package:pilipala/pages/setting/extra_setting.dart'; From ebbd280768ab380398ad09a1805cf74ec9029fd7 Mon Sep 17 00:00:00 2001 From: orz12 Date: Mon, 11 Dec 2023 11:44:23 +0800 Subject: [PATCH 23/30] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E5=8F=91=E9=80=81=E5=BC=B9=E5=B9=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/http/api.dart | 4 + lib/http/danmaku.dart | 68 ++++++++++++++ .../video/detail/widgets/header_control.dart | 93 +++++++++++++++++++ 3 files changed, 165 insertions(+) diff --git a/lib/http/api.dart b/lib/http/api.dart index 0125c742..04fe0a44 100644 --- a/lib/http/api.dart +++ b/lib/http/api.dart @@ -312,6 +312,10 @@ class Api { static const String webDanmaku = '/x/v2/dm/web/seg.so'; + //发送视频弹幕 + //https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/danmaku/action.md + static const String shootDanmaku = '/x/v2/dm/post'; + // up主分组 static const String followUpTag = '/x/relation/tags'; diff --git a/lib/http/danmaku.dart b/lib/http/danmaku.dart index 87f08d8b..e34320e7 100644 --- a/lib/http/danmaku.dart +++ b/lib/http/danmaku.dart @@ -24,4 +24,72 @@ class DanmakaHttp { ); return DmSegMobileReply.fromBuffer(response.data); } + static Future shootDanmaku({ + int type = 1,//弹幕类选择(1:视频弹幕 2:漫画弹幕) + required int oid,// 视频cid + required String msg,//弹幕文本(长度小于 100 字符) + int mode = 1,// 弹幕类型(1:滚动弹幕 4:底端弹幕 5:顶端弹幕 6:逆向弹幕(不能使用) 7:高级弹幕 8:代码弹幕(不能使用) 9:BAS弹幕(pool必须为2)) + // String? aid,// 稿件avid + // String? bvid,// bvid与aid必须有一个 + required String bvid, + int? progress,// 弹幕出现在视频内的时间(单位为毫秒,默认为0) + int? color,// 弹幕颜色(默认白色,16777215) + int? fontsize,// 弹幕字号(默认25) + int? pool,// 弹幕池选择(0:普通池 1:字幕池 2:特殊池(代码/BAS弹幕)默认普通池,0) + //int? rnd,// 当前时间戳*1000000(若无此项,则发送弹幕冷却时间限制为90s;若有此项,则发送弹幕冷却时间限制为5s) + int? colorful,//60001:专属渐变彩色(需要会员) + int? checkbox_type,//是否带 UP 身份标识(0:普通;4:带有标识) + // String? csrf,//CSRF Token(位于 Cookie) Cookie 方式必要 + // String? access_key,// APP 登录 Token APP 方式必要 + }) async { + // 构建参数对象 + // assert(aid != null || bvid != null); + // assert(csrf != null || access_key != null); + assert(msg.length < 100); + // 构建参数对象 + var params = { + 'type': type, + 'oid': oid, + 'msg': msg, + 'mode': mode, + //'aid': aid, + 'bvid': bvid, + 'progress': progress, + 'color': color, + 'fontsize': fontsize, + 'pool': pool, + 'rnd': DateTime.now().microsecondsSinceEpoch, + 'colorful': colorful, + 'checkbox_type': checkbox_type, + 'csrf': await Request.getCsrf(), + // 'access_key': access_key, + }..removeWhere((key, value) => value == null); + + var response = await Request().post( + Api.shootDanmaku, + data: params, + options: Options( + contentType: Headers.formUrlEncodedContentType, + ), + ); + if (response.statusCode != 200) { + return { + 'status': false, + 'data': [], + 'msg': '弹幕发送失败,状态码:${response.statusCode}', + }; + } + if (response.data['code'] == 0) { + return { + 'status': true, + 'data': response.data['data'], + }; + } else { + return { + 'status': false, + 'data': [], + 'msg': "${response.data['code']}: ${response.data['message']}", + }; + } + } } diff --git a/lib/pages/video/detail/widgets/header_control.dart b/lib/pages/video/detail/widgets/header_control.dart index ee5f2c0f..6068becf 100644 --- a/lib/pages/video/detail/widgets/header_control.dart +++ b/lib/pages/video/detail/widgets/header_control.dart @@ -15,6 +15,7 @@ import 'package:pilipala/pages/video/detail/introduction/widgets/menu_row.dart'; import 'package:pilipala/plugin/pl_player/index.dart'; import 'package:pilipala/plugin/pl_player/models/play_repeat.dart'; import 'package:pilipala/utils/storage.dart'; +import 'package:pilipala/http/danmaku.dart'; class HeaderControl extends StatefulWidget implements PreferredSizeWidget { final PlPlayerController? controller; @@ -179,6 +180,84 @@ class _HeaderControlState extends State { ); } + /// 发送弹幕 + void showShootDanmakuSheet() { + final TextEditingController textController = TextEditingController(); + bool isSending = false; // 追踪是否正在发送 + showDialog( + context: Get.context!, + builder: (context) { + // TODO: 支持更多类型和颜色的弹幕 + return AlertDialog( + title: const Text('发送弹幕(测试)'), + content: StatefulBuilder(builder: (context, StateSetter setState) { + return TextField( + controller: textController, + ); + }), + actions: [ + TextButton( + onPressed: () => Get.back(), + child: Text( + '取消', + style: TextStyle(color: Theme.of(context).colorScheme.outline), + ), + ), + StatefulBuilder(builder: (context, StateSetter setState) { + return TextButton( + onPressed: isSending + ? null + : () async { + String msg = textController.text; + if (msg.isEmpty) { + SmartDialog.showToast('弹幕内容不能为空'); + return; + } else if (msg.length > 100) { + SmartDialog.showToast('弹幕内容不能超过100个字符'); + return; + } + setState(() { + isSending = true; // 开始发送,更新状态 + }); + //修改按钮文字 + // SmartDialog.showToast('弹幕发送中,\n$msg'); + dynamic res = await DanmakaHttp.shootDanmaku( + oid: widget.videoDetailCtr!.cid!.value, + msg: textController.text, + bvid: widget.videoDetailCtr!.bvid!, + progress: + widget.controller!.position.value.inMilliseconds, + type: 1, + ); + setState(() { + isSending = false; // 发送结束,更新状态 + }); + if (res['status']) { + SmartDialog.showToast('发送成功'); + // 发送成功,自动预览该弹幕,避免重新请求 + // TODO: 暂停状态下预览弹幕仍会移动与计时,可考虑添加到dmSegList或其他方式实现 + widget.controller!.danmakuController!.addItems([ + DanmakuItem( + msg, + color: Colors.white, + time: widget.controller!.position.value.inMilliseconds, + type: DanmakuItemType.scroll, + ) + ]); + Get.back(); + } else { + SmartDialog.showToast('发送失败,错误信息为${res['msg']}'); + } + }, + child: Text(isSending ? '发送中...' : '发送'), + ); + }) + ], + ); + }, + ); + } + /// 选择倍速 void showSetSpeedSheet() { double currentSpeed = widget.controller!.playbackSpeed; @@ -825,6 +904,20 @@ class _HeaderControlState extends State { // ), // fuc: () => _.screenshot(), // ), + SizedBox( + width: 56, + height: 34, + child: TextButton( + style: ButtonStyle( + padding: MaterialStateProperty.all(EdgeInsets.zero), + ), + onPressed: () => showShootDanmakuSheet(), + child: const Text( + '发弹幕', + style: textStyle, + ), + ), + ), SizedBox( width: 34, height: 34, From 173695ace6cad95bec5e31e9394f5854934f5e3e Mon Sep 17 00:00:00 2001 From: KoolShow <51787949+KoolShow@users.noreply.github.com> Date: Wed, 13 Dec 2023 17:57:41 +0800 Subject: [PATCH 24/30] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=89=AF=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E9=A3=8E=E6=A0=BC=E4=B8=8D=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复 播放设置 自动PiP播放 选项副标题风格不统一 --- lib/pages/setting/play_setting.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/setting/play_setting.dart b/lib/pages/setting/play_setting.dart index 6dbfefcf..9ac9aec6 100644 --- a/lib/pages/setting/play_setting.dart +++ b/lib/pages/setting/play_setting.dart @@ -96,7 +96,7 @@ class _PlaySettingState extends State { ), const SetSwitchItem( title: '自动PiP播放', - subTitle: 'app切换至后台时画中画播放', + subTitle: '进入后台时画中画播放', setKey: SettingBoxKey.autoPiP, defaultVal: false, ), From a14283260ecb403451a63945085390089552b20e Mon Sep 17 00:00:00 2001 From: gumengyu <1415515984yuri@gmail.com> Date: Fri, 15 Dec 2023 13:22:51 +0800 Subject: [PATCH 25/30] =?UTF-8?q?improve:=20=E8=AE=BE=E7=BD=AE=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=A0=B7=E5=BC=8F=E6=94=B9=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 下拉选择改为dialog, 参考 Android 系统内部设置关于选项的行为 - 一些列表对齐问题 - 字体设置预览文字居中 --- lib/pages/about/index.dart | 14 +- lib/pages/setting/extra_setting.dart | 62 ++++--- lib/pages/setting/pages/font_size_select.dart | 10 +- lib/pages/setting/play_setting.dart | 153 +++++++++--------- lib/pages/setting/style_setting.dart | 113 +++++-------- lib/pages/setting/widgets/select_dialog.dart | 68 ++++++++ lib/pages/setting/widgets/switch_item.dart | 1 + 7 files changed, 220 insertions(+), 201 deletions(-) create mode 100644 lib/pages/setting/widgets/select_dialog.dart diff --git a/lib/pages/about/index.dart b/lib/pages/about/index.dart index 31808e1c..d50946d6 100644 --- a/lib/pages/about/index.dart +++ b/lib/pages/about/index.dart @@ -34,11 +34,6 @@ class _AboutPageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Divider( - thickness: 8, - height: 10, - color: Theme.of(context).colorScheme.onInverseSurface, - ), Image.asset( 'assets/images/logo/logo_android_2.png', width: 150, @@ -83,9 +78,9 @@ class _AboutPageState extends State { // ), // ), Divider( - thickness: 8, + thickness: 1, height: 30, - color: Theme.of(context).colorScheme.onInverseSurface, + color: Theme.of(context).colorScheme.outlineVariant, ), ListTile( onTap: () => _aboutController.githubUrl(), @@ -134,11 +129,6 @@ class _AboutPageState extends State { title: const Text('赞助'), trailing: Icon(Icons.arrow_forward_ios, size: 16, color: outline), ), - Divider( - thickness: 8, - height: 30, - color: Theme.of(context).colorScheme.onInverseSurface, - ), ], ), ), diff --git a/lib/pages/setting/extra_setting.dart b/lib/pages/setting/extra_setting.dart index 520a7c85..57c33ff4 100644 --- a/lib/pages/setting/extra_setting.dart +++ b/lib/pages/setting/extra_setting.dart @@ -3,6 +3,7 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:hive/hive.dart'; import 'package:pilipala/models/common/dynamics_type.dart'; import 'package:pilipala/models/common/reply_sort_type.dart'; +import 'package:pilipala/pages/setting/widgets/select_dialog.dart'; import 'package:pilipala/utils/storage.dart'; import 'widgets/switch_item.dart'; @@ -182,23 +183,21 @@ class _ExtraSettingState extends State { '当前优先展示「${ReplySortType.values[defaultReplySort].titles}」', style: subTitleStyle, ), - trailing: PopupMenuButton( - initialValue: defaultReplySort, - icon: const Icon(Icons.more_vert_outlined, size: 22), - onSelected: (item) { - defaultReplySort = item; - setting.put(SettingBoxKey.replySortType, item); + onTap: () async { + int? result = await showDialog( + context: context, + builder: (context) { + return SelectDialog(title: '评论展示', value: defaultReplySort, values: ReplySortType.values.map((e) { + return {'title': e.titles, 'value': e.index}; + }).toList()); + }, + ); + if (result != null) { + defaultReplySort = result; + setting.put(SettingBoxKey.replySortType, result); setState(() {}); - }, - itemBuilder: (BuildContext context) => [ - for (var i in ReplySortType.values) ...[ - PopupMenuItem( - value: i.index, - child: Text(i.titles), - ), - ] - ], - ), + } + }, ), ListTile( dense: false, @@ -207,23 +206,21 @@ class _ExtraSettingState extends State { '当前优先展示「${DynamicsType.values[defaultDynamicType].labels}」', style: subTitleStyle, ), - trailing: PopupMenuButton( - initialValue: defaultDynamicType, - icon: const Icon(Icons.more_vert_outlined, size: 22), - onSelected: (item) { - defaultDynamicType = item; - setting.put(SettingBoxKey.defaultDynamicType, item); + onTap: () async { + int? result = await showDialog( + context: context, + builder: (context) { + return SelectDialog(title: '动态展示', value: defaultDynamicType, values: DynamicsType.values.map((e) { + return {'title': e.labels, 'value': e.index}; + }).toList()); + }, + ); + if (result != null) { + defaultDynamicType = result; + setting.put(SettingBoxKey.defaultDynamicType, result); setState(() {}); - }, - itemBuilder: (BuildContext context) => [ - for (var i in DynamicsType.values) ...[ - PopupMenuItem( - value: i.index, - child: Text(i.labels), - ), - ] - ], - ), + } + }, ), ListTile( enableFeedback: true, @@ -231,6 +228,7 @@ class _ExtraSettingState extends State { title: Text('设置代理', style: titleStyle), subtitle: Text('设置代理 host:port', style: subTitleStyle), trailing: Transform.scale( + alignment: Alignment.centerRight, scale: 0.8, child: Switch( thumbIcon: MaterialStateProperty.resolveWith( diff --git a/lib/pages/setting/pages/font_size_select.dart b/lib/pages/setting/pages/font_size_select.dart index 04d6794d..4985c83f 100644 --- a/lib/pages/setting/pages/font_size_select.dart +++ b/lib/pages/setting/pages/font_size_select.dart @@ -44,12 +44,10 @@ class _FontSizeSelectPageState extends State { body: Column( children: [ Expanded( - child: SingleChildScrollView( - child: Center( - child: Text( - '当前字体大小:${currentSize == 1.0 ? '默认' : currentSize}', - style: TextStyle(fontSize: 14 * currentSize), - ), + child: Center( + child: Text( + '当前字体大小:${currentSize == 1.0 ? '默认' : currentSize}', + style: TextStyle(fontSize: 14 * currentSize), ), ), ), diff --git a/lib/pages/setting/play_setting.dart b/lib/pages/setting/play_setting.dart index 6dbfefcf..6bf5ada0 100644 --- a/lib/pages/setting/play_setting.dart +++ b/lib/pages/setting/play_setting.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:hive/hive.dart'; import 'package:pilipala/models/video/play/quality.dart'; +import 'package:pilipala/pages/setting/widgets/select_dialog.dart'; import 'package:pilipala/plugin/pl_player/index.dart'; import 'package:pilipala/services/service_locator.dart'; import 'package:pilipala/utils/storage.dart'; @@ -68,7 +69,7 @@ class _PlaySettingState extends State { dense: false, onTap: () => Get.toNamed('/playSpeedSet'), title: Text('倍速设置', style: titleStyle), - trailing: const Icon(Icons.arrow_forward_ios, size: 17), + subtitle: Text('设置视频播放速度', style: subTitleStyle), ), const SetSwitchItem( title: '开启1080P', @@ -149,23 +150,21 @@ class _PlaySettingState extends State { '当前画质${VideoQualityCode.fromCode(defaultVideoQa)!.description!}', style: subTitleStyle, ), - trailing: PopupMenuButton( - initialValue: defaultVideoQa, - icon: const Icon(Icons.more_vert_outlined, size: 22), - onSelected: (item) { - defaultVideoQa = item; - setting.put(SettingBoxKey.defaultVideoQa, item); + onTap: () async { + int? result = await showDialog( + context: context, + builder: (context) { + return SelectDialog(title: '默认画质', value: defaultVideoQa, values: VideoQuality.values.reversed.map((e) { + return {'title': e.description, 'value': e.code}; + }).toList()); + }, + ); + if (result != null) { + defaultVideoQa = result; + setting.put(SettingBoxKey.defaultVideoQa, result); setState(() {}); - }, - itemBuilder: (BuildContext context) => [ - for (var i in VideoQuality.values.reversed) ...[ - PopupMenuItem( - value: i.code, - child: Text(i.description), - ), - ] - ], - ), + } + }, ), ListTile( dense: false, @@ -174,23 +173,21 @@ class _PlaySettingState extends State { '当前音质${AudioQualityCode.fromCode(defaultAudioQa)!.description!}', style: subTitleStyle, ), - trailing: PopupMenuButton( - initialValue: defaultAudioQa, - icon: const Icon(Icons.more_vert_outlined, size: 22), - onSelected: (item) { - defaultAudioQa = item; - setting.put(SettingBoxKey.defaultAudioQa, item); + onTap: () async { + int? result = await showDialog( + context: context, + builder: (context) { + return SelectDialog(title: '默认音质', value: defaultAudioQa, values: AudioQuality.values.reversed.map((e) { + return {'title': e.description, 'value': e.code}; + }).toList()); + }, + ); + if (result != null) { + defaultAudioQa = result; + setting.put(SettingBoxKey.defaultAudioQa, result); setState(() {}); - }, - itemBuilder: (BuildContext context) => [ - for (var i in AudioQuality.values.reversed) ...[ - PopupMenuItem( - value: i.code, - child: Text(i.description), - ), - ] - ], - ), + } + }, ), ListTile( dense: false, @@ -199,23 +196,21 @@ class _PlaySettingState extends State { '当前解码格式${VideoDecodeFormatsCode.fromCode(defaultDecode)!.description!}', style: subTitleStyle, ), - trailing: PopupMenuButton( - initialValue: defaultDecode, - icon: const Icon(Icons.more_vert_outlined, size: 22), - onSelected: (item) { - defaultDecode = item; - setting.put(SettingBoxKey.defaultDecode, item); + onTap: () async { + String? result = await showDialog( + context: context, + builder: (context) { + return SelectDialog(title: '默认解码格式', value: defaultDecode, values: VideoDecodeFormats.values.map((e) { + return {'title': e.description, 'value': e.code}; + }).toList()); + }, + ); + if (result != null) { + defaultDecode = result; + setting.put(SettingBoxKey.defaultDecode, result); setState(() {}); - }, - itemBuilder: (BuildContext context) => [ - for (var i in VideoDecodeFormats.values) ...[ - PopupMenuItem( - value: i.code, - child: Text(i.description), - ), - ] - ], - ), + } + }, ), ListTile( dense: false, @@ -224,23 +219,21 @@ class _PlaySettingState extends State { '当前全屏方式:${FullScreenModeCode.fromCode(defaultFullScreenMode)!.description}', style: subTitleStyle, ), - trailing: PopupMenuButton( - initialValue: defaultFullScreenMode, - icon: const Icon(Icons.more_vert_outlined, size: 22), - onSelected: (item) { - defaultFullScreenMode = item; - setting.put(SettingBoxKey.fullScreenMode, item); + onTap: () async { + int? result = await showDialog( + context: context, + builder: (context) { + return SelectDialog(title: '默认全屏方式', value: defaultFullScreenMode, values: FullScreenMode.values.map((e) { + return {'title': e.description, 'value': e.code}; + }).toList()); + }, + ); + if (result != null) { + defaultFullScreenMode = result; + setting.put(SettingBoxKey.fullScreenMode, result); setState(() {}); - }, - itemBuilder: (BuildContext context) => [ - for (var i in FullScreenMode.values) ...[ - PopupMenuItem( - value: i.code, - child: Text(i.description), - ), - ] - ], - ), + } + }, ), ListTile( dense: false, @@ -249,23 +242,21 @@ class _PlaySettingState extends State { '当前展示方式:${BtmProgresBehaviorCode.fromCode(defaultBtmProgressBehavior)!.description}', style: subTitleStyle, ), - trailing: PopupMenuButton( - initialValue: defaultBtmProgressBehavior, - icon: const Icon(Icons.more_vert_outlined, size: 22), - onSelected: (item) { - defaultBtmProgressBehavior = item; - setting.put(SettingBoxKey.btmProgressBehavior, item); + onTap: () async { + int? result = await showDialog( + context: context, + builder: (context) { + return SelectDialog(title: '底部进度条展示', value: defaultBtmProgressBehavior, values: BtmProgresBehavior.values.map((e) { + return {'title': e.description, 'value': e.code}; + }).toList()); + }, + ); + if (result != null) { + defaultBtmProgressBehavior = result; + setting.put(SettingBoxKey.btmProgressBehavior, result); setState(() {}); - }, - itemBuilder: (BuildContext context) => [ - for (var i in BtmProgresBehavior.values) ...[ - PopupMenuItem( - value: i.code, - child: Text(i.description), - ), - ] - ], - ), + } + }, ), ], ), diff --git a/lib/pages/setting/style_setting.dart b/lib/pages/setting/style_setting.dart index 43335318..277919dd 100644 --- a/lib/pages/setting/style_setting.dart +++ b/lib/pages/setting/style_setting.dart @@ -4,6 +4,8 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:hive/hive.dart'; import 'package:pilipala/models/common/theme_type.dart'; +import 'package:pilipala/pages/setting/pages/color_select.dart'; +import 'package:pilipala/pages/setting/widgets/select_dialog.dart'; import 'package:pilipala/utils/storage.dart'; import 'controller.dart'; @@ -18,6 +20,8 @@ class StyleSetting extends StatefulWidget { class _StyleSettingState extends State { final SettingController settingController = Get.put(SettingController()); + final ColorSelectController colorSelectController = Get.put(ColorSelectController()); + Box setting = GStrorage.setting; late int picQuality; late ThemeType _tempThemeValue; @@ -56,6 +60,7 @@ class _StyleSettingState extends State { title: const Text('震动反馈'), subtitle: Text('请确定手机设置中已开启震动反馈', style: subTitleStyle), trailing: Transform.scale( + alignment: Alignment.centerRight, scale: 0.8, child: Switch( thumbIcon: MaterialStateProperty.resolveWith( @@ -98,29 +103,27 @@ class _StyleSettingState extends State { needReboot: true, ), ListTile( + onTap: () async { + int? result = await showDialog( + context: context, + builder: (context) { + return SelectDialog(title: '自定义列数', value: defaultCustomRows, values: [1, 2, 3, 4, 5].map((e) { + return {'title': '$e 列', 'value': e}; + }).toList()); + }, + ); + if (result != null) { + defaultCustomRows = result; + setting.put(SettingBoxKey.customRows, result); + setState(() {}); + } + }, dense: false, title: Text('自定义列数', style: titleStyle), subtitle: Text( - '当前列数', + '当前列数 $defaultCustomRows 列', style: subTitleStyle, ), - trailing: PopupMenuButton( - initialValue: defaultCustomRows, - icon: const Icon(Icons.more_vert_outlined, size: 22), - onSelected: (item) { - defaultCustomRows = item; - setting.put(SettingBoxKey.customRows, item); - setState(() {}); - }, - itemBuilder: (BuildContext context) => [ - for (var i in [1, 2, 3, 4, 5]) ...[ - PopupMenuItem( - value: i, - child: Text(i.toString()), - ), - ] - ], - ), ), ListTile( dense: false, @@ -176,88 +179,58 @@ class _StyleSettingState extends State { }, title: Text('图片质量', style: titleStyle), subtitle: Text('选择合适的图片清晰度,上限100%', style: subTitleStyle), - trailing: Obx( - () => Text( - '${settingController.picQuality.value}%', - style: Theme.of(context).textTheme.titleSmall, + trailing: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Obx( + () => Text( + '${settingController.picQuality.value}%', + style: Theme.of(context).textTheme.titleSmall, + ), ), ), ), ListTile( dense: false, - onTap: () { - showDialog( + onTap: () async { + ThemeType? result = await showDialog( context: context, builder: (context) { - return AlertDialog( - title: const Text('主题模式'), - contentPadding: const EdgeInsets.fromLTRB(0, 12, 0, 12), - content: StatefulBuilder( - builder: (context, StateSetter setState) { - return Column( - mainAxisSize: MainAxisSize.min, - children: [ - for (var i in ThemeType.values) ...[ - RadioListTile( - value: i, - title: Text(i.description, style: titleStyle), - groupValue: _tempThemeValue, - onChanged: (ThemeType? value) { - setState(() { - _tempThemeValue = i; - }); - }, - ), - ] - ], - ); - }), - actions: [ - TextButton( - onPressed: () => Navigator.pop(context), - child: Text( - '取消', - style: TextStyle( - color: Theme.of(context).colorScheme.outline), - )), - TextButton( - onPressed: () { - settingController.themeType.value = _tempThemeValue; - setting.put( - SettingBoxKey.themeMode, _tempThemeValue.code); - Get.forceAppUpdate(); - Get.back(); - }, - child: const Text('确定')) - ], - ); + return SelectDialog(title: '主题模式', value: _tempThemeValue, values: ThemeType.values.map((e) { + return {'title': e.description, 'value': e}; + }).toList()); }, ); + if (result != null) { + _tempThemeValue = result; + settingController.themeType.value = result; + setting.put( + SettingBoxKey.themeMode, result.code); + Get.forceAppUpdate(); + } }, title: Text('主题模式', style: titleStyle), subtitle: Obx(() => Text( '当前模式:${settingController.themeType.value.description}', style: subTitleStyle)), - trailing: const Icon(Icons.arrow_right_alt_outlined), ), ListTile( dense: false, onTap: () => Get.toNamed('/colorSetting'), title: Text('应用主题', style: titleStyle), - trailing: const Icon(Icons.arrow_forward_ios, size: 17), + subtitle: Obx(() => Text( + '当前主题:${colorSelectController.type.value == 0 ? '动态取色': '指定颜色'}', + style: subTitleStyle)), ), ListTile( dense: false, onTap: () => Get.toNamed('/fontSizeSetting'), title: Text('字体大小', style: titleStyle), - trailing: const Icon(Icons.arrow_forward_ios, size: 17), ), if (Platform.isAndroid) ListTile( dense: false, onTap: () => Get.toNamed('/displayModeSetting'), title: Text('屏幕帧率', style: titleStyle), - trailing: const Icon(Icons.arrow_forward_ios, size: 17), ) ], ), diff --git a/lib/pages/setting/widgets/select_dialog.dart b/lib/pages/setting/widgets/select_dialog.dart new file mode 100644 index 00000000..dffa4571 --- /dev/null +++ b/lib/pages/setting/widgets/select_dialog.dart @@ -0,0 +1,68 @@ +import 'package:flutter/material.dart'; +import 'package:pilipala/models/common/theme_type.dart'; + +class SelectDialog extends StatefulWidget { + final T value; + final String title; + final List values; + const SelectDialog({super.key, required this.value, required this.values, required this.title}); + + @override + _SelectDialogState createState() => _SelectDialogState(); +} + +class _SelectDialogState extends State> { + + late T _tempValue; + + @override + void initState() { + super.initState(); + _tempValue = widget.value; + } + + @override + Widget build(BuildContext context) { + TextStyle titleStyle = Theme.of(context).textTheme.titleMedium!; + + return AlertDialog( + title: Text(widget.title), + contentPadding: const EdgeInsets.fromLTRB(0, 12, 0, 12), + content: StatefulBuilder( + builder: (context, StateSetter setState) { + return SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + for (var i in widget.values) ...[ + RadioListTile( + value: i['value'], + title: Text(i['title'], style: titleStyle), + groupValue: _tempValue, + onChanged: (value) { + print(value); + setState(() { + _tempValue = value as T; + }); + }, + ), + ] + ], + ), + ); + }), + actions: [ + TextButton( + onPressed: () => Navigator.pop(context), + child: Text( + '取消', + style: TextStyle( + color: Theme.of(context).colorScheme.outline), + )), + TextButton( + onPressed: () => Navigator.pop(context, _tempValue), + child: const Text('确定')) + ], + ); + } +} diff --git a/lib/pages/setting/widgets/switch_item.dart b/lib/pages/setting/widgets/switch_item.dart index 488ade14..d0c2bbf2 100644 --- a/lib/pages/setting/widgets/switch_item.dart +++ b/lib/pages/setting/widgets/switch_item.dart @@ -67,6 +67,7 @@ class _SetSwitchItemState extends State { ? Text(widget.subTitle!, style: subTitleStyle) : null, trailing: Transform.scale( + alignment: Alignment.centerRight, // 缩放Switch的大小后保持右侧对齐, 避免右侧空隙过大 scale: 0.8, child: Switch( thumbIcon: MaterialStateProperty.resolveWith( From 26ba5bc5670841de8d201fbd931243639ac578db Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sat, 16 Dec 2023 20:51:53 +0800 Subject: [PATCH 26/30] mod --- ios/Podfile.lock | 10 +- macos/Flutter/GeneratedPluginRegistrant.swift | 2 +- pubspec.lock | 692 +++++++++--------- 3 files changed, 356 insertions(+), 348 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 7a7e5357..c794b953 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -154,7 +154,7 @@ SPEC CHECKSUMS: audio_session: 4f3e461722055d21515cf3261b64c973c062f345 auto_orientation: 102ed811a5938d52c86520ddd7ecd3a126b5d39d connectivity_plus: 07c49e96d7fc92bc9920617b83238c4d178b446a - device_info_plus: 7545d84d8d1b896cb16a4ff98c19f07ec4b298ea + device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 flutter_volume_controller: e4d5832f08008180f76e30faf671ffd5a425e529 FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a @@ -163,17 +163,17 @@ SPEC CHECKSUMS: media_kit_libs_ios_video: a5fe24bc7875ccd6378a0978c13185e1344651c1 media_kit_native_event_loop: e6b2ab20cf0746eb1c33be961fcf79667304fa2a media_kit_video: 5da63f157170e5bf303bf85453b7ef6971218a2e - package_info_plus: fd030dabf36271f146f1f3beacd48f564b0f17f7 + package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85 path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6 ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 saver_gallery: 2b4e584106fde2407ab51560f3851564963e6b78 screen_brightness_ios: 715ca807df953bf676d339f11464e438143ee625 - share_plus: 599aa54e4ea31d4b4c0e9c911bcc26c55e791028 + share_plus: c3fef564749587fc939ef86ffb283ceac0baf9f5 sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a status_bar_control: 7c84146799e6a076315cc1550f78ef53aae3e446 system_proxy: bec1a5c5af67dd3e3ebf43979400a8756c04cc44 - url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4 + url_launcher_ios: bf5ce03e0e2088bad9cc378ea97fa0ed5b49673b volume_controller: 531ddf792994285c9b17f9d8a7e4dcdd29b3eae9 wakelock_plus: 8b09852c8876491e4b6d179e17dfe2a0b5f60d47 webview_cookie_manager: eaf920722b493bd0f7611b5484771ca53fed03f7 @@ -181,4 +181,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: cc1f88378b4bfcf93a6ce00d2c587857c6008d3b -COCOAPODS: 1.12.1 +COCOAPODS: 1.14.3 diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 2ffc8b8e..3e5f82f7 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -30,7 +30,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FlutterVolumeControllerPlugin.register(with: registry.registrar(forPlugin: "FlutterVolumeControllerPlugin")) MediaKitLibsMacosVideoPlugin.register(with: registry.registrar(forPlugin: "MediaKitLibsMacosVideoPlugin")) MediaKitVideoPlugin.register(with: registry.registrar(forPlugin: "MediaKitVideoPlugin")) - FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) + FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) ScreenBrightnessMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenBrightnessMacosPlugin")) SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) diff --git a/pubspec.lock b/pubspec.lock index 763d23c7..8c373d79 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,48 +5,48 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a - url: "https://pub.dev" + sha256: eb376e9acf6938204f90eb3b1f00b578640d3188b4c8a8ec054f9f479af8d051 + url: "https://pub.flutter-io.cn" source: hosted - version: "61.0.0" + version: "64.0.0" analyzer: dependency: transitive description: name: analyzer - sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 - url: "https://pub.dev" + sha256: "69f54f967773f6c26c7dcb13e93d7ccee8b17a641689da39e878d5cf13b06893" + url: "https://pub.flutter-io.cn" source: hosted - version: "5.13.0" + version: "6.2.0" animations: dependency: "direct main" description: name: animations - sha256: ef57563eed3620bd5d75ad96189846aca1e033c0c45fc9a7d26e80ab02b88a70 - url: "https://pub.dev" + sha256: "708e4b68c23228c264b038fe7003a2f5d01ce85fc64d8cae090e86b27fcea6c5" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.8" + version: "2.0.10" appscheme: dependency: "direct main" description: name: appscheme sha256: b885b65219f3839ebafc937024a1bc5ce5a75b0e458fd249ef15e80e81235b6f - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.8" archive: dependency: transitive description: name: archive - sha256: "0c8368c9b3f0abbc193b9d6133649a614204b528982bebc7026372d61677ce3a" - url: "https://pub.dev" + sha256: "7b875fd4a20b165a3084bd2d210439b22ebc653f21cea4842729c0c30c82596b" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.3.7" + version: "3.4.9" args: dependency: transitive description: name: args sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.4.2" asn1lib: @@ -54,7 +54,7 @@ packages: description: name: asn1lib sha256: "21afe4333076c02877d14f4a89df111e658a6d466cbfc802eb705eb91bd5adfd" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.5.0" async: @@ -62,7 +62,7 @@ packages: description: name: async sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.11.0" audio_service: @@ -70,7 +70,7 @@ packages: description: name: audio_service sha256: a4d989f1225ea9621898d60f23236dcbfc04876fa316086c23c5c4af075dbac4 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.18.12" audio_service_platform_interface: @@ -78,7 +78,7 @@ packages: description: name: audio_service_platform_interface sha256: "8431a455dac9916cc9ee6f7da5620a666436345c906ad2ebb7fa41d18b3c1bf4" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.1.1" audio_service_web: @@ -86,23 +86,23 @@ packages: description: name: audio_service_web sha256: "523e64ddc914c714d53eec2da85bba1074f08cf26c786d4efb322de510815ea7" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.1.1" audio_session: dependency: "direct main" description: name: audio_session - sha256: "8a2bc5e30520e18f3fb0e366793d78057fb64cd5287862c76af0c8771f2a52ad" - url: "https://pub.dev" + sha256: "6fdf255ed3af86535c96452c33ecff1245990bb25a605bfb1958661ccc3d467f" + url: "https://pub.flutter-io.cn" source: hosted - version: "0.1.16" + version: "0.1.18" audio_video_progress_bar: dependency: "direct main" description: name: audio_video_progress_bar sha256: "3384875247cdbea748bd9ae8330631cd06a6cabfcda4945d45c9b406da92bc66" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" auto_orientation: @@ -110,7 +110,7 @@ packages: description: name: auto_orientation sha256: cd56bb59b36fa54cc28ee254bc600524f022a4862f31d5ab20abd7bb1c54e678 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.1" boolean_selector: @@ -118,7 +118,7 @@ packages: description: name: boolean_selector sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" build: @@ -126,7 +126,7 @@ packages: description: name: build sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.4.1" build_config: @@ -134,63 +134,63 @@ packages: description: name: build_config sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.1" build_daemon: dependency: transitive description: name: build_daemon - sha256: "5f02d73eb2ba16483e693f80bee4f088563a820e47d1027d4cdfe62b5bb43e65" - url: "https://pub.dev" + sha256: "0343061a33da9c5810b2d6cee51945127d8f4c060b7fbdd9d54917f0a3feaaa1" + url: "https://pub.flutter-io.cn" source: hosted - version: "4.0.0" + version: "4.0.1" build_resolvers: dependency: transitive description: name: build_resolvers - sha256: "6c4dd11d05d056e76320b828a1db0fc01ccd376922526f8e9d6c796a5adbac20" - url: "https://pub.dev" + sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.2.1" + version: "2.4.2" build_runner: dependency: "direct dev" description: name: build_runner - sha256: "10c6bcdbf9d049a0b666702cf1cee4ddfdc38f02a19d35ae392863b47519848b" - url: "https://pub.dev" + sha256: "67d591d602906ef9201caf93452495ad1812bea2074f04e25dbd7c133785821b" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.4.6" + version: "2.4.7" build_runner_core: dependency: transitive description: name: build_runner_core - sha256: "6d6ee4276b1c5f34f21fdf39425202712d2be82019983d52f351c94aafbc2c41" - url: "https://pub.dev" + sha256: c9e32d21dd6626b5c163d48b037ce906bbe428bc23ab77bcd77bb21e593b6185 + url: "https://pub.flutter-io.cn" source: hosted - version: "7.2.10" + version: "7.2.11" built_collection: dependency: transitive description: name: built_collection sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "5.1.1" built_value: dependency: transitive description: name: built_value - sha256: "598a2a682e2a7a90f08ba39c0aaa9374c5112340f0a2e275f61b59389543d166" - url: "https://pub.dev" + sha256: c9aabae0718ec394e5bc3c7272e6bb0dc0b32201a08fe185ec1d8401d3e39309 + url: "https://pub.flutter-io.cn" source: hosted - version: "8.6.1" + version: "8.8.1" cached_network_image: dependency: "direct main" description: name: cached_network_image sha256: f98972704692ba679db144261172a8e20feb145636c617af0eb4022132a6797f - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.3.0" cached_network_image_platform_interface: @@ -198,7 +198,7 @@ packages: description: name: cached_network_image_platform_interface sha256: "56aa42a7a01e3c9db8456d9f3f999931f1e05535b5a424271e9a38cabf066613" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" cached_network_image_web: @@ -206,7 +206,7 @@ packages: description: name: cached_network_image_web sha256: "759b9a9f8f6ccbb66c185df805fac107f05730b1dab9c64626d1008cca532257" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" characters: @@ -214,7 +214,7 @@ packages: description: name: characters sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.0" checked_yaml: @@ -222,55 +222,55 @@ packages: description: name: checked_yaml sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.3" cli_util: dependency: transitive description: name: cli_util - sha256: b8db3080e59b2503ca9e7922c3df2072cf13992354d5e944074ffa836fba43b7 - url: "https://pub.dev" + sha256: c05b7406fdabc7a49a3929d4af76bcaccbbffcbcdcf185b082e1ae07da323d19 + url: "https://pub.flutter-io.cn" source: hosted - version: "0.4.0" + version: "0.4.1" clock: dependency: transitive description: name: clock sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.1" code_builder: dependency: transitive description: name: code_builder - sha256: "4ad01d6e56db961d29661561effde45e519939fdaeb46c351275b182eac70189" - url: "https://pub.dev" + sha256: feee43a5c05e7b3199bb375a86430b8ada1b04104f2923d0e03cc01ca87b6d84 + url: "https://pub.flutter-io.cn" source: hosted - version: "4.5.0" + version: "4.9.0" collection: dependency: transitive description: name: collection sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.18.0" connectivity_plus: dependency: "direct main" description: name: connectivity_plus - sha256: "8599ae9edca5ff96163fca3e36f8e481ea917d1e71cdad912c084b5579913f34" - url: "https://pub.dev" + sha256: "77a180d6938f78ca7d2382d2240eb626c0f6a735d0bfdce227d8ffb80f95c48b" + url: "https://pub.flutter-io.cn" source: hosted - version: "4.0.1" + version: "4.0.2" connectivity_plus_platform_interface: dependency: transitive description: name: connectivity_plus_platform_interface sha256: cf1d1c28f4416f8c654d7dc3cd638ec586076255d407cef3ddbdaf178272a71a - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.4" convert: @@ -278,7 +278,7 @@ packages: description: name: convert sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.1" cookie_jar: @@ -286,23 +286,23 @@ packages: description: name: cookie_jar sha256: a6ac027d3ed6ed756bfce8f3ff60cb479e266f3b0fdabd6242b804b6765e52de - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.8" cross_file: dependency: transitive description: name: cross_file - sha256: "0b0036e8cccbfbe0555fd83c1d31a6f30b77a96b598b35a5d36dd41f718695e9" - url: "https://pub.dev" + sha256: fedaadfa3a6996f75211d835aaeb8fede285dae94262485698afd832371b9a5e + url: "https://pub.flutter-io.cn" source: hosted - version: "0.3.3+4" + version: "0.3.3+8" crypto: dependency: "direct main" description: name: crypto sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.3" csslib: @@ -310,87 +310,87 @@ packages: description: name: csslib sha256: "831883fb353c8bdc1d71979e5b342c7d88acfbc643113c14ae51e2442ea0f20f" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.17.3" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be - url: "https://pub.dev" + sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d + url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.5" + version: "1.0.6" custom_sliding_segmented_control: dependency: "direct main" description: name: custom_sliding_segmented_control - sha256: a12d1908bb3fe06aabd4becd7def608cdd77b01b7a9f79e37d9414b478523a34 - url: "https://pub.dev" + sha256: "05b73fa48d57218bfdf806bad68a859812b216cd81fe81c6cbefde89f39eb257" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.7.5" + version: "1.8.1" dart_style: dependency: transitive description: name: dart_style - sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55" - url: "https://pub.dev" + sha256: "40ae61a5d43feea6d24bd22c0537a6629db858963b99b4bc1c3db80676f32368" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.3.2" + version: "2.3.4" dbus: dependency: transitive description: name: dbus - sha256: "6f07cba3f7b3448d42d015bfd3d53fe12e5b36da2423f23838efc1d5fb31a263" - url: "https://pub.dev" + sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac" + url: "https://pub.flutter-io.cn" source: hosted - version: "0.7.8" + version: "0.7.10" device_info_plus: dependency: "direct main" description: name: device_info_plus - sha256: "2c35b6d1682b028e42d07b3aee4b98fa62996c10bc12cb651ec856a80d6a761b" - url: "https://pub.dev" + sha256: "0042cb3b2a76413ea5f8a2b40cec2a33e01d0c937e91f0f7c211fde4f7739ba6" + url: "https://pub.flutter-io.cn" source: hosted - version: "9.0.2" + version: "9.1.1" device_info_plus_platform_interface: dependency: transitive description: name: device_info_plus_platform_interface sha256: d3b01d5868b50ae571cd1dc6e502fc94d956b665756180f7b16ead09e836fd64 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "7.0.0" dio: dependency: "direct main" description: name: dio - sha256: "417e2a6f9d83ab396ec38ff4ea5da6c254da71e4db765ad737a42af6930140b7" - url: "https://pub.dev" + sha256: "797e1e341c3dd2f69f2dad42564a6feff3bfb87187d05abb93b9609e6f1645c3" + url: "https://pub.flutter-io.cn" source: hosted - version: "5.3.3" + version: "5.4.0" dio_cookie_manager: dependency: "direct main" description: name: dio_cookie_manager sha256: e79498b0f632897ff0c28d6e8178b4bc6e9087412401f618c31fa0904ace050d - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.1" dio_http2_adapter: dependency: "direct main" description: name: dio_http2_adapter - sha256: "3d81128cf389649ae6ac5cce23bcf5f9b254882b7f27185ca3b0d443ee9b825c" - url: "https://pub.dev" + sha256: "3bb35e81eb8a688eb1cb15beb97f46823698b44037e7b55227aa1060f5593adc" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.3.1+1" + version: "2.4.0" dismissible_page: dependency: "direct main" description: name: dismissible_page sha256: "5b2316f770fe83583f770df1f6505cb19102081c5971979806e77f2e507a9958" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.2" dynamic_color: @@ -398,7 +398,7 @@ packages: description: name: dynamic_color sha256: "8b8bd1d798bd393e11eddeaa8ae95b12ff028bf7d5998fc5d003488cd5f4ce2f" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.6.8" easy_debounce: @@ -406,7 +406,7 @@ packages: description: name: easy_debounce sha256: f082609cfb8f37defb9e37fc28bc978c6712dedf08d4c5a26f820fa10165a236 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.3" encrypt: @@ -414,7 +414,7 @@ packages: description: name: encrypt sha256: "62d9aa4670cc2a8798bab89b39fc71b6dfbacf615de6cf5001fb39f7e4a996a2" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "5.0.3" extended_image: @@ -422,7 +422,7 @@ packages: description: name: extended_image sha256: d7f091d068fcac7246c4b22a84b8dac59a62e04d29a5c172710c696e67a22f94 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "8.2.0" extended_image_library: @@ -430,23 +430,23 @@ packages: description: name: extended_image_library sha256: "9b55fc5ebc65fad984de66b8f177a1bef2a84d79203c9c213f75ff83c2c29edd" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.1" extended_list: dependency: transitive description: name: extended_list - sha256: "7eb3c21cd8b7710b0092cb0606807cd24614e5832e65f370e5dee226d317de44" - url: "https://pub.dev" + sha256: b27a2f0f55dadbf5b273bdaaf9307a7e0098a9fc0c4b8eb60ae98c319af596bc + url: "https://pub.flutter-io.cn" source: hosted - version: "3.0.0" + version: "3.0.1" extended_list_library: dependency: transitive description: name: extended_list_library sha256: cb424a04464e89bd6737f9ae025029bd8e913c7bf37101ad10c2defe0238d842 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" extended_nested_scroll_view: @@ -454,7 +454,7 @@ packages: description: name: extended_nested_scroll_view sha256: "444a6f883e6e07effc7639e69a309e1fb491b6c19b095e9281714a51ace2b384" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "6.1.2" fake_async: @@ -462,31 +462,31 @@ packages: description: name: fake_async sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.1" ffi: dependency: transitive description: name: ffi - sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99 - url: "https://pub.dev" + sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.2" + version: "2.1.0" file: dependency: transitive description: name: file - sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" - url: "https://pub.dev" + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.flutter-io.cn" source: hosted - version: "6.1.4" + version: "7.0.0" fixnum: dependency: transitive description: name: fixnum sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" floating: @@ -494,7 +494,7 @@ packages: description: name: floating sha256: d9d563089e34fbd714ffdcdd2df447ec41b40c9226dacae6b4f78847aef8b991 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" flutter: @@ -507,7 +507,7 @@ packages: description: name: flutter_cache_manager sha256: "8207f27539deb83732fdda03e259349046a39a4c767269285f449ade355d54ba" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.3.1" flutter_displaymode: @@ -515,7 +515,7 @@ packages: description: name: flutter_displaymode sha256: "42c5e9abd13d28ed74f701b60529d7f8416947e58256e6659c5550db719c57ef" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.6.0" flutter_html: @@ -523,7 +523,7 @@ packages: description: name: flutter_html sha256: "02ad69e813ecfc0728a455e4bf892b9379983e050722b1dce00192ee2e41d1ee" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0-beta.2" flutter_launcher_icons: @@ -531,17 +531,17 @@ packages: description: name: flutter_launcher_icons sha256: "526faf84284b86a4cb36d20a5e45147747b7563d921373d4ee0559c54fcdbcea" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.13.1" flutter_lints: dependency: "direct dev" description: name: flutter_lints - sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" - url: "https://pub.dev" + sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 + url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.2" + version: "2.0.3" flutter_localizations: dependency: "direct main" description: flutter @@ -552,25 +552,25 @@ packages: description: name: flutter_plugin_android_lifecycle sha256: b068ffc46f82a55844acfa4fdbb61fad72fa2aef0905548419d97f0f95c456da - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.17" flutter_smart_dialog: dependency: "direct main" description: name: flutter_smart_dialog - sha256: "8ffa51d55591227dbfe9fc2b1ff396b37bec7d09c241d875b9b932db99d2d5ea" - url: "https://pub.dev" + sha256: a666d56e3348aae0a85cf3d19c1b5b18799f39e0568023f991aacd83d5d7c441 + url: "https://pub.flutter-io.cn" source: hosted - version: "4.9.4" + version: "4.9.5+1" flutter_svg: dependency: "direct main" description: name: flutter_svg - sha256: "8c5d68a82add3ca76d792f058b186a0599414f279f00ece4830b9b231b570338" - url: "https://pub.dev" + sha256: d39e7f95621fc84376bc0f7d504f05c3a41488c562f4a8ad410569127507402c + url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.7" + version: "2.0.9" flutter_test: dependency: "direct dev" description: flutter @@ -581,7 +581,7 @@ packages: description: name: flutter_volume_controller sha256: "0f10cc759499cb6c3e152a8f6ff8e5ce385b99db7e1f586d1a29d8e6c11f4082" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.1" flutter_web_plugins: @@ -593,32 +593,32 @@ packages: dependency: "direct main" description: name: font_awesome_flutter - sha256: "5fb789145cae1f4c3245c58b3f8fb287d055c26323879eab57a7bf0cfd1e45f3" - url: "https://pub.dev" + sha256: "52671aea66da73b58d42ec6d0912b727a42248dd9a7c76d6c20f275783c48c08" + url: "https://pub.flutter-io.cn" source: hosted - version: "10.5.0" + version: "10.6.0" frontend_server_client: dependency: transitive description: name: frontend_server_client sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.2.0" get: dependency: "direct main" description: name: get - sha256: "2ba20a47c8f1f233bed775ba2dd0d3ac97b4cf32fc17731b3dfc672b06b0e92a" - url: "https://pub.dev" + sha256: e4e7335ede17452b391ed3b2ede016545706c01a02292a6c97619705e7d2a85e + url: "https://pub.flutter-io.cn" source: hosted - version: "4.6.5" + version: "4.6.6" glob: dependency: transitive description: name: glob sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.2" graphs: @@ -626,7 +626,7 @@ packages: description: name: graphs sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.1" gt3_flutter_plugin: @@ -634,7 +634,7 @@ packages: description: name: gt3_flutter_plugin sha256: f12bff2bfbcf27467833f8d564dcc24ee2f1b3254a7c7cf5eb2c4590baf11cc1 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.0.8" hive: @@ -642,7 +642,7 @@ packages: description: name: hive sha256: "8dcf6db979d7933da8217edcec84e9df1bdb4e4edc7fc77dbd5aa74356d6d941" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.3" hive_flutter: @@ -650,39 +650,39 @@ packages: description: name: hive_flutter sha256: dca1da446b1d808a51689fb5d0c6c9510c0a2ba01e22805d492c73b68e33eecc - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" hive_generator: dependency: "direct dev" description: name: hive_generator - sha256: "65998cc4d2cd9680a3d9709d893d2f6bb15e6c1f92626c3f1fa650b4b3281521" - url: "https://pub.dev" + sha256: "06cb8f58ace74de61f63500564931f9505368f45f98958bd7a6c35ba24159db4" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.0" + version: "2.0.1" html: dependency: "direct main" description: name: html sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.15.4" http: dependency: transitive description: name: http - sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" - url: "https://pub.dev" + sha256: d4872660c46d929f6b8a9ef4e7a7eff7e49bbf0c4ec3f385ee32df5119175139 + url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.0" + version: "1.1.2" http2: dependency: transitive description: name: http2 sha256: "38db0c4aa9f1cd238a5d2e86aa0cc7cc91c77e0c6c94ba64bbe85e4ff732a952" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.0" http_client_helper: @@ -690,7 +690,7 @@ packages: description: name: http_client_helper sha256: "8a9127650734da86b5c73760de2b404494c968a3fd55602045ffec789dac3cb1" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" http_multi_server: @@ -698,7 +698,7 @@ packages: description: name: http_multi_server sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.2.1" http_parser: @@ -706,23 +706,23 @@ packages: description: name: http_parser sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.2" image: dependency: transitive description: name: image - sha256: a72242c9a0ffb65d03de1b7113bc4e189686fc07c7147b8b41811d0dd0e0d9bf - url: "https://pub.dev" + sha256: "028f61960d56f26414eb616b48b04eb37d700cbe477b7fb09bf1d7ce57fd9271" + url: "https://pub.flutter-io.cn" source: hosted - version: "4.0.17" + version: "4.1.3" intl: dependency: transitive description: name: intl sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.18.1" io: @@ -730,7 +730,7 @@ packages: description: name: io sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.4" js: @@ -738,7 +738,7 @@ packages: description: name: js sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.6.7" json_annotation: @@ -746,7 +746,7 @@ packages: description: name: json_annotation sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "4.8.1" lints: @@ -754,7 +754,7 @@ packages: description: name: lints sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" list_counter: @@ -762,7 +762,7 @@ packages: description: name: list_counter sha256: c447ae3dfcd1c55f0152867090e67e219d42fe6d4f2807db4bbe8b8d69912237 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.2" loading_more_list: @@ -770,7 +770,7 @@ packages: description: name: loading_more_list sha256: "6b49eb935345d6cf291e0367d3c238ef0a525a08b671ee41e09ee67d41888a7a" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "6.0.0" loading_more_list_library: @@ -778,7 +778,7 @@ packages: description: name: loading_more_list_library sha256: de6b57edbab83022180f053ec3f598dd5e1192cfd6a285882b8155e3cb5dc581 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" logging: @@ -786,7 +786,7 @@ packages: description: name: logging sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" matcher: @@ -794,7 +794,7 @@ packages: description: name: matcher sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.12.16" material_color_utilities: @@ -802,7 +802,7 @@ packages: description: name: material_color_utilities sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.5.0" media_kit: @@ -810,7 +810,7 @@ packages: description: name: media_kit sha256: "3289062540e3b8b9746e5c50d95bd78a9289826b7227e253dff806d002b9e67a" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.10+1" media_kit_libs_android_video: @@ -818,7 +818,7 @@ packages: description: name: media_kit_libs_android_video sha256: "9dd8012572e4aff47516e55f2597998f0a378e3d588d0fad0ca1f11a53ae090c" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.6" media_kit_libs_ios_video: @@ -826,7 +826,7 @@ packages: description: name: media_kit_libs_ios_video sha256: b5382994eb37a4564c368386c154ad70ba0cc78dacdd3fb0cd9f30db6d837991 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.4" media_kit_libs_linux: @@ -834,7 +834,7 @@ packages: description: name: media_kit_libs_linux sha256: e186891c31daa6bedab4d74dcdb4e8adfccc7d786bfed6ad81fe24a3b3010310 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.3" media_kit_libs_macos_video: @@ -842,7 +842,7 @@ packages: description: name: media_kit_libs_macos_video sha256: f26aa1452b665df288e360393758f84b911f70ffb3878032e1aabba23aa1032d - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.4" media_kit_libs_video: @@ -850,7 +850,7 @@ packages: description: name: media_kit_libs_video sha256: "3688e0c31482074578652bf038ce6301a5d21e1eda6b54fc3117ffeb4bdba067" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.4" media_kit_libs_windows_video: @@ -858,7 +858,7 @@ packages: description: name: media_kit_libs_windows_video sha256: "7bace5f35d9afcc7f9b5cdadb7541d2191a66bb3fc71bfa11c1395b3360f6122" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.9" media_kit_native_event_loop: @@ -866,7 +866,7 @@ packages: description: name: media_kit_native_event_loop sha256: a605cf185499d14d58935b8784955a92a4bf0ff4e19a23de3d17a9106303930e - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.8" media_kit_video: @@ -874,7 +874,7 @@ packages: description: name: media_kit_video sha256: c048d11a19e379aebbe810647636e3fc6d18374637e2ae12def4ff8a4b99a882 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.4" meta: @@ -882,7 +882,7 @@ packages: description: name: meta sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.10.0" mime: @@ -890,7 +890,7 @@ packages: description: name: mime sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.4" nm: @@ -898,7 +898,7 @@ packages: description: name: nm sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.5.0" ns_danmaku: @@ -915,7 +915,7 @@ packages: description: name: octo_image sha256: "45b40f99622f11901238e18d48f5f12ea36426d8eced9f4cbf58479c7aa2430d" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" package_config: @@ -923,23 +923,23 @@ packages: description: name: package_config sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" package_info_plus: dependency: "direct main" description: name: package_info_plus - sha256: "6ff267fcd9d48cb61c8df74a82680e8b82e940231bb5f68356672fde0397334a" - url: "https://pub.dev" + sha256: "7e76fad405b3e4016cd39d08f455a4eb5199723cf594cd1b8916d47140d93017" + url: "https://pub.flutter-io.cn" source: hosted - version: "4.1.0" + version: "4.2.0" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" path: @@ -947,7 +947,7 @@ packages: description: name: path sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.8.3" path_parsing: @@ -955,7 +955,7 @@ packages: description: name: path_parsing sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" path_provider: @@ -963,23 +963,23 @@ packages: description: name: path_provider sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: "6b8b19bd80da4f11ce91b2d1fb931f3006911477cec227cce23d3253d80df3f1" - url: "https://pub.dev" + sha256: e595b98692943b4881b219f0a9e3945118d3c16bd7e2813f98ec6e532d905f72 + url: "https://pub.flutter-io.cn" source: hosted - version: "2.2.0" + version: "2.2.1" path_provider_foundation: dependency: transitive description: name: path_provider_foundation sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.1" path_provider_linux: @@ -987,7 +987,7 @@ packages: description: name: path_provider_linux sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.1" path_provider_platform_interface: @@ -995,7 +995,7 @@ packages: description: name: path_provider_platform_interface sha256: "94b1e0dd80970c1ce43d5d4e050a9918fce4f4a775e6142424c30a29a363265c" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" path_provider_windows: @@ -1003,79 +1003,87 @@ packages: description: name: path_provider_windows sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.1" permission_handler: dependency: "direct main" description: name: permission_handler - sha256: "284a66179cabdf942f838543e10413246f06424d960c92ba95c84439154fcac8" - url: "https://pub.dev" + sha256: "860c6b871c94c78e202dc69546d4d8fd84bd59faeb36f8fb9888668a53ff4f78" + url: "https://pub.flutter-io.cn" source: hosted - version: "11.0.1" + version: "11.1.0" permission_handler_android: dependency: transitive description: name: permission_handler_android - sha256: f9fddd3b46109bd69ff3f9efa5006d2d309b7aec0f3c1c5637a60a2d5659e76e - url: "https://pub.dev" + sha256: "2f1bec180ee2f5665c22faada971a8f024761f632e93ddc23310487df52dcfa6" + url: "https://pub.flutter-io.cn" source: hosted - version: "11.1.0" + version: "12.0.1" permission_handler_apple: dependency: transitive description: name: permission_handler_apple - sha256: "99e220bce3f8877c78e4ace901082fb29fa1b4ebde529ad0932d8d664b34f3f5" - url: "https://pub.dev" + sha256: "1a816084338ada8d574b1cb48390e6e8b19305d5120fe3a37c98825bacc78306" + url: "https://pub.flutter-io.cn" source: hosted - version: "9.1.4" + version: "9.2.0" + permission_handler_html: + dependency: transitive + description: + name: permission_handler_html + sha256: "11b762a8c123dced6461933a88ea1edbbe036078c3f9f41b08886e678e7864df" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.1.0+2" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface - sha256: "6760eb5ef34589224771010805bea6054ad28453906936f843a8cc4d3a55c4a4" - url: "https://pub.dev" + sha256: d87349312f7eaf6ce0adaf668daf700ac5b06af84338bd8b8574dfbd93ffe1a1 + url: "https://pub.flutter-io.cn" source: hosted - version: "3.12.0" + version: "4.0.2" permission_handler_windows: dependency: transitive description: name: permission_handler_windows - sha256: cc074aace208760f1eee6aa4fae766b45d947df85bc831cde77009cdb4720098 - url: "https://pub.dev" + sha256: "1e8640c1e39121128da6b816d236e714d2cf17fac5a105dd6acdd3403a628004" + url: "https://pub.flutter-io.cn" source: hosted - version: "0.1.3" + version: "0.2.0" petitparser: dependency: transitive description: name: petitparser - sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 - url: "https://pub.dev" + sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 + url: "https://pub.flutter-io.cn" source: hosted - version: "5.4.0" + version: "6.0.2" platform: dependency: transitive description: name: platform - sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" - url: "https://pub.dev" + sha256: "0a279f0707af40c890e80b1e9df8bb761694c074ba7e1d4ab1bc4b728e200b59" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.1.0" + version: "3.1.3" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - sha256: "43798d895c929056255600343db8f049921cbec94d31ec87f1dc5c16c01935dd" - url: "https://pub.dev" + sha256: f4f88d4a900933e7267e2b353594774fc0d07fb072b47eedcd5b54e1ea3269f8 + url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.5" + version: "2.1.7" pointycastle: dependency: transitive description: name: pointycastle sha256: "7c1e5f0d23c9016c5bbd8b1473d0d3fb3fc851b876046039509e18e0c7485f2c" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.7.3" pool: @@ -1083,23 +1091,23 @@ packages: description: name: pool sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.5.1" protobuf: dependency: "direct main" description: name: protobuf - sha256: "4034a02b7e231e7e60bff30a8ac13a7347abfdac0798595fae0b90a3f0afe759" - url: "https://pub.dev" + sha256: "68645b24e0716782e58948f8467fd42a880f255096a821f9e7d0ec625b00c84d" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.0.0" + version: "3.1.0" pub_semver: dependency: transitive description: name: pub_semver sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.4" pubspec_parse: @@ -1107,23 +1115,23 @@ packages: description: name: pubspec_parse sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.3" pull_to_refresh_notification: dependency: "direct main" description: name: pull_to_refresh_notification - sha256: "3f27b9695c98770db3f9f50550e5ab44a6d946d022311a55bbe6d5cd4c69a1ad" - url: "https://pub.dev" + sha256: "5a06c242a6c3264bac3a7facbe2c6d317a5f54fc10c20b556dbd34ceee32c9aa" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.0.1" + version: "3.1.0" rxdart: dependency: transitive description: name: rxdart sha256: "0c7c0cedd93788d996e33041ffecda924cc54389199cde4e6a34b440f50044cb" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.27.7" safe_local_storage: @@ -1131,7 +1139,7 @@ packages: description: name: safe_local_storage sha256: ede4eb6cb7d88a116b3d3bf1df70790b9e2038bc37cb19112e381217c74d9440 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.2" saver_gallery: @@ -1139,7 +1147,7 @@ packages: description: name: saver_gallery sha256: "2657953427ebe5a3b2d08157d41587c01923ccce3f1a616d55082be7470f8530" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.1" screen_brightness: @@ -1147,7 +1155,7 @@ packages: description: name: screen_brightness sha256: ed8da4a4511e79422fc1aa88138e920e4008cd312b72cdaa15ccb426c0faaedd - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.2+1" screen_brightness_android: @@ -1155,7 +1163,7 @@ packages: description: name: screen_brightness_android sha256: "3df10961e3a9e968a5e076fe27e7f4741fa8a1d3950bdeb48cf121ed529d0caf" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.1.0+2" screen_brightness_ios: @@ -1163,7 +1171,7 @@ packages: description: name: screen_brightness_ios sha256: "99adc3ca5490b8294284aad5fcc87f061ad685050e03cf45d3d018fe398fd9a2" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.1.0" screen_brightness_macos: @@ -1171,7 +1179,7 @@ packages: description: name: screen_brightness_macos sha256: "64b34e7e3f4900d7687c8e8fb514246845a73ecec05ab53483ed025bd4a899fd" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.1.0+1" screen_brightness_platform_interface: @@ -1179,39 +1187,39 @@ packages: description: name: screen_brightness_platform_interface sha256: b211d07f0c96637a15fb06f6168617e18030d5d74ad03795dd8547a52717c171 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.1.0" screen_brightness_windows: dependency: transitive description: name: screen_brightness_windows - sha256: "80d90ecdc63fc0823f2ecb1be323471619287937e14210650d7b25ca181abd05" - url: "https://pub.dev" + sha256: "9261bf33d0fc2707d8cf16339ce25768100a65e70af0fcabaf032fc12408ba86" + url: "https://pub.flutter-io.cn" source: hosted - version: "0.1.1" + version: "0.1.3" share_plus: dependency: "direct main" description: name: share_plus - sha256: ed3fcea4f789ed95913328e629c0c53e69e80e08b6c24542f1b3576046c614e8 - url: "https://pub.dev" + sha256: f74fc3f1cbd99f39760182e176802f693fa0ec9625c045561cfad54681ea93dd + url: "https://pub.flutter-io.cn" source: hosted - version: "7.0.2" + version: "7.2.1" share_plus_platform_interface: dependency: transitive description: name: share_plus_platform_interface - sha256: "0c6e61471bd71b04a138b8b588fa388e66d8b005e6f2deda63371c5c505a0981" - url: "https://pub.dev" + sha256: df08bc3a07d01f5ea47b45d03ffcba1fa9cd5370fb44b3f38c70e42cced0f956 + url: "https://pub.flutter-io.cn" source: hosted - version: "3.2.1" + version: "3.3.1" shelf: dependency: transitive description: name: shelf sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.4.1" shelf_web_socket: @@ -1219,7 +1227,7 @@ packages: description: name: shelf_web_socket sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.4" sky_engine: @@ -1231,16 +1239,16 @@ packages: dependency: transitive description: name: source_gen - sha256: fc0da689e5302edb6177fdd964efcb7f58912f43c28c2047a808f5bfff643d16 - url: "https://pub.dev" + sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.4.0" + version: "1.5.0" source_helper: dependency: transitive description: name: source_helper sha256: "6adebc0006c37dd63fe05bca0a929b99f06402fc95aa35bf36d67f5c06de01fd" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.4" source_span: @@ -1248,31 +1256,31 @@ packages: description: name: source_span sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.10.0" sqflite: dependency: transitive description: name: sqflite - sha256: b4d6710e1200e96845747e37338ea8a819a12b51689a3bcf31eff0003b37a0b9 - url: "https://pub.dev" + sha256: "591f1602816e9c31377d5f008c2d9ef7b8aca8941c3f89cc5fd9d84da0c38a9a" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.2.8+4" + version: "2.3.0" sqflite_common: dependency: transitive description: name: sqflite_common - sha256: "8f7603f3f8f126740bc55c4ca2d1027aab4b74a1267a3e31ce51fe40e3b65b8f" - url: "https://pub.dev" + sha256: bb4738f15b23352822f4c42a531677e5c6f522e079461fd240ead29d8d8a54a6 + url: "https://pub.flutter-io.cn" source: hosted - version: "2.4.5+1" + version: "2.5.0+2" stack_trace: dependency: transitive description: name: stack_trace sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.11.1" status_bar_control: @@ -1280,7 +1288,7 @@ packages: description: name: status_bar_control sha256: "7f2c1f3f7fd13b85ed284eb7ca3f74ceb8dcfdd25636d3a84186d0a687d36693" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.2.1" stream_channel: @@ -1288,7 +1296,7 @@ packages: description: name: stream_channel sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.2" stream_transform: @@ -1296,7 +1304,7 @@ packages: description: name: stream_transform sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" string_scanner: @@ -1304,7 +1312,7 @@ packages: description: name: string_scanner sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" synchronized: @@ -1312,7 +1320,7 @@ packages: description: name: synchronized sha256: "5fcbd27688af6082f5abd611af56ee575342c30e87541d0245f7ff99faa02c60" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.0" system_proxy: @@ -1320,7 +1328,7 @@ packages: description: name: system_proxy sha256: bbdfc9736a963409941fb0e7c494606c1f13c2be34de15833ee385da83cf7ab0 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.1.0" term_glyph: @@ -1328,7 +1336,7 @@ packages: description: name: term_glyph sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.1" test_api: @@ -1336,7 +1344,7 @@ packages: description: name: test_api sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.6.1" timing: @@ -1344,7 +1352,7 @@ packages: description: name: timing sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" typed_data: @@ -1352,7 +1360,7 @@ packages: description: name: typed_data sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.2" universal_io: @@ -1360,7 +1368,7 @@ packages: description: name: universal_io sha256: "1722b2dcc462b4b2f3ee7d188dad008b6eb4c40bbd03a3de451d82c78bba9aad" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.2" universal_platform: @@ -1368,7 +1376,7 @@ packages: description: name: universal_platform sha256: d315be0f6641898b280ffa34e2ddb14f3d12b1a37882557869646e0cc363d0cc - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0+1" uri_parser: @@ -1376,111 +1384,111 @@ packages: description: name: uri_parser sha256: "6543c9fd86d2862fac55d800a43e67c0dcd1a41677cb69c2f8edfe73bbcf1835" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2" url_launcher: dependency: "direct main" description: name: url_launcher - sha256: "47e208a6711459d813ba18af120d9663c20bdf6985d6ad39fe165d2538378d27" - url: "https://pub.dev" + sha256: e9aa5ea75c84cf46b3db4eea212523591211c3cf2e13099ee4ec147f54201c86 + url: "https://pub.flutter-io.cn" source: hosted - version: "6.1.14" + version: "6.2.2" url_launcher_android: dependency: transitive description: name: url_launcher_android - sha256: "3dd2388cc0c42912eee04434531a26a82512b9cb1827e0214430c9bcbddfe025" - url: "https://pub.dev" + sha256: "31222ffb0063171b526d3e569079cf1f8b294075ba323443fdc690842bfd4def" + url: "https://pub.flutter-io.cn" source: hosted - version: "6.0.38" + version: "6.2.0" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - sha256: "9af7ea73259886b92199f9e42c116072f05ff9bea2dcb339ab935dfc957392c2" - url: "https://pub.dev" + sha256: bba3373219b7abb6b5e0d071b0fe66dfbe005d07517a68e38d4fc3638f35c6d3 + url: "https://pub.flutter-io.cn" source: hosted - version: "6.1.4" + version: "6.2.1" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - sha256: "207f4ddda99b95b4d4868320a352d374b0b7e05eefad95a4a26f57da413443f5" - url: "https://pub.dev" + sha256: ab360eb661f8879369acac07b6bb3ff09d9471155357da8443fd5d3cf7363811 + url: "https://pub.flutter-io.cn" source: hosted - version: "3.0.5" + version: "3.1.1" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - sha256: "1c4fdc0bfea61a70792ce97157e5cc17260f61abbe4f39354513f39ec6fd73b1" - url: "https://pub.dev" + sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234 + url: "https://pub.flutter-io.cn" source: hosted - version: "3.0.6" + version: "3.1.0" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - sha256: bfdfa402f1f3298637d71ca8ecfe840b4696698213d5346e9d12d4ab647ee2ea - url: "https://pub.dev" + sha256: "980e8d9af422f477be6948bdfb68df8433be71f5743a188968b0c1b887807e50" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.3" + version: "2.2.0" url_launcher_web: dependency: transitive description: name: url_launcher_web - sha256: cc26720eefe98c1b71d85f9dc7ef0cada5132617046369d9dc296b3ecaa5cbb4 - url: "https://pub.dev" + sha256: "7286aec002c8feecc338cc33269e96b73955ab227456e9fb2a91f7fab8a358e9" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.18" + version: "2.2.2" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - sha256: "7967065dd2b5fccc18c653b97958fdf839c5478c28e767c61ee879f4e7882422" - url: "https://pub.dev" + sha256: ecf9725510600aa2bb6d7ddabe16357691b6d2805f66216a97d1b881e21beff7 + url: "https://pub.flutter-io.cn" source: hosted - version: "3.0.7" + version: "3.1.1" uuid: dependency: "direct main" description: name: uuid sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.7" vector_graphics: dependency: transitive description: name: vector_graphics - sha256: "670f6e07aca990b4a2bcdc08a784193c4ccdd1932620244c3a86bb72a0eac67f" - url: "https://pub.dev" + sha256: "0f0c746dd2d6254a0057218ff980fc7f5670fd0fcf5e4db38a490d31eed4ad43" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.7" + version: "1.1.9+1" vector_graphics_codec: dependency: transitive description: name: vector_graphics_codec - sha256: "7451721781d967db9933b63f5733b1c4533022c0ba373a01bdd79d1a5457f69f" - url: "https://pub.dev" + sha256: "0edf6d630d1bfd5589114138ed8fada3234deacc37966bec033d3047c29248b7" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.7" + version: "1.1.9+1" vector_graphics_compiler: dependency: transitive description: name: vector_graphics_compiler - sha256: "80a13c613c8bde758b1464a1755a7b3a8f2b6cec61fbf0f5a53c94c30f03ba2e" - url: "https://pub.dev" + sha256: d24333727332d9bd20990f1483af4e09abdb9b1fc7c3db940b56ab5c42790c26 + url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.7" + version: "1.1.9+1" vector_math: dependency: transitive description: name: vector_math sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.4" visibility_detector: @@ -1488,7 +1496,7 @@ packages: description: name: visibility_detector sha256: dd5cc11e13494f432d15939c3aa8ae76844c42b723398643ce9addb88a5ed420 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.4.0+2" volume_controller: @@ -1496,23 +1504,23 @@ packages: description: name: volume_controller sha256: "189bdc7a554f476b412e4c8b2f474562b09d74bc458c23667356bce3ca1d48c9" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.7" wakelock_plus: dependency: "direct main" description: name: wakelock_plus - sha256: aac3f3258f01781ec9212df94eecef1eb9ba9350e106728def405baa096ba413 - url: "https://pub.dev" + sha256: f268ca2116db22e57577fb99d52515a24bdc1d570f12ac18bb762361d43b043d + url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.1" + version: "1.1.4" wakelock_plus_platform_interface: dependency: transitive description: name: wakelock_plus_platform_interface sha256: "40fabed5da06caff0796dc638e1f07ee395fb18801fbff3255a2372db2d80385" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" watcher: @@ -1520,23 +1528,23 @@ packages: description: name: watcher sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" waterfall_flow: dependency: transitive description: name: waterfall_flow - sha256: "84486ac34f51977176990ada50b44d83be24726814fa03c22c1e10e3791cc3f2" - url: "https://pub.dev" + sha256: "11538b0d890458e55e6248b177732495d20893cfc7e85d7e8dbf4fdce61c9f10" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.0.2" + version: "3.0.3" web: dependency: transitive description: name: web sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.3.0" web_socket_channel: @@ -1544,7 +1552,7 @@ packages: description: name: web_socket_channel sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.4.0" webview_cookie_manager: @@ -1552,81 +1560,81 @@ packages: description: name: webview_cookie_manager sha256: "425a9feac5cd2cb62a71da3dda5ac2eaf9ece5481ee8d79f3868dc5ba8223ad3" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.6" webview_flutter: dependency: "direct main" description: name: webview_flutter - sha256: "789d52bd789373cc1e100fb634af2127e86c99cf9abde09499743270c5de8d00" - url: "https://pub.dev" + sha256: "42393b4492e629aa3a88618530a4a00de8bb46e50e7b3993fedbfdc5352f0dbf" + url: "https://pub.flutter-io.cn" source: hosted - version: "4.2.2" + version: "4.4.2" webview_flutter_android: dependency: transitive description: name: webview_flutter_android - sha256: "8587d0b4991bd0f223f4b4957101c2c7449f905601571315f4967072498dd3fb" - url: "https://pub.dev" + sha256: e313dcdf45d4c95bcb8960351ef2389b7f0687b90bc92483f7f7983ae5758456 + url: "https://pub.flutter-io.cn" source: hosted - version: "3.9.1" + version: "3.13.0" webview_flutter_platform_interface: dependency: transitive description: name: webview_flutter_platform_interface - sha256: "564ef378cafc1a0e29f1d76ce175ef517a0a6115875dff7b43fccbef2b0aeb30" - url: "https://pub.dev" + sha256: "68e86162aa8fc646ae859e1585995c096c95fc2476881fa0c4a8d10f56013a5a" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.4.0" + version: "2.8.0" webview_flutter_wkwebview: dependency: transitive description: name: webview_flutter_wkwebview - sha256: "3e36a8f564809cb7c257ff4278502b185e2191349df0ddee98837f91805c74b8" - url: "https://pub.dev" + sha256: accdaaa49a2aca2dc3c3230907988954cdd23fed0a19525d6c9789d380f4dc76 + url: "https://pub.flutter-io.cn" source: hosted - version: "3.7.1" + version: "3.9.4" win32: dependency: transitive description: name: win32 - sha256: dfdf0136e0aa7a1b474ea133e67cb0154a0acd2599c4f3ada3b49d38d38793ee - url: "https://pub.dev" + sha256: b0f37db61ba2f2e9b7a78a1caece0052564d1bc70668156cf3a29d676fe4e574 + url: "https://pub.flutter-io.cn" source: hosted - version: "5.0.5" + version: "5.1.1" win32_registry: dependency: transitive description: name: win32_registry - sha256: e4506d60b7244251bc59df15656a3093501c37fb5af02105a944d73eb95be4c9 - url: "https://pub.dev" + sha256: "41fd8a189940d8696b1b810efb9abcf60827b6cbfab90b0c43e8439e3a39d85a" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.1" + version: "1.1.2" xdg_directories: dependency: transitive description: name: xdg_directories - sha256: e0b1147eec179d3911f1f19b59206448f78195ca1d20514134e10641b7d7fbff - url: "https://pub.dev" + sha256: "589ada45ba9e39405c198fe34eb0f607cddb2108527e658136120892beac46d2" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.1" + version: "1.0.3" xml: dependency: transitive description: name: xml - sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" - url: "https://pub.dev" + sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 + url: "https://pub.flutter-io.cn" source: hosted - version: "6.3.0" + version: "6.5.0" yaml: dependency: transitive description: name: yaml sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.2" sdks: - dart: ">=3.2.0-194.0.dev <4.0.0" + dart: ">=3.2.0 <4.0.0" flutter: ">=3.16.0" From b4b64d9864d4da033b0bc3823eda88ac0059d77f Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sat, 16 Dec 2023 20:57:18 +0800 Subject: [PATCH 27/30] fix: duration null error --- lib/plugin/pl_player/controller.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/plugin/pl_player/controller.dart b/lib/plugin/pl_player/controller.dart index 8f09d0ca..65f3fbca 100644 --- a/lib/plugin/pl_player/controller.dart +++ b/lib/plugin/pl_player/controller.dart @@ -651,7 +651,9 @@ class PlPlayerController { // screenManager.setOverlays(false); /// 临时fix _duration.value丢失 - _duration.value = duration; + if (duration != null) { + _duration.value = duration; + } audioSessionHandler.setActive(true); } From 172ea0fbb6dbfe736c948ba77c10245c19ace060 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sat, 16 Dec 2023 21:02:16 +0800 Subject: [PATCH 28/30] fix: tabbar alignment --- lib/pages/home/view.dart | 1 + lib/pages/searchResult/view.dart | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/pages/home/view.dart b/lib/pages/home/view.dart index 3cdf81c7..a649aaa4 100644 --- a/lib/pages/home/view.dart +++ b/lib/pages/home/view.dart @@ -65,6 +65,7 @@ class _HomePageState extends State dividerColor: Colors.transparent, enableFeedback: true, splashBorderRadius: BorderRadius.circular(10), + tabAlignment: TabAlignment.center, onTap: (value) { feedBack(); if (_homeController.initialIndex == value) { diff --git a/lib/pages/searchResult/view.dart b/lib/pages/searchResult/view.dart index f2efb33a..ceb77190 100644 --- a/lib/pages/searchResult/view.dart +++ b/lib/pages/searchResult/view.dart @@ -82,6 +82,7 @@ class _SearchResultPageState extends State labelStyle: const TextStyle(fontSize: 13), dividerColor: Colors.transparent, unselectedLabelColor: Theme.of(context).colorScheme.outline, + tabAlignment: TabAlignment.start, onTap: (index) { if (index == _searchResultController!.tabIndex) { Get.find( From f135a2beae1bd79a14d2478884f83ce27db63904 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sat, 16 Dec 2023 21:37:05 +0800 Subject: [PATCH 29/30] =?UTF-8?q?fix:=20=E5=A4=96=E8=A7=82=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E8=B6=85=E8=BF=873=E5=88=97=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=88=B7=E6=96=B0=20issues=20#271?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/rcmd/view.dart | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/pages/rcmd/view.dart b/lib/pages/rcmd/view.dart index a0f867f7..1236ea33 100644 --- a/lib/pages/rcmd/view.dart +++ b/lib/pages/rcmd/view.dart @@ -87,6 +87,7 @@ class _RcmdPageState extends State }, child: CustomScrollView( controller: _rcmdController.scrollController, + physics: const AlwaysScrollableScrollPhysics(), slivers: [ SliverPadding( padding: @@ -157,11 +158,10 @@ class _RcmdPageState extends State // crossAxisCount = 1; // } int crossAxisCount = ctr.crossAxisCount.value; - double mainAxisExtent = - (Get.size.width / crossAxisCount / StyleString.aspectRatio) + - (crossAxisCount == 1 - ? 68 - : 86 * MediaQuery.of(context).textScaleFactor); + double mainAxisExtent = (Get.size.width / + crossAxisCount / + StyleString.aspectRatio) + + (crossAxisCount == 1 ? 68 : MediaQuery.textScalerOf(context).scale(86)); return SliverGrid( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( // 行间距 @@ -196,8 +196,8 @@ class _RcmdPageState extends State } class LoadingMore extends StatelessWidget { - dynamic ctr; - LoadingMore({super.key, this.ctr}); + final dynamic ctr; + const LoadingMore({super.key, this.ctr}); @override Widget build(BuildContext context) { From 52ab78f332aaabbe5ddd6971f2cfc0203bf065b3 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sat, 16 Dec 2023 22:35:01 +0800 Subject: [PATCH 30/30] =?UTF-8?q?feat:=20up=E4=B8=BB=E9=A1=B5=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E8=8E=B7=E8=B5=9E=E6=95=B0=20issues=20#160?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/http/api.dart | 1 + lib/http/member.dart | 14 ++++++++++++++ lib/pages/member/controller.dart | 12 +++++++++++- lib/pages/member/widgets/profile.dart | 10 ++++++++-- 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/lib/http/api.dart b/lib/http/api.dart index 04fe0a44..b531fd59 100644 --- a/lib/http/api.dart +++ b/lib/http/api.dart @@ -410,6 +410,7 @@ class Api { static const getMemberSeasonsApi = '/x/polymer/web-space/home/seasons_series'; /// 获赞数 播放数 + /// mid static const getMemberViewApi = '/x/space/upstat'; /// 查询某个专栏 diff --git a/lib/http/member.dart b/lib/http/member.dart index 6854dfc6..20826451 100644 --- a/lib/http/member.dart +++ b/lib/http/member.dart @@ -447,4 +447,18 @@ class MemberHttp { }; } } + + // 获取up播放数、点赞数 + static Future memberView({required int mid}) async { + var res = await Request().get(Api.getMemberViewApi, data: {'mid': mid}); + if (res.data['code'] == 0) { + return {'status': true, 'data': res.data['data']}; + } else { + return { + 'status': false, + 'data': [], + 'msg': res.data['message'], + }; + } + } } diff --git a/lib/pages/member/controller.dart b/lib/pages/member/controller.dart index 49a448f1..14ede4d3 100644 --- a/lib/pages/member/controller.dart +++ b/lib/pages/member/controller.dart @@ -14,7 +14,7 @@ import 'package:share_plus/share_plus.dart'; class MemberController extends GetxController { late int mid; Rx memberInfo = MemberInfoModel().obs; - Map? userStat; + late Map userStat; RxString face = ''.obs; String? heroTag; Box userInfoCache = GStrorage.userInfo; @@ -40,6 +40,7 @@ class MemberController extends GetxController { // 获取用户信息 Future> getInfo() async { await getMemberStat(); + await getMemberView(); var res = await MemberHttp.memberInfo(mid: mid); if (res['status']) { memberInfo.value = res['data']; @@ -57,6 +58,15 @@ class MemberController extends GetxController { return res; } + // 获取用户播放数 获赞数 + Future> getMemberView() async { + var res = await MemberHttp.memberView(mid: mid); + if (res['status']) { + userStat.addAll(res['data']); + } + return res; + } + // 关注/取关up Future actionRelationMod() async { if (userInfo == null) { diff --git a/lib/pages/member/widgets/profile.dart b/lib/pages/member/widgets/profile.dart index a8791631..68d0ff44 100644 --- a/lib/pages/member/widgets/profile.dart +++ b/lib/pages/member/widgets/profile.dart @@ -137,8 +137,14 @@ Widget profile(ctr, {loadingStatus = false}) { ), Column( children: [ - const Text('-', - style: TextStyle(fontWeight: FontWeight.bold)), + Text( + !loadingStatus + ? Utils.numFormat( + ctr.userStat!['likes'], + ) + : '-', + style: const TextStyle( + fontWeight: FontWeight.bold)), Text( '获赞', style: TextStyle(