From 52ee5b36be43e69ef01a75a304b0deab083a6a00 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sun, 1 Oct 2023 14:28:57 +0800 Subject: [PATCH 1/2] =?UTF-8?q?mod:=20=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=A4=9A=E9=80=89=E9=80=89=E4=B8=AD=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/history/widgets/item.dart | 47 +++++++++++++++-------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/lib/pages/history/widgets/item.dart b/lib/pages/history/widgets/item.dart index 3efbe240..11bd4d23 100644 --- a/lib/pages/history/widgets/item.dart +++ b/lib/pages/history/widgets/item.dart @@ -217,31 +217,32 @@ class HistoryItem extends StatelessWidget { child: SizedBox( width: 34, height: 34, - child: IconButton( - style: ButtonStyle( - padding: MaterialStateProperty.all( - EdgeInsets.zero), - backgroundColor: - MaterialStateProperty.resolveWith( - (states) { - return Colors.white - .withOpacity(0.8); - }, + child: AnimatedScale( + scale: videoItem.checked ? 1 : 0, + duration: + const Duration(milliseconds: 250), + curve: Curves.easeInOut, + child: IconButton( + style: ButtonStyle( + padding: MaterialStateProperty.all( + EdgeInsets.zero), + backgroundColor: + MaterialStateProperty + .resolveWith( + (states) { + return Colors.white + .withOpacity(0.8); + }, + ), ), - ), - onPressed: () { - feedBack(); - onChoose!(); - }, - icon: Icon( - Icons.done_all_outlined, - color: videoItem.checked - ? Theme.of(context) + onPressed: () { + feedBack(); + onChoose!(); + }, + icon: Icon(Icons.done_all_outlined, + color: Theme.of(context) .colorScheme - .primary - : Theme.of(context) - .colorScheme - .outline, + .primary), ), ), ), From 1061ffca3da37759113b3c5e7cd70904b044da60 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sun, 1 Oct 2023 15:53:27 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E5=85=8D=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E8=A7=82=E7=9C=8B1080P=E8=A7=86=E9=A2=91(=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=BC=80=E5=90=AF)=20issues=20#149?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/http/video.dart | 6 ++++++ lib/pages/setting/play_setting.dart | 6 ++++++ lib/utils/storage.dart | 2 ++ 3 files changed, 14 insertions(+) diff --git a/lib/http/video.dart b/lib/http/video.dart index d0ce616c..5ca8a280 100644 --- a/lib/http/video.dart +++ b/lib/http/video.dart @@ -22,6 +22,7 @@ class VideoHttp { static Box setting = GStrorage.setting; static bool enableRcmdDynamic = setting.get(SettingBoxKey.enableRcmdDynamic, defaultValue: true); + static Box userInfoCache = GStrorage.userInfo; // 首页推荐视频 static Future rcmdVideoList({required int ps, required int freshIdx}) async { @@ -133,6 +134,11 @@ class VideoHttp { // 'platform': '', // 'high_quality': '' }; + // 免登录查看1080p + if (userInfoCache.get('userInfoCache') == null && + setting.get(SettingBoxKey.p1080, defaultValue: true)) { + data['try_look'] = 1; + } try { var res = await Request().get(Api.videoUrl, data: data); if (res.data['code'] == 0) { diff --git a/lib/pages/setting/play_setting.dart b/lib/pages/setting/play_setting.dart index ad3a212c..a51bc22a 100644 --- a/lib/pages/setting/play_setting.dart +++ b/lib/pages/setting/play_setting.dart @@ -54,6 +54,12 @@ class _PlaySettingState extends State { ), body: ListView( children: [ + const SetSwitchItem( + title: '开启1080P', + subTitle: '免登录查看1080P视频', + setKey: SettingBoxKey.p1080, + defaultVal: true, + ), const SetSwitchItem( title: '自动播放', subTitle: '进入详情页自动播放', diff --git a/lib/utils/storage.dart b/lib/utils/storage.dart index c8b1d59d..605530b7 100644 --- a/lib/utils/storage.dart +++ b/lib/utils/storage.dart @@ -104,6 +104,8 @@ class SettingBoxKey { static const String enableAutoBrightness = 'enableAutoBrightness'; static const String enableAutoEnter = 'enableAutoEnter'; static const String enableAutoExit = 'enableAutoExit'; + static const String p1080 = 'p1080'; + // youtube 双击快进快退 static const String enableQuickDouble = 'enableQuickDouble'; static const String enableShowDanmaku = 'enableShowDanmaku';