简体   繁体   中英

Flutter InteractiveViewer not panning/scrolling

InteractiveViewer(
  child: FlutterLogo(size: 1000),
)

FlutterLogo is bigger than the viewport and thus I wrapped it inside InteractiveViewer but it is not panning. I checked panEnabled and it is true by default. What am I missing?

If your widget is greater than viewport, you'll need to set constrained to false .

constrained : If set to false, then the child will be given infinite constraints. This is often useful when a child should be bigger than the InteractiveViewer.

InteractiveViewer(
  constrained: false, // Set it to false
  child: FlutterLogo(size: 1000),
)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM