101 lines
2.7 KiB
Dart
101 lines
2.7 KiB
Dart
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/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,
|
|
});
|
|
|
|
final SkywoodDrama dramaBean;
|
|
|
|
@override
|
|
State<StatefulWidget> createState() {
|
|
return _DramaDetailPageState();
|
|
}
|
|
}
|
|
|
|
class _DramaDetailPageState extends State<DramaDetailPage> {
|
|
|
|
SkywoodDetail? _detailBean;
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
|
|
_getDetailDrama();
|
|
}
|
|
|
|
void _getDetailDrama() {
|
|
print('currentEpisode===${widget.dramaBean.currentEpisode}');
|
|
AppToast.showLottieLoading();
|
|
PlayClient.getVideoDetail(
|
|
shortPlayId: widget.dramaBean.shortPlayId ?? 0,
|
|
shortPlayVideoId: widget.dramaBean.shortPlayVideoId ?? 0
|
|
).then((value) {
|
|
AppToast.dismiss();
|
|
setState(() {
|
|
_detailBean = value;
|
|
});
|
|
});
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: Colors.black,
|
|
body: _bodyWidget(),
|
|
);
|
|
}
|
|
|
|
Widget _bodyWidget() {
|
|
return Stack(
|
|
children: [
|
|
SizedBox(width: double.infinity, height: double.infinity),
|
|
|
|
if (_detailBean != null)
|
|
Positioned(
|
|
bottom: 0, left: 0, right: 0, top: 0,
|
|
child: SkyPlayerView(
|
|
detailBean: _detailBean,
|
|
dramaBean: widget.dramaBean,
|
|
),
|
|
),
|
|
|
|
Positioned(
|
|
top: AppScreen.statusBarHeight + 5, left: 0, right: 0,
|
|
child: _headerWidget(),
|
|
)
|
|
],
|
|
);
|
|
}
|
|
|
|
Widget _headerWidget() {
|
|
return Container(
|
|
height: 40,
|
|
padding: const EdgeInsets.only(right: 15, left: 5),
|
|
child: Row(
|
|
children: [
|
|
IconButton(
|
|
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,)
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
} |