大佬教程收集整理的这篇文章主要介绍了飞镖 – 颤振相机预览,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我初始化相机并打开预览:
@override Widget build(BuildContext context) { if (!_isReady) return new Container(); if (!controller.value.initialized) return new Container(); return new CameraPreview(controller); }
1)这是我称为_CameraWidgetState的类的构建方法.如何让这个预览看起来不舒展?
2)为了使CameraWidget不使用所有空间,我已经尝试将它放在一个没有运气的脚手架中:
Widget build(BuildContext context) { return new Scaffold( appBar: new AppBar( title: new Text(widget.titlE),),body: new Center( child: new CameraWidget(),bottomNavigationBar: new BottomNavigationBar( items: [ new BottomNavigationBarItem( icon: new Icon(Icons.camera),title: new Text("Left")),new BottomNavigationBarItem( icon: new Icon(Icons.favoritE),title: new Text("Right")) ],); }
任何想法或帮助表示赞赏!
@override Widget build(BuildContext context) { if (!_isReady) return new Container(); if (!controller.value.initialized) return new Container(); return new Scaffold( body: new Container( child: new AspectRatio( aspectRatio: controller.value.aspectRatio,child: new CameraPreview(controller),floaTingActionButton: new FloaTingActionButton( onPressed: _isReady ? capture : null,child: const Icon( Icons.camera,color: Colors.white,floaTingActionButtonLOCATIOn: FloaTingActionButtonLOCATIOn.centerFloat,); }
以上是大佬教程为你收集整理的飞镖 – 颤振相机预览全部内容,希望文章能够帮你解决飞镖 – 颤振相机预览所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。