fix: 图片提交4x,提示画质。iOS logo提交;
This commit is contained in:
1 parent
2f1ec27802
commit
9e10608245
85 files changed
+1027
-645
No files matched your search
@@ -1,19 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:skywood/global/client/play_client.dart';
|
||||
import 'package:skywood/main/lib_file.dart';
|
||||
import 'package:skywood/pages/home/players/widget/player_bottom_widget.dart';
|
||||
import 'package:skywood/pages/home/players/widget/sky_player_view.dart';
|
||||
import 'package:skywood/utils/models/drama/skywood_detail.dart';
|
||||
import 'package:skywood/utils/models/drama/skywood_drama.dart';
|
||||
import 'package:skywood/utils/models/drama/skywood_home.dart';
|
||||
import 'package:skywood/utils/models/drama/skywood_episode.dart';
|
||||
import 'package:skywood/utils/tools/app_toast.dart';
|
||||
import 'package:skywood/utils/tools/widgets/sky_app_bar.dart';
|
||||
import 'package:skywood/utils/tools/widgets/sky_common_widget.dart';
|
||||
|
||||
class DramaDetailPage extends StatefulWidget {
|
||||
const DramaDetailPage({super.key,
|
||||
required this.dramaBean,
|
||||
});
|
||||
const DramaDetailPage({super.key, required this.dramaBean});
|
||||
|
||||
final SkywoodDrama dramaBean;
|
||||
|
||||
@@ -24,36 +20,49 @@ class DramaDetailPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _DramaDetailPageState extends State<DramaDetailPage> {
|
||||
|
||||
SkywoodDetail? _detailBean;
|
||||
SkywoodEpisode? _selectedEpisode;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
_getDetailDrama();
|
||||
_getDetailDrama(
|
||||
shortPlayId: widget.dramaBean.shortPlayId ?? 0,
|
||||
shortPlayVideoId: widget.dramaBean.shortPlayVideoId ?? 0,
|
||||
);
|
||||
}
|
||||
|
||||
void _getDetailDrama() {
|
||||
print('currentEpisode===${widget.dramaBean.currentEpisode}');
|
||||
void _getDetailDrama({
|
||||
required int shortPlayId,
|
||||
required int shortPlayVideoId,
|
||||
}) {
|
||||
AppToast.showLottieLoading();
|
||||
PlayClient.getVideoDetail(
|
||||
shortPlayId: widget.dramaBean.shortPlayId ?? 0,
|
||||
shortPlayVideoId: widget.dramaBean.shortPlayVideoId ?? 0
|
||||
shortPlayId: shortPlayId,
|
||||
shortPlayVideoId: shortPlayVideoId,
|
||||
).then((value) {
|
||||
AppToast.dismiss();
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
_detailBean = value;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
void _onSelectedEpisode(SkywoodEpisode episode) {
|
||||
setState(() {
|
||||
_selectedEpisode = episode;
|
||||
});
|
||||
_getDetailDrama(
|
||||
shortPlayId: episode.shortPlayId,
|
||||
shortPlayVideoId: episode.shortPlayVideoId,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.black,
|
||||
body: _bodyWidget(),
|
||||
);
|
||||
return Scaffold(backgroundColor: Colors.black, body: _bodyWidget());
|
||||
}
|
||||
|
||||
Widget _bodyWidget() {
|
||||
@@ -63,17 +72,29 @@ class _DramaDetailPageState extends State<DramaDetailPage> {
|
||||
|
||||
if (_detailBean != null)
|
||||
Positioned(
|
||||
bottom: 0, left: 0, right: 0, top: 0,
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
top: 0,
|
||||
child: SkyPlayerView(
|
||||
key: ValueKey(
|
||||
_selectedEpisode?.shortPlayVideoId ??
|
||||
_detailBean?.videoInfo?.shortPlayVideoId ??
|
||||
widget.dramaBean.shortPlayVideoId,
|
||||
),
|
||||
detailBean: _detailBean,
|
||||
dramaBean: widget.dramaBean,
|
||||
currentEpisode: _selectedEpisode?.episode,
|
||||
onSelectedEpisode: _onSelectedEpisode,
|
||||
),
|
||||
),
|
||||
|
||||
Positioned(
|
||||
top: AppScreen.statusBarHeight + 5, left: 0, right: 0,
|
||||
top: AppScreen.statusBarHeight + 5,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: _headerWidget(),
|
||||
)
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -88,14 +109,18 @@ class _DramaDetailPageState extends State<DramaDetailPage> {
|
||||
icon: HelpImg.asset(ConstImg.back, width: 32),
|
||||
onPressed: () => HelpNav.back(),
|
||||
),
|
||||
Expanded(child: SkyText(text: widget.dramaBean.name, color: Colors.white, fontSize: 16,
|
||||
textAlign: TextAlign.center,
|
||||
fontWeight: FontWeight.bold,
|
||||
)),
|
||||
SizedBox(width: 40,)
|
||||
Expanded(
|
||||
child: SkyText(
|
||||
text: widget.dramaBean.name,
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
textAlign: TextAlign.center,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 40),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,8 @@ import 'package:skywood/utils/models/drama/skywood_episode.dart';
|
||||
import 'package:skywood/utils/tools/widgets/sky_common_widget.dart';
|
||||
|
||||
class DramaEspPage extends StatefulWidget {
|
||||
const DramaEspPage({super.key,
|
||||
const DramaEspPage({
|
||||
super.key,
|
||||
required this.detail,
|
||||
this.currentEpisode,
|
||||
this.onSelectedEpisode,
|
||||
@@ -14,7 +15,7 @@ class DramaEspPage extends StatefulWidget {
|
||||
|
||||
final SkywoodDetail detail;
|
||||
final int? currentEpisode;
|
||||
final Function(int)? onSelectedEpisode;
|
||||
final ValueChanged<SkywoodEpisode>? onSelectedEpisode;
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() {
|
||||
@@ -184,10 +185,11 @@ class _DramaEspPageState extends State<DramaEspPage> {
|
||||
return GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () {
|
||||
if (_selectedEpisode == episode.episode) return;
|
||||
setState(() {
|
||||
_selectedEpisode = episode.episode;
|
||||
});
|
||||
widget.onSelectedEpisode?.call(_selectedEpisode);
|
||||
widget.onSelectedEpisode?.call(episode);
|
||||
},
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
|
||||
Reference in new issue
Block a user