diff --git a/packages/flutter/lib/src/widgets/interactive_viewer.dart b/packages/flutter/lib/src/widgets/interactive_viewer.dart index 456ee04ac8..6f7eb58497 100644 --- a/packages/flutter/lib/src/widgets/interactive_viewer.dart +++ b/packages/flutter/lib/src/widgets/interactive_viewer.dart @@ -34,7 +34,7 @@ import 'ticker_provider.dart'; /// * 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_no_null_safety} +/// {@tool dartpad --template=stateless_widget_scaffold} /// This example shows a simple Container that can be panned and zoomed. /// /// ```dart @@ -151,7 +151,7 @@ class InteractiveViewer extends StatefulWidget { /// /// Defaults to true. /// - /// {@tool dartpad --template=stateless_widget_scaffold_no_null_safety} + /// {@tool dartpad --template=stateless_widget_scaffold} /// This example shows how to create a pannable table. Because the table is /// larger than the entire screen, setting `constrained` to false is necessary /// to allow it to be drawn to its full size. The parts of the table that @@ -305,19 +305,19 @@ class InteractiveViewer extends StatefulWidget { /// listeners are notified. If the value is set, InteractiveViewer will update /// to respect the new value. /// - /// {@tool dartpad --template=stateful_widget_material_ticker_no_null_safety} + /// {@tool dartpad --template=stateful_widget_material_ticker} /// This example shows how transformationController can be used to animate the /// transformation back to its starting position. /// /// ```dart /// final TransformationController _transformationController = TransformationController(); - /// Animation _animationReset; - /// AnimationController _controllerReset; + /// Animation? _animationReset; + /// late final AnimationController _controllerReset; /// /// void _onAnimateReset() { - /// _transformationController.value = _animationReset.value; + /// _transformationController.value = _animationReset!.value; /// if (!_controllerReset.isAnimating) { - /// _animationReset?.removeListener(_onAnimateReset); + /// _animationReset!.removeListener(_onAnimateReset); /// _animationReset = null; /// _controllerReset.reset(); /// } @@ -329,7 +329,7 @@ class InteractiveViewer extends StatefulWidget { /// begin: _transformationController.value, /// end: Matrix4.identity(), /// ).animate(_controllerReset); - /// _animationReset.addListener(_onAnimateReset); + /// _animationReset!.addListener(_onAnimateReset); /// _controllerReset.forward(); /// } ///