anchor.diff:        'white70': Colors.white70,
       }),
     ];
  -  print('This app will display a sequence of images. For each one, tap "s"');
  -  print('in the console to take a screenshot, then tap the screen to');
  -  print('advance. When all is done, a script will be dumped that shows the');
  -  print('commands to run to convert all the screenshots to images.');
  -  print('BASH: N=1 # set this to the number of the first screenshot file');
  -  Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{};
  +  print(
  +    'This app will display a sequence of images. For each one, tap "s" in the console to take '
  +    'a screenshot, then tap the screen to advance. When all is done, a script will be dumped that '
  +    'shows the commands to run to convert all the screenshots to images.'
  +  );
  +  StringBuffer buffer = new StringBuffer();
     for (Page page in pages) {
  -    routes['/' + page.filename] = page.build;
  -    print('COLOR: ${page.filename}');
  +    Completer<Null> completer = new Completer<Null>();
  +    runApp(
  +      new GestureDetector(
  +        onTap: () { completer?.complete(); completer = null; },
  +        child: new MaterialApp(
  +          home: new Material(
  +            color: Colors.white,
  +            child: new Center(
  +              child: new Builder(builder: page.build),
  +            ),
  +          ),
  +        ),
  +      ),
  +    );
  +    await SchedulerBinding.instance.endOfFrame;
  +    final Rect area = page.interestingArea;
  +    buffer.writeln('BASH: convert flutter_`printf %02d \$N`.png -crop ${area.width}x${area.height}+${area.left}+${area.top} -resize \'400x600>\' ${page.filename}.png; ((N++))');
  +    await completer.future;
     }
  -  runApp(new MaterialApp(onGenerateRoute: (RouteSettings settings) {
  -    if (settings.isInitialRoute &&
  -        settings.name == Navigator.defaultRouteName) {
  -      return new MaterialPageRoute<Null>(
  -        builder: (BuildContext context) {
  -          return new HomePage(pages);
  -        },
  -        settings: settings,
  -      );
  -    } else {
  -      return new MaterialPageRoute<Null>(
  -        builder: routes[settings.name],
  -        settings: settings,
  -      );
  -    }
  -  }));
  +  debugPrint('BASH: N=1 # set this to the number of the first screenshot file\n$buffer');
   }
  
positive.code:           mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: <Widget>[
              new Text(key, style: style),
              new Text('0x${textColor.value.toRadixString(16).toUpperCase()}',
                  style: style),
            ],
          ),
        ));
      }
      return buildSwatch(
          context,
          new Material(
            color: Colors.white,
            child: new Center(
              child: new Container(
                key: key,
                width: 300.0,
                color: background,
                child: new Column(
                  mainAxisSize: MainAxisSize.min,
                  children: items,
                ),
              ),
            ),
          ));
    }
  }
  
  class HomePage extends StatelessWidget {
    final List<Page> pages;
  
    HomePage(this.pages);
  
    @override
    Widget build(BuildContext context) {
      return new GestureDetector(
        onTap: () async {
          for (var page in pages.reversed) {
            Navigator.of(context).pushNamed('/' + page.filename);
          }
        },
        child: new Material(
          color: Colors.white,
          child: new Center(
              child: new Text("Tap to advance to the color swatches.")),
        ),
      );
    }
  }
  
  Future<Null> main() async {
    const List<int> palette = const <int>[
      50,
      100,
      200,
      300,
      400,
      500,
      600,
      700,
      800,
      900
    ];
    const List<int> accentPalette = const <int>[100, 200, 400, 700];
    const List<int> greyPalette = const <int>[
      50,
      100,
      200,
      300,
      350,
      400,
      500,
      600,
      700,
      800,
      850,
      900
    ];
    final List<Page> pages = <Page>[
      const SwatchPage('Colors.red', Colors.red, palette),
      const SwatchPage('Colors.pink', Colors.pink, palette),
  
negative.code:           mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: <Widget>[
              new Text(label, style: style),
              new Text('0x${swatch[key].value.toRadixString(16).toUpperCase()}', style: style),
            ],
          ),
        ));
      }
      return new Container(
        key: key,
        width: 300.0,
        child: new Column(
          mainAxisSize: MainAxisSize.min,
          children: items,
        ),
      );
    }
  }
  
  