import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_vr/video/view/YSVRVideoView.dart'; import '../tools/YSTools.dart'; class YSVideoVRDetail extends StatefulWidget { final Map video; const YSVideoVRDetail({Key? key, required this.video}) : super(key: key); @override YSVideoVRDetailState createState() => YSVideoVRDetailState(); } class YSVideoVRDetailState extends State { Widget _vrView = const SizedBox(); static const platform = MethodChannel('com.flutter.ys.YSVRView'); String _type = "1"; @override void initState() { // AppUtil.H(); _getVrView(); super.initState(); } _getVrView() { _vrView = YSVRVideoView(video: widget.video,); setState(() {}); } @override void dispose() { // AppUtil.V(); super.dispose(); } _putType() { _type = _type=='1'?'2':'1'; platform.invokeMethod('putType', {'type':_type}); } @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.black, body: Stack( children: [ Container( // padding: const EdgeInsets.all(50), child: Row( children: [ Expanded(child: _vrView), // SizedBox(width: 50,child: GestureDetector( // onTap: (){ // _putType(); // }, // child: const Icon(Icons.settings,size: 30,color: Colors.white,)), // ), // Expanded(child: _vrView), ], ), ), Container( padding: EdgeInsets.only(top: ysTOP(context)+5), child: GestureDetector( onTap: (){ Navigator.pop(context); }, behavior: HitTestBehavior.opaque, child: Row( children: [ const Icon(Icons.chevron_left,size: 40,color: Colors.white,), Expanded(child: Text(widget.video['name'],style: const TextStyle(fontSize: 15,color: Colors.white),maxLines: 1,)) ], ), ), ), ], ), ); } }