anchor.diff:      );
     }
   
  -  void handleBannerPointerDown(sky.PointerEvent event) {
  -    initialize();
  -    app.scheduleBuild();
  +  void handleToolbarPointerDown(sky.PointerEvent event) {
  +    setState(() {
  +      resetGame();
  +    });
     }
   
     // User action. The user uncovers the cell which can cause losing the game.
     void probe(int x, int y) {
       if (!alive)
         return;
  -    if (uiState[y][x] == flaggedCell)
  -      return;
  -    // Allowed to probe.
  -    if (cells[y][x]) {
  -      // Probed on a mine --> dead!!
  -      uiState[y][x] = explodedCell;
  -      alive = false;
  -    } else {
  -      // No mine, uncover nearby if possible.
  -      cull(x, y);
  -    }
  -    app.scheduleBuild();
  +    if (uiState[y][x] == CellState.flagged)
  +      return;
  +    setState(() {
  +      // Allowed to probe.
  +      if (cells[y][x]) {
  +        // Probed on a mine --> dead!!
  +        uiState[y][x] = CellState.exploded;
  +        alive = false;
  +      } else {
  +        // No mine, uncover nearby if possible.
  +        cull(x, y);
  +      }
  +    });
     }
   
     // User action. The user is sure a mine is at this location.
     void flag(int x, int y) {
  -    if (uiState[y][x] == flaggedCell) {
  -      uiState[y][x] = coveredCell;
  -      --detectedCount;
  -    } else {
  -      uiState[y][x] = flaggedCell;
  -      ++detectedCount;
  -    }
  -    app.scheduleBuild();
  +    setState(() {
  +      if (uiState[y][x] == CellState.flagged) {
  +        uiState[y][x] = CellState.covered;
  +        --detectedCount;
  +      } else {
  +        uiState[y][x] = CellState.flagged;
  +        ++detectedCount;
  +      }
  +    });
     }
   
     // Recursively uncovers cells whose totalMineCount is zero.
  
positive.code:   }
  }
  
  Widget makeCell(Widget widget) {
    return new Container(
      padding: new EdgeDims.all(1.0),
      height: 27.0, width: 27.0,
      decoration: new BoxDecoration(backgroundColor: const Color(0xFFC0C0C0)),
      margin: new EdgeDims.all(2.0),
      child: widget);
  }
  
  Widget makeInnerCell(Widget widget) {
    return new Container(
      padding: new EdgeDims.all(1.0),
      margin: new EdgeDims.all(3.0),
      height: 17.0, width: 17.0,
      child: widget);
  }
  
  class CoveredMineNode extends Component {
    final Game game;
    final bool flagged;
    final int posX;
    final int posY;
    Stopwatch stopwatch;
  
    CoveredMineNode(this.game, {this.flagged, this.posX, this.posY});
  
    void _handlePointerDown(sky.PointerEvent event) {
      if (event.buttons == 1) {
        game.probe(posX, posY);
      } else if (event.buttons == 2) {
        game.flag(posX, posY);
      } else {
        // Touch event.
        stopwatch = new Stopwatch()..start();
      }
    }
  
    void _handlePointerUp(sky.PointerEvent event) {
      if (stopwatch == null)
        return;
      // Pointer down was a touch event.
      if (stopwatch.elapsedMilliseconds < 250) {
        game.probe(posX, posY);
      } else {
        // Long press flags.
        game.flag(posX, posY);
      }
      stopwatch = null;
    }
  
    Widget build() {
      Widget text = flagged ?
        makeInnerCell(new StyledText(elements : [Game.textStyles[5], '\u2691'])) :
        null;
  
      Container inner = new Container(
        margin: new EdgeDims.all(2.0),
        height: 17.0, width: 17.0,
        decoration: new BoxDecoration(backgroundColor: const Color(0xFFD9D9D9)),
        child: text);
  
      return makeCell(new Listener(
        child: inner,
        onPointerDown: _handlePointerDown,
        onPointerUp: _handlePointerUp));
    }
  }
  
  class ExposedMineNode extends Component {
    final int state;
    final int count;
  
    ExposedMineNode({this.state, this.count});
  
    Widget build() {
      StyledText text;
      if (state == Game.clearedCell) {
        // Uncovered cell with nearby mine count.
        if (count != 0)
          text = new StyledText(elements : [Game.textStyles[count], '$count']);
      } else {
        // Exploded mine or shown mine for 'game over'.
        int color = state == Game.explodedCell ? 3 : 0;
        text = new StyledText(elements : [Game.textStyles[color], '\u2600']);
      }
  
      return makeCell(makeInnerCell(text));
    }
  }
  
  class MineDiggerApp extends App {
    Game game;
  
    MineDiggerApp() {
      game = new Game(this);
    }
  
    Widget build() {
      return game.buildUI();
    }
  }
  
  void main() {
  
negative.code:     }
  
      return new Container(
        padding: new EdgeDims.all(10.0),
        margin: new EdgeDims.all(10.0),
        decoration: new BoxDecoration(backgroundColor: const Color(0xFF6B6B6B)),
        child: new Flex(
          flexRows,
          direction: FlexDirection.vertical
        )
      );
    }
  
    Widget buildToolBar() {
      String toolbarCaption = hasWon ?
        'Awesome!!' : alive ?
          'Mine Digger [$detectedCount-$totalMineCount]': 'Kaboom! [press here]';
  
      return new ToolBar(
        // FIXME: Strange to have the toolbar be tapable.
        center: new Listener(
          onPointerDown: handleToolbarPointerDown,
          child: new Text(toolbarCaption, style: Theme.of(this).text.title)
        )
      );
    }
  
    Widget build() {
      // We build the board before we build the toolbar because we compute the win state during build step.
      Widget board = buildBoard();
      return new TaskDescription(
        label: 'Mine Digger',
  