mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-24 11:06:51 +08:00
opt handle res
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:PiliPlus/models/bangumi/info.dart';
|
||||
import 'package:PiliPlus/models/pgc/info.dart';
|
||||
import 'package:PiliPlus/pages/video/controller.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
import 'package:PiliPlus/common/widgets/button/icon_button.dart';
|
||||
import 'package:PiliPlus/common/widgets/keep_alive_wrapper.dart';
|
||||
import 'package:PiliPlus/common/widgets/page/tabs.dart';
|
||||
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
||||
import 'package:PiliPlus/common/widgets/stat/stat.dart';
|
||||
import 'package:PiliPlus/models/bangumi/info.dart';
|
||||
import 'package:PiliPlus/models/pgc/info.dart';
|
||||
import 'package:PiliPlus/models/video_tag/data.dart';
|
||||
import 'package:PiliPlus/pages/common/common_collapse_slide_page.dart';
|
||||
import 'package:PiliPlus/pages/pgc_review/view.dart';
|
||||
import 'package:PiliPlus/pages/search/widgets/search_text.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:flutter/material.dart' hide TabBarView;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class IntroDetail extends CommonCollapseSlidePage {
|
||||
final BangumiInfoModel bangumiDetail;
|
||||
final dynamic videoTags;
|
||||
final List<VideoTagItem>? videoTags;
|
||||
|
||||
const IntroDetail({
|
||||
super.key,
|
||||
@@ -27,10 +30,12 @@ class IntroDetail extends CommonCollapseSlidePage {
|
||||
|
||||
class _IntroDetailState extends CommonCollapseSlidePageState<IntroDetail> {
|
||||
late final _tabController = TabController(length: 2, vsync: this);
|
||||
final _controller = ScrollController();
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_tabController.dispose();
|
||||
_controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -50,6 +55,13 @@ class _IntroDetailState extends CommonCollapseSlidePageState<IntroDetail> {
|
||||
tabAlignment: TabAlignment.start,
|
||||
dividerColor: Colors.transparent,
|
||||
tabs: const [Tab(text: '详情'), Tab(text: '点评')],
|
||||
onTap: (index) {
|
||||
if (!_tabController.indexIsChanging) {
|
||||
if (index == 0) {
|
||||
_controller.animToTop();
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
iconButton(
|
||||
@@ -63,7 +75,7 @@ class _IntroDetailState extends CommonCollapseSlidePageState<IntroDetail> {
|
||||
],
|
||||
),
|
||||
children: [
|
||||
buildList(theme),
|
||||
KeepAliveWrapper(builder: (context) => buildList(theme)),
|
||||
PgcReviewPage(
|
||||
name: widget.bangumiDetail.title!,
|
||||
mediaId: widget.bangumiDetail.mediaId,
|
||||
@@ -79,7 +91,7 @@ class _IntroDetailState extends CommonCollapseSlidePageState<IntroDetail> {
|
||||
color: theme.colorScheme.onSurface,
|
||||
);
|
||||
return ListView(
|
||||
controller: ScrollController(),
|
||||
controller: _controller,
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
padding: EdgeInsets.only(
|
||||
left: 14,
|
||||
@@ -90,9 +102,7 @@ class _IntroDetailState extends CommonCollapseSlidePageState<IntroDetail> {
|
||||
children: [
|
||||
SelectableText(
|
||||
widget.bangumiDetail.title!,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
),
|
||||
style: const TextStyle(fontSize: 16),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Row(
|
||||
@@ -149,23 +159,21 @@ class _IntroDetailState extends CommonCollapseSlidePageState<IntroDetail> {
|
||||
widget.bangumiDetail.actors!,
|
||||
style: smallTitle.copyWith(fontSize: 14),
|
||||
),
|
||||
if (widget.videoTags is List && widget.videoTags.isNotEmpty) ...[
|
||||
if (widget.videoTags?.isNotEmpty == true) ...[
|
||||
const SizedBox(height: 10),
|
||||
Wrap(
|
||||
spacing: 8,
|
||||
runSpacing: 8,
|
||||
children: (widget.videoTags as List)
|
||||
children: widget.videoTags!
|
||||
.map(
|
||||
(item) => SearchText(
|
||||
fontSize: 13,
|
||||
text: item['tag_name'],
|
||||
onTap: (_) => Get.toNamed(
|
||||
text: item.tagName!,
|
||||
onTap: (tagName) => Get.toNamed(
|
||||
'/searchResult',
|
||||
parameters: {
|
||||
'keyword': item['tag_name'],
|
||||
},
|
||||
parameters: {'keyword': tagName},
|
||||
),
|
||||
onLongPress: (_) => Utils.copyText(item['tag_name']),
|
||||
onLongPress: (tagName) => Utils.copyText(tagName),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
|
||||
Reference in New Issue
Block a user