147 lines
4.4 KiB
Dart
147 lines
4.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:hgdj/assets_tool/images.dart';
|
|
import 'package:hgdj/hj_utils/screen.dart';
|
|
import 'package:hgdj/tools_base/widget/net_image_widget.dart';
|
|
|
|
import '../../hj_model/cartoon_media_info.dart';
|
|
import '../../hj_model/video_model.dart';
|
|
import '../../hj_utils/widget_util.dart';
|
|
import '../../tools_base/widget/shrink_wrap.dart';
|
|
import '../home/tag/cartoon_tag_page.dart';
|
|
import 'widget/acg_expand_text.dart';
|
|
import 'widget/acg_source_manager.dart';
|
|
|
|
class NovelHeader extends StatelessWidget {
|
|
final ACGSourceManager? manager;
|
|
const NovelHeader({super.key, this.manager});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final info = manager?.mediaInfo;
|
|
return Stack(
|
|
children: [
|
|
Positioned(
|
|
left: 0,
|
|
top: 0,
|
|
right: 0,
|
|
child: NetworkImageLoader(imageUrl: info?.coverH ?? ''),
|
|
),
|
|
Positioned.fill(
|
|
child: Container(color: Colors.black.withValues(alpha: .7)),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
(screen.paddingTop + 72).sizeBoxH,
|
|
_titleRow(info),
|
|
18.sizeBoxH,
|
|
if (info?.summary?.isNotEmpty == true) ...[
|
|
12.sizeBoxH,
|
|
AcgShowMoreTextWidget(
|
|
summary: info?.summary ?? '',
|
|
maxWidth: Get.width - 32,
|
|
),
|
|
],
|
|
20.sizeBoxH,
|
|
],
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
|
|
Widget _titleRow(CartoonMediaInfo? info) {
|
|
return Row(
|
|
children: [
|
|
Stack(
|
|
children: [
|
|
NetworkImageLoader(
|
|
imageUrl: info?.coverH ?? '',
|
|
width: 111,
|
|
height: 148,
|
|
),
|
|
if (info?.isAudiobooks == true)
|
|
Positioned(
|
|
top: 6,
|
|
left: 6,
|
|
child: Image.asset('noval_sign.png'.acgImgPath, width: 20),
|
|
),
|
|
],
|
|
),
|
|
12.sizeBoxW,
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
info?.title ?? '',
|
|
style: textStyle(16, Colors.white, FontWeight.w500),
|
|
maxLines: 1,
|
|
overflow: TextOverflow.ellipsis,
|
|
),
|
|
6.sizeBoxH,
|
|
Row(
|
|
children: [
|
|
Text(
|
|
'共${info?.totalEpisode ?? 0}${info?.unit}',
|
|
style:
|
|
textStyle(12, const Color(0xff999999), FontWeight.w400),
|
|
),
|
|
8.sizeBoxW,
|
|
Text(
|
|
'/',
|
|
style:
|
|
textStyle(12, const Color(0xff999999), FontWeight.w400),
|
|
),
|
|
8.sizeBoxW,
|
|
Text(
|
|
info?.updateDesc ?? '',
|
|
style: textStyle(
|
|
12, info!.getDetailUpdateColor, FontWeight.w400),
|
|
),
|
|
],
|
|
),
|
|
if (info.tagDetails?.isNotEmpty == true) ...[
|
|
6.sizeBoxH,
|
|
_tags(info.tagDetails!),
|
|
],
|
|
],
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
|
|
Widget _tags(List<TagsBean> tags) {
|
|
return ShrinkWrap(
|
|
spacing: 10,
|
|
runSpacing: 10,
|
|
maxLines: 1,
|
|
children: tags
|
|
.map((tag) => InkWell(
|
|
enableFeedback: false,
|
|
onTap: () => Get.to(
|
|
CartoonTagPage(title: tag.name ?? '', sId: tag.id ?? '')),
|
|
child: Container(
|
|
padding:
|
|
const EdgeInsets.symmetric(vertical: 6, horizontal: 12),
|
|
decoration: BoxDecoration(
|
|
color: const Color(0xff22252D),
|
|
borderRadius: BorderRadius.circular(4),
|
|
),
|
|
child: Text(
|
|
'#${tag.name ?? ''}',
|
|
maxLines: 1,
|
|
style:
|
|
const TextStyle(color: Color(0xFF999999), fontSize: 12),
|
|
),
|
|
),
|
|
))
|
|
.toList(),
|
|
);
|
|
}
|
|
}
|