Flutter 如何在flatter中缩放页面

Flutter 如何在flatter中缩放页面,flutter,Flutter,我想用一个按钮来缩放我的页面,不仅仅是图像,它还使用了手势提示 Zoom( width: 1800, height: 1800, child: Center( child: Text("Happy zoom!!"), ) ); 或 ,使用控制器设置刻度: ZoomerController _zoomerController = ZoomerController(initialScale: 1.0); String _z


我想用一个按钮来缩放我的页面,不仅仅是图像,它还使用了手势提示

Zoom(
    width: 1800,
    height: 1800,
    child: Center(
        child: Text("Happy zoom!!"),
    )
);

,使用控制器设置刻度:

  ZoomerController _zoomerController = ZoomerController(initialScale: 1.0);
  String _zoomDetails = "Zoom";  

  @override
  Widget build(BuildContext context) {

    _zoomerController.onZoomUpdate((){
      setState(() {
        _zoomDetails = "Scale = "+ _zoomerController.scale.toStringAsFixed(2);
        _zoomDetails += "\nRotation = "+ _zoomerController.rotation.toStringAsFixed(2);
        _zoomDetails += "\nOffset = ("+ _zoomerController.offset.dx.toStringAsFixed(2)+","+_zoomerController.offset.dy.toStringAsFixed(2)+")";
      });
    });

    return Scaffold(
      appBar: AppBar(title: Text("Zommer Example"),),
      body:
        Center(child:
        Stack(
          children: [
            Align(alignment: Alignment.topCenter,child: SizedBox(height: 150,child: Text(_zoomDetails,textAlign: TextAlign.center,style: TextStyle(fontSize: 30),))),
            Center(
              child: 
                Zoomer(
                  enableTranslation: true,
                  enableRotation: true,
                  clipRotation: true,
                  maxScale: 2,
                  minScale: 0.5,
                  background:BoxDecoration(color: Colors.white),
                  height: 300,
                  width: 300,
                  controller: _zoomerController,
                  child: Container(decoration: BoxDecoration(color: Colors.green),height: 200,width: 200,child: FlutterLogo(),)),
            ),
          ])),
    );
  }
}

欢迎来到堆栈溢出!我想和大家分享一些建议,让大家尝试改进自己的文章和未来的文章,尝试分享更多信息,比如,您尝试过的内容、您拥有的代码片段以及您正在尝试实现的内容。在这种情况下,我不确定您是否要添加缩放功能或浮动按钮。我建议您用更多信息编辑您的问题。检查您使用的标签。您标记了这个“zoom sdk”,这是zoom平台的sdk。你是那个意思吗?