diff --git a/assets/images/wiper.png b/assets/images/wiper.png new file mode 100644 index 0000000..6f6519a Binary files /dev/null and b/assets/images/wiper.png differ diff --git a/assets/images/zoom_in.png b/assets/images/zoom_in.png new file mode 100644 index 0000000..6c7b58c Binary files /dev/null and b/assets/images/zoom_in.png differ diff --git a/assets/images/zoom_out.png b/assets/images/zoom_out.png new file mode 100644 index 0000000..0abbc42 Binary files /dev/null and b/assets/images/zoom_out.png differ diff --git a/lib/widget/my_superplayer.dart b/lib/widget/my_superplayer.dart index 9be2dd8..04e2db3 100644 --- a/lib/widget/my_superplayer.dart +++ b/lib/widget/my_superplayer.dart @@ -146,6 +146,8 @@ class _SuperPlayerPageState extends State with SuperPlayerListe int btnCount = 4; //每行按钮个数 int btnCount3 = listData.length; //每行按钮个数 var mediaSize = MediaQuery.of(context).size; + double btn_left = 70; //第一按钮行高度 + double btn_gap = 70; //第一按钮行高度 //远程控制球机方向按钮外半径和内半径 double _outerRadius = 270; double _innerRadius = _outerRadius / 2; @@ -245,7 +247,7 @@ class _SuperPlayerPageState extends State with SuperPlayerListe ? SizedBox.shrink() : Row( children: [ - SizedBox(width: ScreenUtil().setWidth(347)), + SizedBox(width: ScreenUtil().setWidth(btn_left)), getRoundButton( //(bPlaying) ? '暂停' : '播放', text: playerRegionProvide.playerText, @@ -253,7 +255,7 @@ class _SuperPlayerPageState extends State with SuperPlayerListe diameter: 130, onPress: playOrPause, ), - SizedBox(width: ScreenUtil().setWidth(104)), + SizedBox(width: ScreenUtil().setWidth(btn_gap)), getRoundButton( text: '刷新', icon: Icons.autorenew, @@ -262,6 +264,35 @@ class _SuperPlayerPageState extends State with SuperPlayerListe restartPlay(urlnew); }, ), + SizedBox(width: ScreenUtil().setWidth(btn_gap)), + getRoundButton_image( + text: '雨刷', + image_path: 'assets/images/wiper.png', + diameter: 130, + onPress: () {}, + ), + SizedBox(width: ScreenUtil().setWidth(btn_gap)), + getRoundButton_image( + text: '放大', + image_path: 'assets/images/zoom_in.png', + imageSize: 72, + diameter: 130, + onPress: () { + // 云台控制代码:1:停止动作、3:启动雨刷、11:焦距变大、12:焦距变小 + setSphericalCameraDio(id: widget.id, dwip: widget.dwip, cmdCode: 11); + }, + ), + SizedBox(width: ScreenUtil().setWidth(btn_gap)), + getRoundButton_image( + text: '缩小', + image_path: 'assets/images/zoom_out.png', + imageSize: 72, + diameter: 130, + onPress: () { + // 云台控制代码:1:停止动作、3:启动雨刷、11:焦距变大、12:焦距变小 + setSphericalCameraDio(id: widget.id, dwip: widget.dwip, cmdCode: 12); + }, + ), ], ), bFullScreen ? SizedBox.shrink() : SizedBox(height: ScreenUtil().setHeight(79)), @@ -438,7 +469,7 @@ class _SuperPlayerPageState extends State with SuperPlayerListe _addLog('onStartFloatWindowPlay', {}); } - //生成圆形按钮部件 + //生成圆形按钮部件,基于图标 Widget getRoundButton( {double diameter = 144, double marginVer = 10, @@ -474,6 +505,47 @@ class _SuperPlayerPageState extends State with SuperPlayerListe ); } + //生成圆形按钮部件,基于图片 + Widget getRoundButton_image( + {double diameter = 144, + double marginVer = 10, + String text, + String image_path, + double fontSize = 16, + double imageSize = 90, + Color color = const Color.fromRGBO(52, 157, 237, 1), + var onPress}) { + return InkWell( + onTap: onPress, + child: Column( + children: [ + Container( + width: ScreenUtil().setWidth(diameter), + height: ScreenUtil().setHeight(diameter), + alignment: Alignment.center, + child: Image.asset(image_path, + fit: BoxFit.fitWidth, + width: ScreenUtil().setWidth(imageSize), + //height: ScreenUtil().setWidth(iconSize), + color: Color.fromRGBO(52, 157, 237, 1)), + // child: Icon( + // icon, + // size: ScreenUtil().setWidth(iconSize), + // color: Color.fromRGBO(52, 157, 237, 1), + // ), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(200)), + border: Border.all(width: 0, style: BorderStyle.none), + ), + ), + SizedBox(height: ScreenUtil().setHeight(marginVer)), + Text(text, style: TextStyle(fontSize: fontSize, color: Color.fromRGBO(139, 139, 139, 1))), + ], + ), + ); + } + bool bPlaying = true; void playOrPause() {