From ce63f507336fa86278204dfac2b9a9546f81ab96 Mon Sep 17 00:00:00 2001 From: Justin McCandless Date: Tue, 18 Aug 2020 23:51:04 -0700 Subject: [PATCH] Document how to size IV's child correctly, after seeing confusion in Github issues (#64100) --- .../lib/src/widgets/interactive_viewer.dart | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/flutter/lib/src/widgets/interactive_viewer.dart b/packages/flutter/lib/src/widgets/interactive_viewer.dart index 7e47be3368..15ea87b4d7 100644 --- a/packages/flutter/lib/src/widgets/interactive_viewer.dart +++ b/packages/flutter/lib/src/widgets/interactive_viewer.dart @@ -19,8 +19,23 @@ import 'ticker_provider.dart'; /// /// The user can transform the child by dragging to pan or pinching to zoom. /// +/// By default, InteractiveViewer may draw outside of its original area of the +/// screen, such as when a child is zoomed in and increases in size. However, it +/// will not receive gestures outside of its original area. To prevent +/// InteractiveViewer from drawing outside of its original size, wrap it in a +/// [ClipRect]. Or, to prevent dead areas where InteractiveViewer does not +/// receive gestures, be sure that the InteractiveViewer widget is the size of +/// the area that should be interactive. See +/// [flutter-go](https://github.com/justinmc/flutter-go) for an example of +/// robust positioning of an InteractiveViewer child that works for all screen +/// sizes and child sizes. +/// /// The [child] must not be null. /// +/// See also: +/// * The [Flutter Gallery's transformations demo](https://github.com/flutter/gallery/blob/master/lib/demos/reference/transformations_demo.dart), +/// which includes the use of InteractiveViewer. +/// /// {@tool dartpad --template=stateless_widget_scaffold} /// This example shows a simple Container that can be panned and zoomed. ///