どうも、ちょげ(@chogetarou)です。
Containerをズームできるようにする方法を紹介します。
方法
Containerをズームできるようにするには、InteractiveViewerを使います。
具体的には、ContainerをInteractiveViewerの「child」に指定します。
InteractiveViewer(
child: Container(),
),
これでContainerをズームすることが出来るようになります。
以下は、使用例です。
使用例
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: InteractiveViewer(
child: Container(
width: 350,
height: 350,
child: FittedBox(
child: Icon(Icons.flutter_dash),
),
),
),
),
);
}
コメント