YSVideoVRDetail.dart 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/services.dart';
  3. import 'package:flutter_vr/video/view/YSVRVideoView.dart';
  4. import '../tools/YSTools.dart';
  5. class YSVideoVRDetail extends StatefulWidget {
  6. final Map video;
  7. const YSVideoVRDetail({Key? key, required this.video}) : super(key: key);
  8. @override
  9. YSVideoVRDetailState createState() => YSVideoVRDetailState();
  10. }
  11. class YSVideoVRDetailState extends State<YSVideoVRDetail> {
  12. Widget _vrView = const SizedBox();
  13. static const platform = MethodChannel('com.flutter.ys.YSVRView');
  14. String _type = "1";
  15. @override
  16. void initState() {
  17. // AppUtil.H();
  18. _getVrView();
  19. super.initState();
  20. }
  21. _getVrView() {
  22. _vrView = YSVRVideoView(video: widget.video,);
  23. setState(() {});
  24. }
  25. @override
  26. void dispose() {
  27. // AppUtil.V();
  28. super.dispose();
  29. }
  30. _putType() {
  31. _type = _type=='1'?'2':'1';
  32. platform.invokeMethod('putType', {'type':_type});
  33. }
  34. @override
  35. Widget build(BuildContext context) {
  36. return Scaffold(
  37. backgroundColor: Colors.black,
  38. body: Stack(
  39. children: [
  40. Container(
  41. // padding: const EdgeInsets.all(50),
  42. child: Row(
  43. children: [
  44. Expanded(child: _vrView),
  45. // SizedBox(width: 50,child: GestureDetector(
  46. // onTap: (){
  47. // _putType();
  48. // },
  49. // child: const Icon(Icons.settings,size: 30,color: Colors.white,)),
  50. // ),
  51. // Expanded(child: _vrView),
  52. ],
  53. ),
  54. ),
  55. Container(
  56. padding: EdgeInsets.only(top: ysTOP(context)+5),
  57. child: GestureDetector(
  58. onTap: (){
  59. Navigator.pop(context);
  60. },
  61. behavior: HitTestBehavior.opaque,
  62. child: Row(
  63. children: [
  64. const Icon(Icons.chevron_left,size: 40,color: Colors.white,),
  65. Expanded(child: Text(widget.video['name'],style: const TextStyle(fontSize: 15,color: Colors.white),maxLines: 1,))
  66. ],
  67. ),
  68. ),
  69. ),
  70. ],
  71. ),
  72. );
  73. }
  74. }