Merge branch 'main' into fix
This commit is contained in:
@ -36,7 +36,6 @@ class NetworkImgLayer extends StatelessWidget {
|
|||||||
final int defaultImgQuality = GlobalData().imgQuality;
|
final int defaultImgQuality = GlobalData().imgQuality;
|
||||||
final String imageUrl =
|
final String imageUrl =
|
||||||
'${src!.startsWith('//') ? 'https:${src!}' : src!}@${quality ?? defaultImgQuality}q.webp';
|
'${src!.startsWith('//') ? 'https:${src!}' : src!}@${quality ?? defaultImgQuality}q.webp';
|
||||||
// print(imageUrl);
|
|
||||||
int? memCacheWidth, memCacheHeight;
|
int? memCacheWidth, memCacheHeight;
|
||||||
double aspectRatio = (width / height).toDouble();
|
double aspectRatio = (width / height).toDouble();
|
||||||
|
|
||||||
|
|||||||
@ -65,6 +65,20 @@ void main() async {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// 小白条、导航栏沉浸
|
||||||
|
if (Platform.isAndroid) {
|
||||||
|
List<String> versionParts = Platform.version.split('.');
|
||||||
|
int androidVersion = int.parse(versionParts[0]);
|
||||||
|
if (androidVersion >= 29) {
|
||||||
|
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
||||||
|
}
|
||||||
|
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
|
||||||
|
systemNavigationBarColor: Colors.transparent,
|
||||||
|
systemNavigationBarDividerColor: Colors.transparent,
|
||||||
|
statusBarColor: Colors.transparent,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
Data.init();
|
Data.init();
|
||||||
GlobalData();
|
GlobalData();
|
||||||
PiliSchame.init();
|
PiliSchame.init();
|
||||||
@ -130,26 +144,33 @@ class MyApp extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
ThemeData themeData = ThemeData(
|
// ThemeData themeData = ThemeData(
|
||||||
colorScheme: currentThemeValue == ThemeType.dark
|
// colorScheme: currentThemeValue == ThemeType.dark
|
||||||
? darkColorScheme
|
// ? darkColorScheme
|
||||||
: lightColorScheme,
|
// : lightColorScheme,
|
||||||
);
|
// );
|
||||||
|
|
||||||
// 小白条、导航栏沉浸
|
// // 小白条、导航栏沉浸
|
||||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
// if (Platform.isAndroid) {
|
||||||
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
|
// List<String> versionParts = Platform.version.split('.');
|
||||||
systemNavigationBarColor: GlobalData().enableMYBar
|
// int androidVersion = int.parse(versionParts[0]);
|
||||||
? const Color(0x00010000)
|
// if (androidVersion >= 29) {
|
||||||
: themeData.canvasColor,
|
// SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
||||||
systemNavigationBarDividerColor: GlobalData().enableMYBar
|
// }
|
||||||
? const Color(0x00010000)
|
// SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
|
||||||
: themeData.canvasColor,
|
// systemNavigationBarColor: GlobalData().enableMYBar
|
||||||
systemNavigationBarIconBrightness: currentThemeValue == ThemeType.dark
|
// ? const Color(0x00010000)
|
||||||
? Brightness.light
|
// : themeData.canvasColor,
|
||||||
: Brightness.dark,
|
// systemNavigationBarDividerColor: GlobalData().enableMYBar
|
||||||
statusBarColor: Colors.transparent,
|
// ? const Color(0x00010000)
|
||||||
));
|
// : themeData.canvasColor,
|
||||||
|
// systemNavigationBarIconBrightness:
|
||||||
|
// currentThemeValue == ThemeType.dark
|
||||||
|
// ? Brightness.light
|
||||||
|
// : Brightness.dark,
|
||||||
|
// statusBarColor: Colors.transparent,
|
||||||
|
// ));
|
||||||
|
// }
|
||||||
|
|
||||||
// 图片缓存
|
// 图片缓存
|
||||||
// PaintingBinding.instance.imageCache.maximumSizeBytes = 1000 << 20;
|
// PaintingBinding.instance.imageCache.maximumSizeBytes = 1000 << 20;
|
||||||
|
|||||||
@ -414,6 +414,7 @@ class DynamicMajorModel {
|
|||||||
this.none,
|
this.none,
|
||||||
this.type,
|
this.type,
|
||||||
this.courses,
|
this.courses,
|
||||||
|
this.common,
|
||||||
});
|
});
|
||||||
|
|
||||||
DynamicArchiveModel? archive;
|
DynamicArchiveModel? archive;
|
||||||
@ -429,6 +430,7 @@ class DynamicMajorModel {
|
|||||||
// MAJOR_TYPE_OPUS 图文/文章
|
// MAJOR_TYPE_OPUS 图文/文章
|
||||||
String? type;
|
String? type;
|
||||||
Map? courses;
|
Map? courses;
|
||||||
|
Map? common;
|
||||||
|
|
||||||
DynamicMajorModel.fromJson(Map<String, dynamic> json) {
|
DynamicMajorModel.fromJson(Map<String, dynamic> json) {
|
||||||
archive = json['archive'] != null
|
archive = json['archive'] != null
|
||||||
@ -452,6 +454,7 @@ class DynamicMajorModel {
|
|||||||
json['none'] != null ? DynamicNoneModel.fromJson(json['none']) : null;
|
json['none'] != null ? DynamicNoneModel.fromJson(json['none']) : null;
|
||||||
type = json['type'];
|
type = json['type'];
|
||||||
courses = json['courses'] ?? {};
|
courses = json['courses'] ?? {};
|
||||||
|
common = json['common'] ?? {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -106,7 +106,7 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 查看二级评论
|
// 查看二级评论
|
||||||
void replyReply(replyItem, currentReply) {
|
void replyReply(replyItem) {
|
||||||
int oid = replyItem.oid;
|
int oid = replyItem.oid;
|
||||||
int rpid = replyItem.rpid!;
|
int rpid = replyItem.rpid!;
|
||||||
Get.to(
|
Get.to(
|
||||||
@ -324,8 +324,8 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
|||||||
replyItem: replyList[index],
|
replyItem: replyList[index],
|
||||||
showReplyRow: true,
|
showReplyRow: true,
|
||||||
replyLevel: '1',
|
replyLevel: '1',
|
||||||
replyReply: (replyItem, currentReply) =>
|
replyReply: (replyItem) =>
|
||||||
replyReply(replyItem, currentReply),
|
replyReply(replyItem),
|
||||||
replyType: ReplyType.values[replyType],
|
replyType: ReplyType.values[replyType],
|
||||||
addReply: (replyItem) {
|
addReply: (replyItem) {
|
||||||
replyList[index]
|
replyList[index]
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||||
import 'package:pilipala/utils/utils.dart';
|
import 'package:pilipala/utils/utils.dart';
|
||||||
|
|
||||||
import 'additional_panel.dart';
|
import 'additional_panel.dart';
|
||||||
@ -182,6 +183,61 @@ Widget forWard(item, context, ctr, source, {floor = 1}) {
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
// 活动
|
||||||
|
case 'DYNAMIC_TYPE_COMMON_SQUARE':
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 8),
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
Get.toNamed('/webview', parameters: {
|
||||||
|
'url': item.modules.moduleDynamic.major.common['jump_url'],
|
||||||
|
'type': 'url',
|
||||||
|
'pageTitle': item.modules.moduleDynamic.major.common['title']
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.only(left: 12, top: 10, right: 12, bottom: 10),
|
||||||
|
color: Theme.of(context).dividerColor.withOpacity(0.08),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
NetworkImgLayer(
|
||||||
|
width: 45,
|
||||||
|
height: 45,
|
||||||
|
src: item.modules.moduleDynamic.major.common['cover'],
|
||||||
|
),
|
||||||
|
const SizedBox(width: 10),
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
item.modules.moduleDynamic.major.common['title'],
|
||||||
|
style: TextStyle(
|
||||||
|
color: Theme.of(context).colorScheme.primary,
|
||||||
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 2),
|
||||||
|
Text(
|
||||||
|
item.modules.moduleDynamic.major.common['desc'],
|
||||||
|
style: TextStyle(
|
||||||
|
color: Theme.of(context).colorScheme.outline,
|
||||||
|
fontSize:
|
||||||
|
Theme.of(context).textTheme.labelMedium!.fontSize,
|
||||||
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
// TextButton(onPressed: () {}, child: Text('123'))
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
default:
|
default:
|
||||||
return const SizedBox(
|
return const SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
|
|||||||
@ -160,7 +160,7 @@ class VideoDetailController extends GetxController
|
|||||||
getSubtitle();
|
getSubtitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
showReplyReplyPanel(oid, fRpid, firstFloor, currentReply) {
|
showReplyReplyPanel(oid, fRpid, firstFloor) {
|
||||||
replyReplyBottomSheetCtr =
|
replyReplyBottomSheetCtr =
|
||||||
scaffoldKey.currentState?.showBottomSheet((BuildContext context) {
|
scaffoldKey.currentState?.showBottomSheet((BuildContext context) {
|
||||||
return VideoReplyReplyPanel(
|
return VideoReplyReplyPanel(
|
||||||
@ -173,7 +173,6 @@ class VideoDetailController extends GetxController
|
|||||||
replyType: ReplyType.video,
|
replyType: ReplyType.video,
|
||||||
source: 'videoDetail',
|
source: 'videoDetail',
|
||||||
sheetHeight: sheetHeight.value,
|
sheetHeight: sheetHeight.value,
|
||||||
currentReply: currentReply,
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
replyReplyBottomSheetCtr?.closed.then((value) {
|
replyReplyBottomSheetCtr?.closed.then((value) {
|
||||||
|
|||||||
@ -110,7 +110,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 展示二级回复
|
// 展示二级回复
|
||||||
void replyReply(replyItem, currentReply) {
|
void replyReply(replyItem) {
|
||||||
final VideoDetailController videoDetailCtr =
|
final VideoDetailController videoDetailCtr =
|
||||||
Get.find<VideoDetailController>(tag: heroTag);
|
Get.find<VideoDetailController>(tag: heroTag);
|
||||||
if (replyItem != null) {
|
if (replyItem != null) {
|
||||||
@ -118,7 +118,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
|||||||
videoDetailCtr.fRpid = replyItem.rpid!;
|
videoDetailCtr.fRpid = replyItem.rpid!;
|
||||||
videoDetailCtr.firstFloor = replyItem;
|
videoDetailCtr.firstFloor = replyItem;
|
||||||
videoDetailCtr.showReplyReplyPanel(
|
videoDetailCtr.showReplyReplyPanel(
|
||||||
replyItem.oid, replyItem.rpid!, replyItem, currentReply);
|
replyItem.oid, replyItem.rpid!, replyItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,8 +229,8 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
|||||||
.replyList[index],
|
.replyList[index],
|
||||||
showReplyRow: true,
|
showReplyRow: true,
|
||||||
replyLevel: replyLevel,
|
replyLevel: replyLevel,
|
||||||
replyReply: (replyItem, currentReply) =>
|
replyReply: (replyItem) =>
|
||||||
replyReply(replyItem, currentReply),
|
replyReply(replyItem),
|
||||||
replyType: ReplyType.video,
|
replyType: ReplyType.video,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -531,10 +531,8 @@ InlineSpan buildContent(
|
|||||||
TextSpan(
|
TextSpan(
|
||||||
text: str,
|
text: str,
|
||||||
recognizer: TapGestureRecognizer()
|
recognizer: TapGestureRecognizer()
|
||||||
..onTap = () => replyReply?.call(
|
..onTap = () =>
|
||||||
replyItem.root == 0 ? replyItem : fReplyItem,
|
replyReply?.call(replyItem.root == 0 ? replyItem : fReplyItem),
|
||||||
replyItem,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,7 +26,7 @@ class VideoReplyReplyController extends GetxController {
|
|||||||
currentPage = 0;
|
currentPage = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future queryReplyList({type = 'init', currentReply}) async {
|
Future queryReplyList({type = 'init'}) async {
|
||||||
if (type == 'init') {
|
if (type == 'init') {
|
||||||
currentPage = 0;
|
currentPage = 0;
|
||||||
}
|
}
|
||||||
@ -63,14 +63,6 @@ class VideoReplyReplyController extends GetxController {
|
|||||||
// res['data'].replies.addAll(replyList);
|
// res['data'].replies.addAll(replyList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (replyList.isNotEmpty && currentReply != null) {
|
|
||||||
int indexToRemove =
|
|
||||||
replyList.indexWhere((item) => currentReply.rpid == item.rpid);
|
|
||||||
// 如果找到了指定ID的项,则移除
|
|
||||||
if (indexToRemove != -1) {
|
|
||||||
replyList.removeAt(indexToRemove);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
isLoadingMore = false;
|
isLoadingMore = false;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,7 +20,6 @@ class VideoReplyReplyPanel extends StatefulWidget {
|
|||||||
this.source,
|
this.source,
|
||||||
this.replyType,
|
this.replyType,
|
||||||
this.sheetHeight,
|
this.sheetHeight,
|
||||||
this.currentReply,
|
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
final int? oid;
|
final int? oid;
|
||||||
@ -30,7 +29,6 @@ class VideoReplyReplyPanel extends StatefulWidget {
|
|||||||
final String? source;
|
final String? source;
|
||||||
final ReplyType? replyType;
|
final ReplyType? replyType;
|
||||||
final double? sheetHeight;
|
final double? sheetHeight;
|
||||||
final dynamic currentReply;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<VideoReplyReplyPanel> createState() => _VideoReplyReplyPanelState();
|
State<VideoReplyReplyPanel> createState() => _VideoReplyReplyPanelState();
|
||||||
@ -65,9 +63,7 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
_futureBuilderFuture = _videoReplyReplyController.queryReplyList(
|
_futureBuilderFuture = _videoReplyReplyController.queryReplyList();
|
||||||
currentReply: widget.currentReply,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void replyReply(replyItem) {}
|
void replyReply(replyItem) {}
|
||||||
@ -111,9 +107,7 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
|||||||
onRefresh: () async {
|
onRefresh: () async {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
_videoReplyReplyController.currentPage = 0;
|
_videoReplyReplyController.currentPage = 0;
|
||||||
return await _videoReplyReplyController.queryReplyList(
|
return await _videoReplyReplyController.queryReplyList();
|
||||||
currentReply: widget.currentReply,
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
controller: _videoReplyReplyController.scrollController,
|
controller: _videoReplyReplyController.scrollController,
|
||||||
@ -146,10 +140,6 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
|||||||
if (snapshot.connectionState == ConnectionState.done) {
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
Map? data = snapshot.data;
|
Map? data = snapshot.data;
|
||||||
if (data != null && data['status']) {
|
if (data != null && data['status']) {
|
||||||
if (widget.currentReply != null) {
|
|
||||||
_videoReplyReplyController.replyList
|
|
||||||
.insert(0, widget.currentReply);
|
|
||||||
}
|
|
||||||
// 请求成功
|
// 请求成功
|
||||||
return Obx(
|
return Obx(
|
||||||
() => SliverList(
|
() => SliverList(
|
||||||
|
|||||||
@ -446,7 +446,7 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
children: [
|
children: [
|
||||||
RadioListTile(
|
RadioListTile(
|
||||||
value: -1,
|
value: -1,
|
||||||
title: const Text('关闭弹幕'),
|
title: const Text('关闭字幕'),
|
||||||
groupValue: tempThemeValue,
|
groupValue: tempThemeValue,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
tempThemeValue = value!;
|
tempThemeValue = value!;
|
||||||
|
|||||||
@ -109,7 +109,6 @@ class Utils {
|
|||||||
toInt: false,
|
toInt: false,
|
||||||
formatType: formatType);
|
formatType: formatType);
|
||||||
}
|
}
|
||||||
print('distance: $distance');
|
|
||||||
if (distance <= 60) {
|
if (distance <= 60) {
|
||||||
return '刚刚';
|
return '刚刚';
|
||||||
} else if (distance <= 3600) {
|
} else if (distance <= 3600) {
|
||||||
|
|||||||
Reference in New Issue
Block a user