Merge branch 'design' into alpha

This commit is contained in:
guozhigq
2023-10-01 15:53:47 +08:00
4 changed files with 38 additions and 23 deletions

View File

@ -22,6 +22,7 @@ class VideoHttp {
static Box setting = GStrorage.setting; static Box setting = GStrorage.setting;
static bool enableRcmdDynamic = static bool enableRcmdDynamic =
setting.get(SettingBoxKey.enableRcmdDynamic, defaultValue: true); setting.get(SettingBoxKey.enableRcmdDynamic, defaultValue: true);
static Box userInfoCache = GStrorage.userInfo;
// 首页推荐视频 // 首页推荐视频
static Future rcmdVideoList({required int ps, required int freshIdx}) async { static Future rcmdVideoList({required int ps, required int freshIdx}) async {
@ -133,6 +134,11 @@ class VideoHttp {
// 'platform': '', // 'platform': '',
// 'high_quality': '' // 'high_quality': ''
}; };
// 免登录查看1080p
if (userInfoCache.get('userInfoCache') == null &&
setting.get(SettingBoxKey.p1080, defaultValue: true)) {
data['try_look'] = 1;
}
try { try {
var res = await Request().get(Api.videoUrl, data: data); var res = await Request().get(Api.videoUrl, data: data);
if (res.data['code'] == 0) { if (res.data['code'] == 0) {

View File

@ -217,31 +217,32 @@ class HistoryItem extends StatelessWidget {
child: SizedBox( child: SizedBox(
width: 34, width: 34,
height: 34, height: 34,
child: IconButton( child: AnimatedScale(
style: ButtonStyle( scale: videoItem.checked ? 1 : 0,
padding: MaterialStateProperty.all( duration:
EdgeInsets.zero), const Duration(milliseconds: 250),
backgroundColor: curve: Curves.easeInOut,
MaterialStateProperty.resolveWith( child: IconButton(
(states) { style: ButtonStyle(
return Colors.white padding: MaterialStateProperty.all(
.withOpacity(0.8); EdgeInsets.zero),
}, backgroundColor:
MaterialStateProperty
.resolveWith(
(states) {
return Colors.white
.withOpacity(0.8);
},
),
), ),
), onPressed: () {
onPressed: () { feedBack();
feedBack(); onChoose!();
onChoose!(); },
}, icon: Icon(Icons.done_all_outlined,
icon: Icon( color: Theme.of(context)
Icons.done_all_outlined,
color: videoItem.checked
? Theme.of(context)
.colorScheme .colorScheme
.primary .primary),
: Theme.of(context)
.colorScheme
.outline,
), ),
), ),
), ),

View File

@ -54,6 +54,12 @@ class _PlaySettingState extends State<PlaySetting> {
), ),
body: ListView( body: ListView(
children: [ children: [
const SetSwitchItem(
title: '开启1080P',
subTitle: '免登录查看1080P视频',
setKey: SettingBoxKey.p1080,
defaultVal: true,
),
const SetSwitchItem( const SetSwitchItem(
title: '自动播放', title: '自动播放',
subTitle: '进入详情页自动播放', subTitle: '进入详情页自动播放',

View File

@ -104,6 +104,8 @@ class SettingBoxKey {
static const String enableAutoBrightness = 'enableAutoBrightness'; static const String enableAutoBrightness = 'enableAutoBrightness';
static const String enableAutoEnter = 'enableAutoEnter'; static const String enableAutoEnter = 'enableAutoEnter';
static const String enableAutoExit = 'enableAutoExit'; static const String enableAutoExit = 'enableAutoExit';
static const String p1080 = 'p1080';
// youtube 双击快进快退 // youtube 双击快进快退
static const String enableQuickDouble = 'enableQuickDouble'; static const String enableQuickDouble = 'enableQuickDouble';
static const String enableShowDanmaku = 'enableShowDanmaku'; static const String enableShowDanmaku = 'enableShowDanmaku';