mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: custom show dyn decorate
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
BIN
assets/fonts/digital_id_num.ttf
Normal file
BIN
assets/fonts/digital_id_num.ttf
Normal file
Binary file not shown.
@@ -1,5 +1,7 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:PiliPlus/utils/storage.dart';
|
||||||
|
|
||||||
class DynamicsDataModel {
|
class DynamicsDataModel {
|
||||||
DynamicsDataModel({
|
DynamicsDataModel({
|
||||||
this.hasMore,
|
this.hasMore,
|
||||||
@@ -126,6 +128,7 @@ class ModuleAuthorModel {
|
|||||||
this.pubTs,
|
this.pubTs,
|
||||||
this.type,
|
this.type,
|
||||||
this.vip,
|
this.vip,
|
||||||
|
this.decorate,
|
||||||
});
|
});
|
||||||
|
|
||||||
String? face;
|
String? face;
|
||||||
@@ -139,6 +142,7 @@ class ModuleAuthorModel {
|
|||||||
int? pubTs;
|
int? pubTs;
|
||||||
String? type;
|
String? type;
|
||||||
Map? vip;
|
Map? vip;
|
||||||
|
Map? decorate;
|
||||||
|
|
||||||
ModuleAuthorModel.fromJson(Map<String, dynamic> json) {
|
ModuleAuthorModel.fromJson(Map<String, dynamic> json) {
|
||||||
face = json['face'];
|
face = json['face'];
|
||||||
@@ -152,7 +156,10 @@ class ModuleAuthorModel {
|
|||||||
pubTs = json['pub_ts'] == 0 ? null : json['pub_ts'];
|
pubTs = json['pub_ts'] == 0 ? null : json['pub_ts'];
|
||||||
type = json['type'];
|
type = json['type'];
|
||||||
vip = json['vip'];
|
vip = json['vip'];
|
||||||
|
if (showDynDecorate) decorate = json['decorate'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool showDynDecorate = GStorage.showDynDecorate;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 单个动态详情 - 动态信息
|
// 单个动态详情 - 动态信息
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
|||||||
AnimationController? _fabAnimationCtr;
|
AnimationController? _fabAnimationCtr;
|
||||||
late StreamController<bool> _titleStreamC; // appBar title
|
late StreamController<bool> _titleStreamC; // appBar title
|
||||||
bool _visibleTitle = false;
|
bool _visibleTitle = false;
|
||||||
String? action;
|
// String? action;
|
||||||
// 回复类型
|
// 回复类型
|
||||||
late int replyType;
|
late int replyType;
|
||||||
bool _isFabVisible = true;
|
bool _isFabVisible = true;
|
||||||
@@ -89,10 +89,10 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
|||||||
// floor 1原创 2转发
|
// floor 1原创 2转发
|
||||||
init();
|
init();
|
||||||
_titleStreamC = StreamController<bool>();
|
_titleStreamC = StreamController<bool>();
|
||||||
if (action == 'comment') {
|
// if (action == 'comment') {
|
||||||
_visibleTitle = true;
|
// _visibleTitle = true;
|
||||||
_titleStreamC.add(true);
|
// _titleStreamC.add(true);
|
||||||
}
|
// }
|
||||||
|
|
||||||
_fabAnimationCtr = AnimationController(
|
_fabAnimationCtr = AnimationController(
|
||||||
vsync: this,
|
vsync: this,
|
||||||
@@ -109,7 +109,7 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
|||||||
// 楼层
|
// 楼层
|
||||||
int floor = args['floor'];
|
int floor = args['floor'];
|
||||||
// 从action栏点击进入
|
// 从action栏点击进入
|
||||||
action = args.containsKey('action') ? args['action'] : null;
|
// action = args.containsKey('action') ? args['action'] : null;
|
||||||
// 评论类型
|
// 评论类型
|
||||||
int commentType = args['item'].basic!['comment_type'] ?? 11;
|
int commentType = args['item'].basic!['comment_type'] ?? 11;
|
||||||
replyType = (commentType == 0) ? 11 : commentType;
|
replyType = (commentType == 0) ? 11 : commentType;
|
||||||
|
|||||||
@@ -126,6 +126,56 @@ class AuthorPanel extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
if (item.modules.moduleAuthor.decorate != null)
|
||||||
|
GestureDetector(
|
||||||
|
onTap: item.modules.moduleAuthor.decorate['jump_url'] != null
|
||||||
|
? () {
|
||||||
|
Get.toNamed(
|
||||||
|
'/webview',
|
||||||
|
parameters: {
|
||||||
|
'url':
|
||||||
|
'${item.modules.moduleAuthor.decorate['jump_url']}'
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
: null,
|
||||||
|
child: Stack(
|
||||||
|
clipBehavior: Clip.none,
|
||||||
|
alignment: Alignment.centerRight,
|
||||||
|
children: [
|
||||||
|
Image.network(
|
||||||
|
height: 32,
|
||||||
|
item.modules.moduleAuthor.decorate['card_url'],
|
||||||
|
),
|
||||||
|
if ((item.modules.moduleAuthor.decorate?['fan']?['num_str']
|
||||||
|
as String?)
|
||||||
|
?.isNotEmpty ==
|
||||||
|
true)
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(right: 32),
|
||||||
|
child: Text(
|
||||||
|
'${item.modules.moduleAuthor.decorate['fan']['num_str']}',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 11,
|
||||||
|
fontFamily: 'digital_id_num',
|
||||||
|
color: (item.modules.moduleAuthor.decorate?['fan']
|
||||||
|
?['color'] as String?)
|
||||||
|
?.startsWith('#') ==
|
||||||
|
true
|
||||||
|
? Color(
|
||||||
|
int.parse(
|
||||||
|
item.modules.moduleAuthor
|
||||||
|
.decorate['fan']['color']
|
||||||
|
.replaceFirst('#', '0xFF'),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 32,
|
width: 32,
|
||||||
height: 32,
|
height: 32,
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import 'package:PiliPlus/models/common/reply_sort_type.dart';
|
|||||||
import 'package:PiliPlus/models/common/super_resolution_type.dart';
|
import 'package:PiliPlus/models/common/super_resolution_type.dart';
|
||||||
import 'package:PiliPlus/models/common/theme_type.dart';
|
import 'package:PiliPlus/models/common/theme_type.dart';
|
||||||
import 'package:PiliPlus/models/common/up_panel_position.dart';
|
import 'package:PiliPlus/models/common/up_panel_position.dart';
|
||||||
|
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||||
import 'package:PiliPlus/models/video/play/CDN.dart';
|
import 'package:PiliPlus/models/video/play/CDN.dart';
|
||||||
import 'package:PiliPlus/models/video/play/quality.dart';
|
import 'package:PiliPlus/models/video/play/quality.dart';
|
||||||
import 'package:PiliPlus/models/video/play/subtitle.dart';
|
import 'package:PiliPlus/models/video/play/subtitle.dart';
|
||||||
@@ -1905,6 +1906,14 @@ List<SettingsModel> get extraSettings => [
|
|||||||
setKey: SettingBoxKey.searchSuggestion,
|
setKey: SettingBoxKey.searchSuggestion,
|
||||||
defaultVal: true,
|
defaultVal: true,
|
||||||
),
|
),
|
||||||
|
SettingsModel(
|
||||||
|
settingsType: SettingsType.sw1tch,
|
||||||
|
title: '展示动态装饰',
|
||||||
|
leading: Icon(MdiIcons.stickerCircleOutline),
|
||||||
|
setKey: SettingBoxKey.showDynDecorate,
|
||||||
|
defaultVal: true,
|
||||||
|
onChanged: (value) => ModuleAuthorModel.showDynDecorate = value,
|
||||||
|
),
|
||||||
SettingsModel(
|
SettingsModel(
|
||||||
settingsType: SettingsType.sw1tch,
|
settingsType: SettingsType.sw1tch,
|
||||||
enableFeedback: true,
|
enableFeedback: true,
|
||||||
|
|||||||
@@ -351,6 +351,9 @@ class GStorage {
|
|||||||
static bool get searchSuggestion =>
|
static bool get searchSuggestion =>
|
||||||
GStorage.setting.get(SettingBoxKey.searchSuggestion, defaultValue: true);
|
GStorage.setting.get(SettingBoxKey.searchSuggestion, defaultValue: true);
|
||||||
|
|
||||||
|
static bool get showDynDecorate =>
|
||||||
|
GStorage.setting.get(SettingBoxKey.showDynDecorate, defaultValue: true);
|
||||||
|
|
||||||
static List<double> get dynamicDetailRatio => List<double>.from(setting
|
static List<double> get dynamicDetailRatio => List<double>.from(setting
|
||||||
.get(SettingBoxKey.dynamicDetailRatio, defaultValue: [60.0, 40.0]));
|
.get(SettingBoxKey.dynamicDetailRatio, defaultValue: [60.0, 40.0]));
|
||||||
|
|
||||||
@@ -577,6 +580,7 @@ class SettingBoxKey {
|
|||||||
preInitPlayer = 'preInitPlayer',
|
preInitPlayer = 'preInitPlayer',
|
||||||
mainTabBarView = 'mainTabBarView',
|
mainTabBarView = 'mainTabBarView',
|
||||||
searchSuggestion = 'searchSuggestion',
|
searchSuggestion = 'searchSuggestion',
|
||||||
|
showDynDecorate = 'showDynDecorate',
|
||||||
|
|
||||||
// Sponsor Block
|
// Sponsor Block
|
||||||
enableSponsorBlock = 'enableSponsorBlock',
|
enableSponsorBlock = 'enableSponsorBlock',
|
||||||
|
|||||||
@@ -262,10 +262,10 @@ flutter:
|
|||||||
# "family" key with the font family name, and a "fonts" key with a
|
# "family" key with the font family name, and a "fonts" key with a
|
||||||
# list giving the asset and other descriptors for the font. For
|
# list giving the asset and other descriptors for the font. For
|
||||||
# example:
|
# example:
|
||||||
# fonts:
|
fonts:
|
||||||
# - family: fansCard
|
- family: digital_id_num
|
||||||
# fonts:
|
fonts:
|
||||||
# - asset: assets/fonts/fansCard.ttf
|
- asset: assets/fonts/digital_id_num.ttf
|
||||||
# - family: Jura-Bold
|
# - family: Jura-Bold
|
||||||
# fonts:
|
# fonts:
|
||||||
# - asset: assets/fonts/Jura-Bold.ttf
|
# - asset: assets/fonts/Jura-Bold.ttf
|
||||||
|
|||||||
Reference in New Issue
Block a user