diff --git a/examples/flutter_gallery/lib/demo/transformations/transformations_demo.dart b/examples/flutter_gallery/lib/demo/transformations/transformations_demo.dart index 1d070ae211..4a5bf99339 100644 --- a/examples/flutter_gallery/lib/demo/transformations/transformations_demo.dart +++ b/examples/flutter_gallery/lib/demo/transformations/transformations_demo.dart @@ -35,7 +35,21 @@ class _TransformationsDemoState extends State { // The scene is drawn by a CustomPaint, but user interaction is handled by // the GestureTransformable parent widget. return Scaffold( - appBar: AppBar(), + appBar: AppBar( + title: const Text('2D Tranformations'), + actions: [ + IconButton( + icon: const Icon(Icons.help), + tooltip: 'Help', + onPressed: () { + showDialog( + context: context, + builder: (BuildContext context) => instructionDialog, + ); + }, + ), + ], + ), body: LayoutBuilder( builder: (BuildContext context, BoxConstraints constraints) { // Draw the scene as big as is available, but allow the user to @@ -71,6 +85,31 @@ class _TransformationsDemoState extends State { ); } + Widget get instructionDialog { + return AlertDialog( + title: const Text('2D Transformations'), + content: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: const [ + Text('Tap to edit hex tiles, and use gestures to move around the scene:\n'), + Text('- Drag to pan.'), + Text('- Pinch to zoom.'), + Text('- Rotate with two fingers.'), + Text('\nYou can always press the home button to return to the starting orientation!'), + ], + ), + actions: [ + FlatButton( + child: const Text('OK'), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ], + ); + } + FloatingActionButton get resetButton { return FloatingActionButton( onPressed: () {