Compare commits
33 Commits
v1.0.15.01
...
feature-ca
| Author | SHA1 | Date | |
|---|---|---|---|
| 7a71798055 | |||
| 7c82193f22 | |||
| f5d928e0f3 | |||
| e0aeefa203 | |||
| d75d560d32 | |||
| 7d9edc5f40 | |||
| 5a337fb145 | |||
| 6983c40f5f | |||
| 50a46aa89d | |||
| e79cd2df25 | |||
| cd2b7c62ee | |||
| 483f02c7d2 | |||
| ec58fbc3cc | |||
| e910f5b7e7 | |||
| 6591d35c74 | |||
| 1f6663fa4a | |||
| b1e9cd60cf | |||
| b7389539d8 | |||
| 5d51b235e5 | |||
| bc7aa8c0b2 | |||
| 69b2a76e0b | |||
| 65ab59fa35 | |||
| 6bdc687082 | |||
| 4ca021711e | |||
| b3f418181d | |||
| 10a547d0c2 | |||
| 8d42409691 | |||
| 9ae0e9284b | |||
| 061d6e6091 | |||
| 9c30182480 | |||
| c928037e08 | |||
| 10158a7022 | |||
| f5a9a8ad68 |
@ -65,13 +65,11 @@
|
|||||||
/>
|
/>
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
|
||||||
</intent-filter>
|
|
||||||
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
<action android:name="android.intent.action.SEARCH" />
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
<data android:scheme="bilibili" android:host="forward" />
|
<data android:scheme="bilibili" android:host="forward" />
|
||||||
<data android:scheme="bilibili" android:host="comment"
|
<data android:scheme="bilibili" android:host="comment"
|
||||||
android:pathPattern="/detail/.*/.*/.*" />
|
android:pathPattern="/detail/.*/.*/.*" />
|
||||||
|
|||||||
15
change_log/1.0.16.0102.md
Normal file
15
change_log/1.0.16.0102.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
## 1.0.16
|
||||||
|
|
||||||
|
|
||||||
|
### 功能
|
||||||
|
+ toast 背景支持透明度调节
|
||||||
|
|
||||||
|
### 修复
|
||||||
|
+ web端推荐未展示【已关注】
|
||||||
|
+ up主动态页异常
|
||||||
|
+ 未打开自动播放时,视频详情页异常
|
||||||
|
+ 视频暂停状态取消自动ip
|
||||||
|
|
||||||
|
|
||||||
|
更多更新日志可在Github上查看
|
||||||
|
问题反馈、功能建议请查看「关于」页面。
|
||||||
@ -1,4 +1,8 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hive/hive.dart';
|
||||||
|
import 'package:pilipala/utils/storage.dart';
|
||||||
|
|
||||||
|
Box setting = GStrorage.setting;
|
||||||
|
|
||||||
class CustomToast extends StatelessWidget {
|
class CustomToast extends StatelessWidget {
|
||||||
final String msg;
|
final String msg;
|
||||||
@ -6,12 +10,17 @@ class CustomToast extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
double toastOpacity =
|
||||||
|
setting.get(SettingBoxKey.defaultToastOp, defaultValue: 1.0);
|
||||||
return Container(
|
return Container(
|
||||||
margin:
|
margin:
|
||||||
EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom + 30),
|
EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom + 30),
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 17, vertical: 10),
|
padding: const EdgeInsets.symmetric(horizontal: 17, vertical: 10),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context).colorScheme.primaryContainer,
|
color: Theme.of(context)
|
||||||
|
.colorScheme
|
||||||
|
.primaryContainer
|
||||||
|
.withOpacity(toastOpacity),
|
||||||
borderRadius: BorderRadius.circular(20),
|
borderRadius: BorderRadius.circular(20),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
|
|||||||
@ -266,6 +266,14 @@ class VideoContent extends StatelessWidget {
|
|||||||
fs: 9,
|
fs: 9,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
if (videoItem.isFollowed == 1) ...[
|
||||||
|
const PBadge(
|
||||||
|
text: '已关注',
|
||||||
|
stack: 'normal',
|
||||||
|
size: 'small',
|
||||||
|
type: 'color',
|
||||||
|
)
|
||||||
|
],
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: crossAxisCount == 1 ? 0 : 1,
|
flex: crossAxisCount == 1 ? 0 : 1,
|
||||||
child: Text(
|
child: Text(
|
||||||
|
|||||||
@ -126,6 +126,12 @@ class MyApp extends StatelessWidget {
|
|||||||
? lightColorScheme
|
? lightColorScheme
|
||||||
: darkColorScheme,
|
: darkColorScheme,
|
||||||
useMaterial3: true,
|
useMaterial3: true,
|
||||||
|
snackBarTheme: const SnackBarThemeData(
|
||||||
|
actionTextColor: Colors.white,
|
||||||
|
backgroundColor: Colors.black,
|
||||||
|
contentTextStyle: TextStyle(color: Colors.white),
|
||||||
|
elevation: 20,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
localizationsDelegates: const [
|
localizationsDelegates: const [
|
||||||
GlobalCupertinoLocalizations.delegate,
|
GlobalCupertinoLocalizations.delegate,
|
||||||
|
|||||||
@ -77,14 +77,14 @@ class Stat {
|
|||||||
this.danmu,
|
this.danmu,
|
||||||
});
|
});
|
||||||
@HiveField(0)
|
@HiveField(0)
|
||||||
int? view;
|
String? view;
|
||||||
@HiveField(1)
|
@HiveField(1)
|
||||||
int? like;
|
int? like;
|
||||||
@HiveField(2)
|
@HiveField(2)
|
||||||
int? danmu;
|
int? danmu;
|
||||||
|
|
||||||
Stat.fromJson(Map<String, dynamic> json) {
|
Stat.fromJson(Map<String, dynamic> json) {
|
||||||
view = json["view"];
|
view = Utils.numFormat(json["view"]);
|
||||||
like = json["like"];
|
like = json["like"];
|
||||||
danmu = json['danmaku'];
|
danmu = json['danmaku'];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -87,7 +87,7 @@ class StatAdapter extends TypeAdapter<Stat> {
|
|||||||
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||||
};
|
};
|
||||||
return Stat(
|
return Stat(
|
||||||
view: fields[0] as int?,
|
view: fields[0] as String?,
|
||||||
like: fields[1] as int?,
|
like: fields[1] as int?,
|
||||||
danmu: fields[2] as int?,
|
danmu: fields[2] as int?,
|
||||||
);
|
);
|
||||||
|
|||||||
@ -57,14 +57,6 @@ class AuthorPanel extends StatelessWidget {
|
|||||||
fontSize: Theme.of(context).textTheme.titleSmall!.fontSize,
|
fontSize: Theme.of(context).textTheme.titleSmall!.fontSize,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (item.modules.moduleTag != null) ...[
|
|
||||||
const SizedBox(width: 6),
|
|
||||||
PBadge(
|
|
||||||
bottom: 10,
|
|
||||||
right: 10,
|
|
||||||
text: item.modules.moduleTag['text'],
|
|
||||||
)
|
|
||||||
]
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
DefaultTextStyle.merge(
|
DefaultTextStyle.merge(
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||||
|
import 'package:pilipala/http/search.dart';
|
||||||
|
|
||||||
// 富文本
|
// 富文本
|
||||||
InlineSpan richNode(item, context) {
|
InlineSpan richNode(item, context) {
|
||||||
@ -191,6 +193,39 @@ InlineSpan richNode(item, context) {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
// 投稿
|
||||||
|
if (i.type == 'RICH_TEXT_NODE_TYPE_BV') {
|
||||||
|
spanChilds.add(
|
||||||
|
WidgetSpan(
|
||||||
|
alignment: PlaceholderAlignment.middle,
|
||||||
|
child: Icon(
|
||||||
|
Icons.play_circle_outline_outlined,
|
||||||
|
size: 16,
|
||||||
|
color: Theme.of(context).colorScheme.primary,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
spanChilds.add(
|
||||||
|
WidgetSpan(
|
||||||
|
alignment: PlaceholderAlignment.middle,
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () async {
|
||||||
|
try {
|
||||||
|
int cid = await SearchHttp.ab2c(bvid: i.rid);
|
||||||
|
Get.toNamed('/video?bvid=${i.rid}&cid=$cid',
|
||||||
|
arguments: {'pic': null, 'heroTag': i.rid});
|
||||||
|
} catch (err) {
|
||||||
|
SmartDialog.showToast(err.toString());
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
'${i.text} ',
|
||||||
|
style: authorStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// if (contentType == 'major' &&
|
// if (contentType == 'major' &&
|
||||||
// item.modules.moduleDynamic.major.opus.pics.isNotEmpty) {
|
// item.modules.moduleDynamic.major.opus.pics.isNotEmpty) {
|
||||||
|
|||||||
@ -43,7 +43,7 @@ class _SearchPanelState extends State<SearchPanel>
|
|||||||
keyword: widget.keyword,
|
keyword: widget.keyword,
|
||||||
searchType: widget.searchType,
|
searchType: widget.searchType,
|
||||||
),
|
),
|
||||||
tag: widget.searchType!.type,
|
tag: widget.searchType!.type + widget.keyword!,
|
||||||
);
|
);
|
||||||
scrollController = _searchPanelController.scrollController;
|
scrollController = _searchPanelController.scrollController;
|
||||||
scrollController.addListener(() async {
|
scrollController.addListener(() async {
|
||||||
@ -74,6 +74,7 @@ class _SearchPanelState extends State<SearchPanel>
|
|||||||
future: _futureBuilderFuture,
|
future: _futureBuilderFuture,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (snapshot.connectionState == ConnectionState.done) {
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
|
if (snapshot.data != null) {
|
||||||
Map data = snapshot.data;
|
Map data = snapshot.data;
|
||||||
var ctr = _searchPanelController;
|
var ctr = _searchPanelController;
|
||||||
RxList list = ctr.resultList;
|
RxList list = ctr.resultList;
|
||||||
@ -109,6 +110,17 @@ class _SearchPanelState extends State<SearchPanel>
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return CustomScrollView(
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
|
slivers: [
|
||||||
|
HttpError(
|
||||||
|
errMsg: '没有相关数据',
|
||||||
|
fn: () => setState(() {}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 骨架屏
|
// 骨架屏
|
||||||
return ListView.builder(
|
return ListView.builder(
|
||||||
|
|||||||
@ -15,6 +15,7 @@ class SettingController extends GetxController {
|
|||||||
|
|
||||||
RxBool userLogin = false.obs;
|
RxBool userLogin = false.obs;
|
||||||
RxBool feedBackEnable = false.obs;
|
RxBool feedBackEnable = false.obs;
|
||||||
|
RxDouble toastOpacity = (1.0).obs;
|
||||||
RxInt picQuality = 10.obs;
|
RxInt picQuality = 10.obs;
|
||||||
Rx<ThemeType> themeType = ThemeType.system.obs;
|
Rx<ThemeType> themeType = ThemeType.system.obs;
|
||||||
var userInfo;
|
var userInfo;
|
||||||
@ -26,6 +27,8 @@ class SettingController extends GetxController {
|
|||||||
userLogin.value = userInfo != null;
|
userLogin.value = userInfo != null;
|
||||||
feedBackEnable.value =
|
feedBackEnable.value =
|
||||||
setting.get(SettingBoxKey.feedBackEnable, defaultValue: false);
|
setting.get(SettingBoxKey.feedBackEnable, defaultValue: false);
|
||||||
|
toastOpacity.value =
|
||||||
|
setting.get(SettingBoxKey.defaultToastOp, defaultValue: 1.0);
|
||||||
picQuality.value =
|
picQuality.value =
|
||||||
setting.get(SettingBoxKey.defaultPicQa, defaultValue: 10);
|
setting.get(SettingBoxKey.defaultPicQa, defaultValue: 10);
|
||||||
themeType.value = ThemeType.values[setting.get(SettingBoxKey.themeMode,
|
themeType.value = ThemeType.values[setting.get(SettingBoxKey.themeMode,
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
@ -95,6 +97,7 @@ class _PlaySettingState extends State<PlaySetting> {
|
|||||||
setKey: SettingBoxKey.enableBackgroundPlay,
|
setKey: SettingBoxKey.enableBackgroundPlay,
|
||||||
defaultVal: false,
|
defaultVal: false,
|
||||||
),
|
),
|
||||||
|
if (Platform.isAndroid)
|
||||||
const SetSwitchItem(
|
const SetSwitchItem(
|
||||||
title: '自动PiP播放',
|
title: '自动PiP播放',
|
||||||
subTitle: '进入后台时画中画播放',
|
subTitle: '进入后台时画中画播放',
|
||||||
@ -154,7 +157,10 @@ class _PlaySettingState extends State<PlaySetting> {
|
|||||||
int? result = await showDialog(
|
int? result = await showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return SelectDialog<int>(title: '默认画质', value: defaultVideoQa, values: VideoQuality.values.reversed.map((e) {
|
return SelectDialog<int>(
|
||||||
|
title: '默认画质',
|
||||||
|
value: defaultVideoQa,
|
||||||
|
values: VideoQuality.values.reversed.map((e) {
|
||||||
return {'title': e.description, 'value': e.code};
|
return {'title': e.description, 'value': e.code};
|
||||||
}).toList());
|
}).toList());
|
||||||
},
|
},
|
||||||
@ -177,7 +183,10 @@ class _PlaySettingState extends State<PlaySetting> {
|
|||||||
int? result = await showDialog(
|
int? result = await showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return SelectDialog<int>(title: '默认音质', value: defaultAudioQa, values: AudioQuality.values.reversed.map((e) {
|
return SelectDialog<int>(
|
||||||
|
title: '默认音质',
|
||||||
|
value: defaultAudioQa,
|
||||||
|
values: AudioQuality.values.reversed.map((e) {
|
||||||
return {'title': e.description, 'value': e.code};
|
return {'title': e.description, 'value': e.code};
|
||||||
}).toList());
|
}).toList());
|
||||||
},
|
},
|
||||||
@ -200,7 +209,10 @@ class _PlaySettingState extends State<PlaySetting> {
|
|||||||
String? result = await showDialog(
|
String? result = await showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return SelectDialog<String>(title: '默认解码格式', value: defaultDecode, values: VideoDecodeFormats.values.map((e) {
|
return SelectDialog<String>(
|
||||||
|
title: '默认解码格式',
|
||||||
|
value: defaultDecode,
|
||||||
|
values: VideoDecodeFormats.values.map((e) {
|
||||||
return {'title': e.description, 'value': e.code};
|
return {'title': e.description, 'value': e.code};
|
||||||
}).toList());
|
}).toList());
|
||||||
},
|
},
|
||||||
@ -223,7 +235,10 @@ class _PlaySettingState extends State<PlaySetting> {
|
|||||||
int? result = await showDialog(
|
int? result = await showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return SelectDialog<int>(title: '默认全屏方式', value: defaultFullScreenMode, values: FullScreenMode.values.map((e) {
|
return SelectDialog<int>(
|
||||||
|
title: '默认全屏方式',
|
||||||
|
value: defaultFullScreenMode,
|
||||||
|
values: FullScreenMode.values.map((e) {
|
||||||
return {'title': e.description, 'value': e.code};
|
return {'title': e.description, 'value': e.code};
|
||||||
}).toList());
|
}).toList());
|
||||||
},
|
},
|
||||||
@ -246,7 +261,10 @@ class _PlaySettingState extends State<PlaySetting> {
|
|||||||
int? result = await showDialog(
|
int? result = await showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return SelectDialog<int>(title: '底部进度条展示', value: defaultBtmProgressBehavior, values: BtmProgresBehavior.values.map((e) {
|
return SelectDialog<int>(
|
||||||
|
title: '底部进度条展示',
|
||||||
|
value: defaultBtmProgressBehavior,
|
||||||
|
values: BtmProgresBehavior.values.map((e) {
|
||||||
return {'title': e.description, 'value': e.code};
|
return {'title': e.description, 'value': e.code};
|
||||||
}).toList());
|
}).toList());
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:pilipala/models/common/theme_type.dart';
|
import 'package:pilipala/models/common/theme_type.dart';
|
||||||
import 'package:pilipala/pages/setting/pages/color_select.dart';
|
import 'package:pilipala/pages/setting/pages/color_select.dart';
|
||||||
import 'package:pilipala/pages/setting/widgets/select_dialog.dart';
|
import 'package:pilipala/pages/setting/widgets/select_dialog.dart';
|
||||||
|
import 'package:pilipala/pages/setting/widgets/slide_dialog.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
|
|
||||||
import 'controller.dart';
|
import 'controller.dart';
|
||||||
@ -25,6 +27,7 @@ class _StyleSettingState extends State<StyleSetting> {
|
|||||||
|
|
||||||
Box setting = GStrorage.setting;
|
Box setting = GStrorage.setting;
|
||||||
late int picQuality;
|
late int picQuality;
|
||||||
|
late double toastOpacity;
|
||||||
late ThemeType _tempThemeValue;
|
late ThemeType _tempThemeValue;
|
||||||
late dynamic defaultCustomRows;
|
late dynamic defaultCustomRows;
|
||||||
|
|
||||||
@ -32,6 +35,7 @@ class _StyleSettingState extends State<StyleSetting> {
|
|||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
picQuality = setting.get(SettingBoxKey.defaultPicQa, defaultValue: 10);
|
picQuality = setting.get(SettingBoxKey.defaultPicQa, defaultValue: 10);
|
||||||
|
toastOpacity = setting.get(SettingBoxKey.defaultToastOp, defaultValue: 1.0);
|
||||||
_tempThemeValue = settingController.themeType.value;
|
_tempThemeValue = settingController.themeType.value;
|
||||||
defaultCustomRows = setting.get(SettingBoxKey.customRows, defaultValue: 2);
|
defaultCustomRows = setting.get(SettingBoxKey.customRows, defaultValue: 2);
|
||||||
}
|
}
|
||||||
@ -187,6 +191,30 @@ class _StyleSettingState extends State<StyleSetting> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
ListTile(
|
||||||
|
dense: false,
|
||||||
|
onTap: () async {
|
||||||
|
double? result = await showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return SlideDialog<double>(
|
||||||
|
title: 'Toast不透明度',
|
||||||
|
value: settingController.toastOpacity.value,
|
||||||
|
min: 0.0,
|
||||||
|
max: 1.0,
|
||||||
|
divisions: 10,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
if (result != null) {
|
||||||
|
settingController.toastOpacity.value = result;
|
||||||
|
SmartDialog.showToast('设置成功');
|
||||||
|
setting.put(SettingBoxKey.defaultToastOp, result);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
title: Text('Toast不透明度', style: titleStyle),
|
||||||
|
subtitle: Text('自定义Toast不透明度', style: subTitleStyle),
|
||||||
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
dense: false,
|
dense: false,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
|
|||||||
71
lib/pages/setting/widgets/slide_dialog.dart
Normal file
71
lib/pages/setting/widgets/slide_dialog.dart
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
// import 'package:pilipala/models/common/theme_type.dart';
|
||||||
|
|
||||||
|
class SlideDialog<T extends num> extends StatefulWidget {
|
||||||
|
final T value;
|
||||||
|
final String title;
|
||||||
|
final double min;
|
||||||
|
final double max;
|
||||||
|
final int? divisions;
|
||||||
|
final String? suffix;
|
||||||
|
|
||||||
|
const SlideDialog({
|
||||||
|
super.key,
|
||||||
|
required this.value,
|
||||||
|
required this.title,
|
||||||
|
required this.min,
|
||||||
|
required this.max,
|
||||||
|
this.divisions,
|
||||||
|
this.suffix,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
_SlideDialogState<T> createState() => _SlideDialogState<T>();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _SlideDialogState<T extends num> extends State<SlideDialog<T>> {
|
||||||
|
late double _tempValue;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_tempValue = widget.value.toDouble();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return AlertDialog(
|
||||||
|
title: Text(widget.title),
|
||||||
|
contentPadding:
|
||||||
|
const EdgeInsets.only(top: 20, left: 8, right: 8, bottom: 8),
|
||||||
|
content: SizedBox(
|
||||||
|
height: 40,
|
||||||
|
child: Slider(
|
||||||
|
value: _tempValue,
|
||||||
|
min: widget.min,
|
||||||
|
max: widget.max,
|
||||||
|
divisions: widget.divisions ?? 10,
|
||||||
|
label: '$_tempValue${widget.suffix ?? ''}',
|
||||||
|
onChanged: (double value) {
|
||||||
|
setState(() {
|
||||||
|
_tempValue = value;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.pop(context),
|
||||||
|
child: Text(
|
||||||
|
'取消',
|
||||||
|
style: TextStyle(color: Theme.of(context).colorScheme.outline),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.pop(context, _tempValue as T),
|
||||||
|
child: const Text('确定'),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -412,7 +412,11 @@ class VideoIntroController extends GetxController {
|
|||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => SmartDialog.dismiss(),
|
onPressed: () => SmartDialog.dismiss(),
|
||||||
child: const Text('点错了')),
|
child: Text(
|
||||||
|
'点错了',
|
||||||
|
style: TextStyle(color: Theme.of(context).colorScheme.outline),
|
||||||
|
),
|
||||||
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
var result = await VideoHttp.relationMod(
|
var result = await VideoHttp.relationMod(
|
||||||
|
|||||||
@ -628,9 +628,16 @@ InlineSpan buildContent(
|
|||||||
// 匹配@用户
|
// 匹配@用户
|
||||||
String matchMember = str;
|
String matchMember = str;
|
||||||
if (content.atNameToMid.isNotEmpty) {
|
if (content.atNameToMid.isNotEmpty) {
|
||||||
RegExp reg = RegExp(r"@.*( |:)");
|
List atNameToMidKeys = content.atNameToMid.keys.toList();
|
||||||
if (content.atNameToMid.length == 1 &&
|
RegExp reg = RegExp(atNameToMidKeys.map((key) => key).join('|'));
|
||||||
content.message == '@${content.members.first.uname}') {
|
// if (!content.message.contains(':')) {
|
||||||
|
// reg = RegExp(r"@.*( |:)");
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 只@用户没有内容
|
||||||
|
if (!content.message.contains(':') ||
|
||||||
|
(content.atNameToMid.length == 1 &&
|
||||||
|
content.message == '@${content.members.first.uname}')) {
|
||||||
reg = RegExp(r"@.*( |:|$)");
|
reg = RegExp(r"@.*( |:|$)");
|
||||||
}
|
}
|
||||||
matchMember = str.splitMapJoin(
|
matchMember = str.splitMapJoin(
|
||||||
@ -639,9 +646,20 @@ InlineSpan buildContent(
|
|||||||
if (match[0] != null) {
|
if (match[0] != null) {
|
||||||
hasMatchMember = false;
|
hasMatchMember = false;
|
||||||
content.atNameToMid.forEach((key, value) {
|
content.atNameToMid.forEach((key, value) {
|
||||||
|
if (str.contains('回复')) {
|
||||||
spanChilds.add(
|
spanChilds.add(
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: '@$key ',
|
text: '回复 ',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize:
|
||||||
|
Theme.of(context).textTheme.titleSmall!.fontSize,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
spanChilds.add(
|
||||||
|
TextSpan(
|
||||||
|
text: '@$key',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize:
|
fontSize:
|
||||||
Theme.of(context).textTheme.titleSmall!.fontSize,
|
Theme.of(context).textTheme.titleSmall!.fontSize,
|
||||||
@ -681,6 +699,12 @@ InlineSpan buildContent(
|
|||||||
if (i.contains('?')) {
|
if (i.contains('?')) {
|
||||||
urlKeys[index] = i.replaceAll('?', '\\?');
|
urlKeys[index] = i.replaceAll('?', '\\?');
|
||||||
}
|
}
|
||||||
|
if (i.contains('+')) {
|
||||||
|
urlKeys[index] = i.replaceAll('+', '\\+');
|
||||||
|
}
|
||||||
|
if (i.contains('*')) {
|
||||||
|
urlKeys[index] = i.replaceAll('*', '\\*');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
matchUrl = matchMember.splitMapJoin(
|
matchUrl = matchMember.splitMapJoin(
|
||||||
/// RegExp.escape() 转义特殊字符
|
/// RegExp.escape() 转义特殊字符
|
||||||
|
|||||||
@ -244,7 +244,10 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
void _handleTransition(String name) {
|
void _handleTransition(String name) {
|
||||||
switch (name) {
|
switch (name) {
|
||||||
case 'inactive':
|
case 'inactive':
|
||||||
|
if (plPlayerController != null &&
|
||||||
|
playerStatus == PlayerStatus.playing) {
|
||||||
autoEnterPip();
|
autoEnterPip();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -291,7 +294,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
appBar: PreferredSize(
|
appBar: PreferredSize(
|
||||||
preferredSize: const Size.fromHeight(0),
|
preferredSize: const Size.fromHeight(0),
|
||||||
child: AppBar(
|
child: AppBar(
|
||||||
backgroundColor: Theme.of(context).colorScheme.background,
|
backgroundColor: Colors.transparent,
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -302,7 +305,10 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
return <Widget>[
|
return <Widget>[
|
||||||
Obx(() => SliverAppBar(
|
Obx(() => SliverAppBar(
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
pinned: false,
|
// 假装使用一个非空变量,避免Obx检测不到而罢工
|
||||||
|
pinned: videoDetailController
|
||||||
|
.autoPlay.value ^ false ^ videoDetailController
|
||||||
|
.autoPlay.value,
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
scrolledUnderElevation: 0,
|
scrolledUnderElevation: 0,
|
||||||
forceElevated: innerBoxIsScrolled,
|
forceElevated: innerBoxIsScrolled,
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||||
import 'package:pilipala/utils/utils.dart';
|
import 'package:pilipala/utils/utils.dart';
|
||||||
|
import 'package:pilipala/utils/storage.dart';
|
||||||
|
|
||||||
class ChatItem extends StatelessWidget {
|
class ChatItem extends StatelessWidget {
|
||||||
dynamic item;
|
dynamic item;
|
||||||
@ -14,7 +15,7 @@ class ChatItem extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
bool isOwner = item.senderUid == 17340771;
|
bool isOwner = item.senderUid == GStrorage.userInfo.get('userInfoCache').mid;
|
||||||
bool isPic = item.msgType == 2; // 图片
|
bool isPic = item.msgType == 2; // 图片
|
||||||
bool isText = item.msgType == 1; // 文本
|
bool isText = item.msgType == 1; // 文本
|
||||||
bool isAchive = item.msgType == 11; // 投稿
|
bool isAchive = item.msgType == 11; // 投稿
|
||||||
|
|||||||
@ -3,14 +3,15 @@ enum BtmProgresBehavior {
|
|||||||
alwaysShow,
|
alwaysShow,
|
||||||
alwaysHide,
|
alwaysHide,
|
||||||
onlyShowFullScreen,
|
onlyShowFullScreen,
|
||||||
|
onlyHideFullScreen,
|
||||||
}
|
}
|
||||||
|
|
||||||
extension BtmProgresBehaviorDesc on BtmProgresBehavior {
|
extension BtmProgresBehaviorDesc on BtmProgresBehavior {
|
||||||
String get description => ['始终展示', '始终隐藏', '仅全屏时展示'][index];
|
String get description => ['始终展示', '始终隐藏', '仅全屏时展示', '仅全屏时隐藏'][index];
|
||||||
}
|
}
|
||||||
|
|
||||||
extension BtmProgresBehaviorCode on BtmProgresBehavior {
|
extension BtmProgresBehaviorCode on BtmProgresBehavior {
|
||||||
static final List<int> _codeList = [0, 1, 2];
|
static final List<int> _codeList = [0, 1, 2, 3];
|
||||||
int get code => _codeList[index];
|
int get code => _codeList[index];
|
||||||
|
|
||||||
static BtmProgresBehavior? fromCode(int code) {
|
static BtmProgresBehavior? fromCode(int code) {
|
||||||
|
|||||||
@ -610,6 +610,10 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
BtmProgresBehavior.onlyShowFullScreen.code &&
|
BtmProgresBehavior.onlyShowFullScreen.code &&
|
||||||
!_.isFullScreen.value) {
|
!_.isFullScreen.value) {
|
||||||
return Container();
|
return Container();
|
||||||
|
} else if (defaultBtmProgressBehavior ==
|
||||||
|
BtmProgresBehavior.onlyHideFullScreen.code &&
|
||||||
|
_.isFullScreen.value) {
|
||||||
|
return Container();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_.videoType.value == 'live') {
|
if (_.videoType.value == 'live') {
|
||||||
|
|||||||
@ -12,7 +12,7 @@ class PiliSchame {
|
|||||||
static AppScheme appScheme = AppSchemeImpl.getInstance() as AppScheme;
|
static AppScheme appScheme = AppSchemeImpl.getInstance() as AppScheme;
|
||||||
static void init() async {
|
static void init() async {
|
||||||
///
|
///
|
||||||
SchemeEntity? value = await appScheme.getInitScheme();
|
final SchemeEntity? value = await appScheme.getInitScheme();
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
_routePush(value);
|
_routePush(value);
|
||||||
}
|
}
|
||||||
@ -34,9 +34,9 @@ class PiliSchame {
|
|||||||
|
|
||||||
/// 路由跳转
|
/// 路由跳转
|
||||||
static void _routePush(value) async {
|
static void _routePush(value) async {
|
||||||
String scheme = value.scheme;
|
final String scheme = value.scheme;
|
||||||
String host = value.host;
|
final String host = value.host;
|
||||||
String path = value.path;
|
final String path = value.path;
|
||||||
|
|
||||||
if (scheme == 'bilibili') {
|
if (scheme == 'bilibili') {
|
||||||
// bilibili://root
|
// bilibili://root
|
||||||
@ -55,9 +55,19 @@ class PiliSchame {
|
|||||||
|
|
||||||
// bilibili://video/{aid}
|
// bilibili://video/{aid}
|
||||||
else if (host == 'video') {
|
else if (host == 'video') {
|
||||||
var pathQuery = path.split('/').last;
|
String pathQuery = path.split('/').last;
|
||||||
int aid = int.parse(pathQuery);
|
final numericRegex = RegExp(r'^[0-9]+$');
|
||||||
_videoPush(aid, null);
|
if (numericRegex.hasMatch(pathQuery)) {
|
||||||
|
pathQuery = 'AV$pathQuery';
|
||||||
|
}
|
||||||
|
Map map = IdUtils.matchAvorBv(input: pathQuery);
|
||||||
|
if (map.containsKey('AV')) {
|
||||||
|
_videoPush(map['AV'], null);
|
||||||
|
} else if (map.containsKey('BV')) {
|
||||||
|
_videoPush(null, map['BV']);
|
||||||
|
} else {
|
||||||
|
SmartDialog.showToast('投稿匹配失败');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// bilibili://live/{roomid}
|
// bilibili://live/{roomid}
|
||||||
@ -74,6 +84,22 @@ class PiliSchame {
|
|||||||
_bangumiPush(int.parse(seasonId));
|
_bangumiPush(int.parse(seasonId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 专栏 bilibili://opus/detail/883089655985078289
|
||||||
|
else if (host == 'opus') {
|
||||||
|
if (path.startsWith('/detail')) {
|
||||||
|
var opusId = path.split('/').last;
|
||||||
|
Get.toNamed(
|
||||||
|
'/webview',
|
||||||
|
parameters: {
|
||||||
|
'url': 'https://www.bilibili.com/opus/$opusId',
|
||||||
|
'type': 'url',
|
||||||
|
'pageTitle': '',
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} else if (host == 'search') {
|
||||||
|
Get.toNamed('/searchResult', parameters: {'keyword': ''});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,9 +135,9 @@ class PiliSchame {
|
|||||||
var result = await SearchHttp.bangumiInfo(seasonId: seasonId, epId: null);
|
var result = await SearchHttp.bangumiInfo(seasonId: seasonId, epId: null);
|
||||||
if (result['status']) {
|
if (result['status']) {
|
||||||
var bangumiDetail = result['data'];
|
var bangumiDetail = result['data'];
|
||||||
int cid = bangumiDetail.episodes!.first.cid;
|
final int cid = bangumiDetail.episodes!.first.cid;
|
||||||
String bvid = IdUtils.av2bv(bangumiDetail.episodes!.first.aid);
|
final String bvid = IdUtils.av2bv(bangumiDetail.episodes!.first.aid);
|
||||||
String heroTag = Utils.makeHeroTag(cid);
|
final String heroTag = Utils.makeHeroTag(cid);
|
||||||
var epId = bangumiDetail.episodes!.first.id;
|
var epId = bangumiDetail.episodes!.first.id;
|
||||||
SmartDialog.dismiss().then(
|
SmartDialog.dismiss().then(
|
||||||
(e) => Get.toNamed(
|
(e) => Get.toNamed(
|
||||||
@ -132,9 +158,9 @@ class PiliSchame {
|
|||||||
static void _fullPathPush(value) async {
|
static void _fullPathPush(value) async {
|
||||||
// https://m.bilibili.com/bangumi/play/ss39708
|
// https://m.bilibili.com/bangumi/play/ss39708
|
||||||
// https | m.bilibili.com | /bangumi/play/ss39708
|
// https | m.bilibili.com | /bangumi/play/ss39708
|
||||||
String scheme = value.scheme!;
|
final String scheme = value.scheme!;
|
||||||
String host = value.host!;
|
final String host = value.host!;
|
||||||
String? path = value.path;
|
final String? path = value.path;
|
||||||
// Map<String, String> query = value.query!;
|
// Map<String, String> query = value.query!;
|
||||||
if (host.startsWith('live.bilibili')) {
|
if (host.startsWith('live.bilibili')) {
|
||||||
int roomId = int.parse(path!.split('/').last);
|
int roomId = int.parse(path!.split('/').last);
|
||||||
@ -148,11 +174,11 @@ class PiliSchame {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (path != null) {
|
if (path != null) {
|
||||||
String area = path.split('/')[1];
|
final String area = path.split('/')[1];
|
||||||
switch (area) {
|
switch (area) {
|
||||||
case 'bangumi':
|
case 'bangumi':
|
||||||
// print('番剧');
|
// print('番剧');
|
||||||
String seasonId = path.split('/').last;
|
final String seasonId = path.split('/').last;
|
||||||
_bangumiPush(matchNum(seasonId).first);
|
_bangumiPush(matchNum(seasonId).first);
|
||||||
break;
|
break;
|
||||||
case 'video':
|
case 'video':
|
||||||
@ -177,9 +203,9 @@ class PiliSchame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static List<int> matchNum(String str) {
|
static List<int> matchNum(String str) {
|
||||||
RegExp regExp = RegExp(r'\d+');
|
final RegExp regExp = RegExp(r'\d+');
|
||||||
Iterable<Match> matches = regExp.allMatches(str);
|
final Iterable<Match> matches = regExp.allMatches(str);
|
||||||
|
|
||||||
return matches.map((match) => int.parse(match.group(0)!)).toList();
|
return matches.map((Match match) => int.parse(match.group(0)!)).toList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -66,7 +66,7 @@ class IdUtils {
|
|||||||
result['BV'] = bvs[0].substring(0, 2).toUpperCase() + bvs[0].substring(2);
|
result['BV'] = bvs[0].substring(0, 2).toUpperCase() + bvs[0].substring(2);
|
||||||
}
|
}
|
||||||
if (avs.isNotEmpty) {
|
if (avs.isNotEmpty) {
|
||||||
result['AV'] = avs[0].substring(2);
|
result['AV'] = int.parse(avs[0].substring(2));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -98,6 +98,7 @@ class SettingBoxKey {
|
|||||||
fullScreenMode = 'fullScreenMode',
|
fullScreenMode = 'fullScreenMode',
|
||||||
defaultDecode = 'defaultDecode',
|
defaultDecode = 'defaultDecode',
|
||||||
danmakuEnable = 'danmakuEnable',
|
danmakuEnable = 'danmakuEnable',
|
||||||
|
defaultToastOp = 'defaultToastOp',
|
||||||
defaultPicQa = 'defaultPicQa',
|
defaultPicQa = 'defaultPicQa',
|
||||||
enableHA = 'enableHA',
|
enableHA = 'enableHA',
|
||||||
enableOnlineTotal = 'enableOnlineTotal',
|
enableOnlineTotal = 'enableOnlineTotal',
|
||||||
|
|||||||
@ -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
|
# 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
|
# 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.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 1.0.15
|
version: 1.0.16
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.19.6 <3.0.0"
|
sdk: ">=2.19.6 <3.0.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user