interrogation_page.dart 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746
  1. import 'package:flutter/material.dart';
  2. import 'package:liftmanager/res/gaps.dart';
  3. import 'package:liftmanager/net/api_service.dart';
  4. import 'package:liftmanager/utils/toast.dart';
  5. import 'package:liftmanager/widgets/app_bar.dart';
  6. import 'package:liftmanager/internal/search/search_router.dart';
  7. import 'package:liftmanager/widgets/app_search_bar.dart';
  8. import 'package:liftmanager/res/resources.dart';
  9. import 'package:liftmanager/routers/fluro_navigator.dart';
  10. import 'package:liftmanager/widgets/load_image.dart';
  11. import 'package:liftmanager/widgets/selected_image_change.dart';
  12. import 'package:image_picker/image_picker.dart';
  13. import 'dart:io';
  14. import 'package:flutter_screenutil/flutter_screenutil.dart';
  15. import 'package:liftmanager/internal/bbs/bbs_router.dart';
  16. import 'dart:convert';
  17. import 'package:shared_preferences/shared_preferences.dart';
  18. import 'package:liftmanager/common/common.dart';
  19. import 'package:flustars/flustars.dart' as flustars;
  20. import 'package:liftmanager/utils/theme_utils.dart';
  21. import 'package:chewie/chewie.dart';
  22. import 'package:liftmanager/utils/oss_upload.dart';
  23. import 'package:video_player/video_player.dart';
  24. import 'package:liftmanager/widgets/selected_video_change.dart';
  25. import 'package:liftmanager/utils/utils.dart';
  26. import 'package:orientation/orientation.dart';
  27. import 'package:flutter/services.dart';
  28. import 'package:liftmanager/utils/fast_notification.dart';
  29. class InterrogationPage extends StatefulWidget {
  30. InterrogationPage(this.brandName,this.brandId);
  31. final String brandName;
  32. final String brandId;
  33. @override
  34. State<StatefulWidget> createState() {
  35. return InterrogationPageState();
  36. }
  37. }
  38. class InterrogationPageState extends State<InterrogationPage> {
  39. // NewsDetailItem item = NewsDetailItem();
  40. List<String> imagesUrl = [];
  41. String videoUrl;
  42. String str;
  43. double percent = 0.0;
  44. String addressName = "";
  45. VideoPlayerController _controller;
  46. @override
  47. void initState() {
  48. super.initState();
  49. print(widget.brandName);
  50. print(widget.brandId);
  51. print(65656);
  52. }
  53. //图片
  54. upLoadFileOnce(path) {
  55. showLoading(context, "正在上传...");
  56. NewApiService().upload(path, onSuccess: (res) {
  57. // imagesUrl.add(res.path);
  58. dismissLoading(context);
  59. setState(() {
  60. imagesUrl.add(res.pathUrl);
  61. });
  62. }, onError: (code, msg) {
  63. dismissLoading(context);
  64. toasts(msg);
  65. });
  66. }
  67. //视频
  68. upLoadFileOnceVideo(path) {
  69. showLoading(context, "正在上传...");
  70. NewApiService().upload(path, onSuccess: (res) {
  71. // imagesUrl.add(res.path);
  72. dismissLoading(context);
  73. setState(() {
  74. // videoUrl.add(res.pathUrl);
  75. // imagesUrlVideo.add(res.coverUrl);
  76. });
  77. }, onError: (code, msg) {
  78. dismissLoading(context);
  79. toasts(msg);
  80. });
  81. }
  82. ///选择图片
  83. void selectPicker(type) {
  84. showDialog(
  85. context: context,
  86. builder: (BuildContext context) {
  87. return SimpleDialog(
  88. title: Text("选择方式"),
  89. children: ["拍照", '从手机相册选择'].map((String value) {
  90. print("$value");
  91. return SimpleDialogOption(
  92. child: Text(
  93. "${value}",
  94. style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
  95. ),
  96. onPressed: () {
  97. if(type=="image"){
  98. _getImage(value == '拍照' ? 1 : 0);
  99. }else if (type=="video") {
  100. _getVideo(value == '拍照' ? 1 : 0);
  101. }
  102. Navigator.of(context).pop();
  103. },
  104. );
  105. }).toList());
  106. });
  107. }
  108. void _getImage(int key) async {
  109. try {
  110. var _imageFile = await ImagePicker.pickImage(
  111. source: key == 1 ? ImageSource.camera : ImageSource.gallery,
  112. maxWidth: 800,
  113. imageQuality: 95);
  114. print(_imageFile);
  115. print(3333);
  116. if (_imageFile != null) {
  117. // images.add(_imageFile);
  118. upLoadFileOnce(_imageFile.path);
  119. // setState(() {});
  120. }
  121. } catch (e) {
  122. toasts("没有权限,无法打开相册!");
  123. }
  124. }
  125. void _getVideo(int key) async {
  126. print(key);
  127. print(333);
  128. try {
  129. var _imageFile = await ImagePicker.pickVideo(
  130. source: key == 1 ? ImageSource.camera : ImageSource.gallery,
  131. );
  132. if (_imageFile != null) {
  133. // print(123);
  134. // print(_imageFile);
  135. // print(jsonEncode(_imageFile));
  136. print(123);
  137. _uploadImage(_imageFile.path);
  138. // upLoadFileOnceVideo(_imageFile.path);
  139. setState(() {});
  140. }
  141. } catch (e) {
  142. toasts("没有权限,无法打开相册!");
  143. }
  144. }
  145. void _uploadImage(filePath) async {
  146. showPercent(context, (){
  147. dismissLoading(context);
  148. toasts("上传失败");
  149. },(){
  150. if(videoUrl == null && str != null){
  151. setState(() {
  152. videoUrl = str;
  153. print("videoUrl:"+videoUrl);
  154. dismissLoading(context);
  155. toasts("上传成功");
  156. });
  157. }
  158. });
  159. String uploadName = OssUtil.instance.getImageUploadName(filePath);
  160. await NewApiService.uploadImage(context, uploadName, filePath).then((data) {
  161. if (data.statusCode == 200) {
  162. str = NewApiUrl.URL_UPLOAD_IMAGE_OSS + "/" + uploadName;
  163. print("str:"+str);
  164. print(videoUrl);
  165. if(str != null){
  166. Map obj = {
  167. "uploadName":uploadName,
  168. "success":true
  169. };
  170. FastNotification.push("percent",obj);
  171. }
  172. }else {
  173. Map obj = {
  174. "uploadName":uploadName,
  175. "success":false
  176. };
  177. FastNotification.push("percent",obj);
  178. }
  179. }).catchError((data) {
  180. Map obj = {
  181. "uploadName":uploadName,
  182. "success":false
  183. };
  184. FastNotification.push("percent",obj);
  185. });
  186. }
  187. // 焦点控制
  188. // FocusNode _focusNode1 = new FocusNode();
  189. GlobalKey _formKey= new GlobalKey<FormState>();
  190. TextEditingController _questionController = new TextEditingController();
  191. TextEditingController _methodController = new TextEditingController();
  192. FocusNode blankNode = FocusNode();
  193. @override
  194. Widget build(BuildContext context) {
  195. double width = MediaQuery.of(context).size.width;
  196. // 监听FocusNode
  197. // _focusNode1.addListener((){
  198. // // _focusNode1.hasFocus 是否聚焦
  199. // print(_focusNode1.hasFocus);
  200. // });
  201. return Scaffold(
  202. resizeToAvoidBottomPadding: false,//不让键盘弹上去
  203. appBar: MyAppBar(
  204. centerTitle: "我要提问",
  205. ),
  206. body: GestureDetector(
  207. onTap: (){
  208. // 点击空白页面关闭键盘
  209. FocusScope.of(context).requestFocus(blankNode);
  210. },
  211. child: Stack(
  212. children:<Widget>[
  213. Container(
  214. padding: EdgeInsets.only(bottom:ScreenUtil().setWidth(80)),
  215. child: ListView(
  216. children: <Widget>[
  217. Form(
  218. key: _formKey, //设置globalKey,用于后面获取FormState
  219. // autovalidate: true, //开启自动校验
  220. child: Column(
  221. children: <Widget>[
  222. Container(
  223. padding: EdgeInsets.only(left:ScreenUtil().setWidth(15),right:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10),bottom:ScreenUtil().setWidth(10)),
  224. decoration: BoxDecoration(
  225. border: Border(
  226. bottom: BorderSide(width: 0.5, color: Colours.line),
  227. ),
  228. ),
  229. child: Row(
  230. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  231. children:<Widget>[
  232. Text(
  233. "电梯品牌",
  234. style: TextStyle(
  235. // fontSize:ScreenUtil().setSp(14)
  236. ),
  237. textAlign:TextAlign.start,
  238. ),
  239. Text(
  240. widget.brandName,
  241. style: TextStyle(
  242. color:Color(0xff999999),
  243. // fontSize:ScreenUtil().setSp(14)
  244. ),
  245. textAlign:TextAlign.start,
  246. ),
  247. ]
  248. ),
  249. ),
  250. Row(
  251. crossAxisAlignment: CrossAxisAlignment.start,
  252. mainAxisAlignment: MainAxisAlignment.start,
  253. children: <Widget>[
  254. Container(
  255. padding:EdgeInsets.only(left:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10),bottom:ScreenUtil().setWidth(5)),
  256. child: Text(
  257. "问题描述",
  258. style: TextStyle(
  259. // fontSize:ScreenUtil().setSp(14),
  260. ),
  261. textAlign:TextAlign.left,
  262. ),
  263. ),
  264. ],
  265. ),
  266. Container(
  267. height:120,
  268. padding: EdgeInsets.only(left:ScreenUtil().setWidth(15),right:ScreenUtil().setWidth(15),bottom:ScreenUtil().setWidth(20)),
  269. child: TextFormField(
  270. // autofocus: true,
  271. maxLength: 50,
  272. cursorColor: Color(0xffcccccc),
  273. controller: _questionController,
  274. maxLines:5,
  275. decoration: InputDecoration(
  276. contentPadding: EdgeInsets.all(0),
  277. hintText: '请详细描述事故问题和现场情况',
  278. hintStyle:TextStyle(
  279. color: Color(0xffcccccc),
  280. // fontSize: ScreenUtil().setSp(14),
  281. ),
  282. focusedBorder: InputBorder.none,
  283. border: InputBorder.none,
  284. // filled: true, // 背景色
  285. // fillColor: Colors.cyan.withAlpha(35),
  286. // icon: Icon(Icons.person)
  287. ),
  288. // 校验
  289. validator: (val) {
  290. return val.trim().length > 0 ? null : "不能为空";
  291. }
  292. ),
  293. ),
  294. SizedBox(
  295. height:6,
  296. child: Container(
  297. color:ThemeUtils.getDialogTextFieldColor(context)
  298. ),
  299. ),
  300. Row(
  301. crossAxisAlignment: CrossAxisAlignment.start,
  302. mainAxisAlignment: MainAxisAlignment.start,
  303. children: <Widget>[
  304. Container(
  305. padding:EdgeInsets.only(left:ScreenUtil().setWidth(15),top:ScreenUtil().setWidth(10),bottom:ScreenUtil().setWidth(5)),
  306. child: Text(
  307. "已尝试方法",
  308. style: TextStyle(
  309. // fontSize:ScreenUtil().setSp(14),
  310. ),
  311. textAlign:TextAlign.left,
  312. ),
  313. ),
  314. ],
  315. ),
  316. Container(
  317. height:120,
  318. padding: EdgeInsets.only(left:ScreenUtil().setWidth(15),right:ScreenUtil().setWidth(15),bottom:ScreenUtil().setWidth(20)),
  319. child: TextFormField(
  320. // autofocus: true,
  321. maxLength: 50,
  322. cursorColor: Color(0xffcccccc),
  323. controller: _methodController,
  324. maxLines:5,
  325. decoration: InputDecoration(
  326. contentPadding: EdgeInsets.all(0),
  327. hintText: '请详细描述已尝试方法以及结果',
  328. hintStyle:TextStyle(
  329. color: Color(0xffcccccc),
  330. // fontSize: ScreenUtil().setSp(14),
  331. ),
  332. focusedBorder: InputBorder.none,
  333. border: InputBorder.none,
  334. // filled: true, // 背景色
  335. // fillColor: Colors.cyan.withAlpha(35),
  336. // icon: Icon(Icons.person)
  337. ),
  338. // 校验
  339. validator: (val) {
  340. return val.trim().length > 0 ? null : "不能为空";
  341. }
  342. ),
  343. ),
  344. SizedBox(
  345. height:6,
  346. child: Container(
  347. color:ThemeUtils.getDialogTextFieldColor(context)
  348. ),
  349. ),
  350. Container(
  351. width: width,
  352. padding: EdgeInsets.only(left:15,top:15),
  353. child: Text(
  354. "上传图片:",
  355. style: TextStyle(
  356. fontSize:
  357. ScreenUtil()
  358. .setSp(14),
  359. ),
  360. textAlign: TextAlign.left,
  361. ),
  362. ),
  363. Container(
  364. color: ThemeUtils.getTabsBg(context),
  365. child: GridView.builder(
  366. shrinkWrap: true,
  367. padding: const EdgeInsets.fromLTRB(8.0, 12, 8.0, 12.0),
  368. physics: NeverScrollableScrollPhysics(),
  369. gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
  370. crossAxisCount: 3, childAspectRatio: 1.18),
  371. itemCount: imagesUrl.length >= 9 ? 9 : imagesUrl.length + 1,
  372. itemBuilder: (_, index) {
  373. return Stack(
  374. children: <Widget>[
  375. Center(
  376. child: SelectedImage(
  377. image: index < imagesUrl.length ? imagesUrl[index] : null,
  378. index:index,
  379. onTap: () {
  380. if(index >= imagesUrl.length){
  381. selectPicker("image");
  382. }
  383. FocusScope.of(context).requestFocus(FocusNode());
  384. print(index);
  385. print(imagesUrl);
  386. }),
  387. ),
  388. index < imagesUrl.length?Positioned(
  389. top:0,
  390. right:0,
  391. child:GestureDetector(
  392. onTap: (){
  393. print(index);
  394. imagesUrl.remove(imagesUrl[index]);
  395. setState(() {
  396. });
  397. },
  398. child:Icon(
  399. IconData(
  400. 0xe62a,
  401. fontFamily:"myfont"
  402. ),
  403. size: 24.0,
  404. color:Color(0xff999999),
  405. ),
  406. )
  407. ):Container(child: null,)
  408. ],
  409. );
  410. },
  411. )
  412. ),
  413. SizedBox(
  414. height:6,
  415. child: Container(
  416. color:ThemeUtils.getDialogTextFieldColor(context)
  417. ),
  418. ),
  419. Container(
  420. width: width,
  421. padding: EdgeInsets.only(left:15,top:15),
  422. child: Text(
  423. "上传视频:",
  424. style: TextStyle(
  425. fontSize:
  426. ScreenUtil()
  427. .setSp(14),
  428. ),
  429. textAlign: TextAlign.left,
  430. ),
  431. ),
  432. Container(
  433. width: width,
  434. padding: EdgeInsets.only(left:15,bottom:15),
  435. child: Text(
  436. "(建议时长3分钟,建议大小50M)",
  437. style: TextStyle(
  438. color: Colors.red,
  439. fontSize:
  440. ScreenUtil()
  441. .setSp(14),
  442. ),
  443. textAlign: TextAlign.left,
  444. ),
  445. ),
  446. // Container(
  447. // color: ThemeUtils.getTabsBg(context),
  448. // child: GridView.builder(
  449. // shrinkWrap: true,
  450. // padding: const EdgeInsets.fromLTRB(8.0, 12, 8.0, 12.0),
  451. // physics: NeverScrollableScrollPhysics(),
  452. // gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
  453. // crossAxisCount: 3, childAspectRatio: 1.18),
  454. // itemCount: videoUrl.length >= 1 ? 1 : videoUrl.length + 1,
  455. // itemBuilder: (_, index) {
  456. // return Stack(
  457. // children: <Widget>[
  458. // Center(
  459. // child: SelectedImage(
  460. // image: index < videoUrl.length ? imagesUrlVideo[index] : null,
  461. // index:index,
  462. // onTap: () {
  463. // if(index >= videoUrl.length){
  464. // selectPicker("video");
  465. // }
  466. // FocusScope.of(context).requestFocus(FocusNode());
  467. // print(index);
  468. // print(videoUrl);
  469. // }),
  470. // ),
  471. // index < videoUrl.length?Positioned(
  472. // top:0,
  473. // right:0,
  474. // child:GestureDetector(
  475. // onTap: (){
  476. // print(index);
  477. // videoUrl.remove(videoUrl[index]);
  478. // imagesUrlVideo.remove(imagesUrlVideo[index]);
  479. // setState(() {
  480. // });
  481. // },
  482. // child:Icon(
  483. // IconData(
  484. // 0xe62a,
  485. // fontFamily:"myfont"
  486. // ),
  487. // size: 24.0,
  488. // color:Color(0xff999999),
  489. // ),
  490. // )
  491. // ):Container(child: null,)
  492. // ],
  493. // );
  494. // },
  495. // )
  496. // ),
  497. Container(
  498. color: ThemeUtils.getDialogTextFieldColor(context),
  499. child: GridView.builder(
  500. shrinkWrap: true,
  501. padding: const EdgeInsets.fromLTRB(8.0, 12, 8.0, 12.0),
  502. physics: NeverScrollableScrollPhysics(),
  503. gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
  504. crossAxisCount: 1, childAspectRatio: 1.18),
  505. itemCount: 1,
  506. itemBuilder: (_, index) {
  507. return Stack(
  508. children: <Widget>[
  509. Center(
  510. child: SelectedVideo(
  511. image: videoUrl,
  512. index: index,
  513. videoPlay:videoPlay(),
  514. onTap: () {
  515. if(videoUrl == null){
  516. selectPicker("video");
  517. }
  518. },
  519. ),
  520. ),
  521. videoUrl != null
  522. ? Positioned(
  523. top: 0,
  524. right: 0,
  525. child: GestureDetector(
  526. onTap: () {
  527. print(index);
  528. // imagesUrl = null;
  529. setState(() {
  530. videoUrl = null;
  531. str = null;
  532. _controller.pause();
  533. // player.reset();
  534. });
  535. },
  536. child: Icon(
  537. IconData(0xe62a, fontFamily: "myfont"),
  538. size: 24.0,
  539. color: Color(0xff999999),
  540. ),
  541. ),
  542. )
  543. : Container(
  544. child: null,
  545. )
  546. ],
  547. );
  548. },
  549. ),
  550. ),
  551. ],
  552. ),
  553. )
  554. ]
  555. )
  556. ),
  557. Positioned(
  558. bottom:0,
  559. left:0,
  560. child:Container(
  561. width: width,
  562. padding: EdgeInsets.only(top:ScreenUtil().setWidth(15),bottom:ScreenUtil().setWidth(15),left:ScreenUtil().setWidth(25),right:ScreenUtil().setWidth(25)),
  563. color:ThemeUtils.getDialogTextFieldColor(context),
  564. child: Container(
  565. height:ScreenUtil().setWidth(44),
  566. decoration: BoxDecoration(
  567. borderRadius: BorderRadius.circular(22.0),
  568. gradient: const LinearGradient(
  569. colors: [Color(0xFF00D9FF), Color(0xFF0287FF)]),
  570. ),
  571. child: FlatButton(
  572. // padding: EdgeInsets.all(15.0),
  573. child: Text("提交"),
  574. textColor: Colors.white,
  575. // textColor: Colors.white,
  576. onPressed: () {
  577. // if(imagesUrl.length<1){
  578. // toasts("请上传图片");
  579. // return;
  580. // }
  581. String imgs = "";
  582. if(imagesUrl.length > 0){
  583. imgs = imagesUrl.join(",");
  584. }
  585. // String videoImgs = "";
  586. // if(videoUrl.length > 0){
  587. // videoImgs = videoUrl.join(",");
  588. // }
  589. if((_formKey.currentState as FormState).validate()){
  590. dynamic obj = {
  591. "dataTable":"1",
  592. "brandId":widget.brandId,
  593. "expression":_questionController.text,
  594. "usedMethods":_methodController.text,
  595. "imgs":imgs,
  596. "videoUrl":videoUrl,
  597. "createUserId":int.parse(flustars.SpUtil.getString(Constant.userId)),
  598. "chargerId":1
  599. };
  600. showLoading(context, "正在提交...");
  601. NewApiService().createCase(obj, onSuccess: (res) {
  602. dismissLoading(context);
  603. toasts("提交成功");
  604. FocusScope.of(context).requestFocus(FocusNode());
  605. print(res);
  606. print(999999);
  607. setDataId(res);
  608. setType("1");
  609. print(widget.brandId);
  610. NavigatorUtils.push(context, "${BbsRouter.expertList}?id=${widget.brandId}");
  611. }, onError: (code, msg) {
  612. dismissLoading(context);
  613. toasts(msg);
  614. });
  615. }
  616. },
  617. ),
  618. ),
  619. )
  620. )
  621. ]
  622. ),
  623. ),
  624. );
  625. }
  626. void setDataId (int id)async{
  627. SharedPreferences prefs = await SharedPreferences.getInstance();
  628. prefs.setInt("dataId", id);
  629. }
  630. void setType (String type)async{
  631. SharedPreferences prefs = await SharedPreferences.getInstance();
  632. prefs.setString("questionType", type);
  633. }
  634. Widget videoPlay() {
  635. _controller = VideoPlayerController.network(
  636. Utils.getImagePath(videoUrl)
  637. // imgFontUrl + detailObj.url
  638. );
  639. double width = MediaQuery.of(context).size.width;
  640. return
  641. // Container(
  642. // width: width,
  643. // height: width*0.6,
  644. // alignment: Alignment.center,
  645. // child: FijkView(
  646. // player: player,
  647. // color: Colors.black,
  648. // fit:FijkFit.fill,
  649. // // cover: NetworkImage(detailObj.cover),
  650. // // cover: new Image(image: detailObj.cover!=null&& detailObj.cover!=""?NetworkImage(detailObj.cover):AssetImage("assets/images/video_image.png"),).image,
  651. // //
  652. // ),
  653. // );
  654. Container(
  655. padding: EdgeInsets.only(
  656. left: ScreenUtil().setWidth(15),
  657. right: ScreenUtil().setWidth(15),
  658. top: ScreenUtil().setWidth(15)),
  659. child: ClipRRect(
  660. borderRadius: BorderRadius.circular(5),
  661. child:
  662. new Chewie(
  663. controller: ChewieController(
  664. videoPlayerController:
  665. // VideoPlayerController.network(
  666. // imgFontUrl + detailObj.url
  667. // ),
  668. _controller,
  669. aspectRatio: 3 / 2,
  670. allowFullScreen:false,
  671. autoPlay: false,
  672. looping: true,
  673. // startAt: Duration(seconds: 1,minutes: 1),
  674. showControls: true,
  675. deviceOrientationsAfterFullScreen:[DeviceOrientation.portraitUp],
  676. // 占位图
  677. // placeholder: Image.network(
  678. // imgFontUrl+detailObj.cover,
  679. // fit: BoxFit.contain,
  680. // ),
  681. // 是否在 UI 构建的时候就加载视频
  682. autoInitialize: true,
  683. // 拖动条样式颜色
  684. materialProgressColors:
  685. new ChewieProgressColors(
  686. playedColor: Colors.red,
  687. handleColor: Colors.blue,
  688. backgroundColor: Colors.grey,
  689. bufferedColor: Colors.lightGreen,
  690. ),
  691. ),
  692. ),
  693. )
  694. );
  695. }
  696. }