1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- 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<YSVideoVRDetail> {
- 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,))
- ],
- ),
- ),
- ),
- ],
- ),
- );
- }
- }
|