anchor.diff:  // is governed by a BSD-style license that can be found in the LICENSE file.
   
   import 'dart:html';
  +import 'dart:async';
   import 'dart:convert';
   
   final int powerHeight = 85;
  
positive.code:       HttpRequest.postFormData("/translationimages", {"file": reader.result, "filename": file.name}).then((HttpRequest response) {
          List parsedList = JSON.decode(response.response);
          List images = [];
          CanvasElement canvas = new CanvasElement();
          for (var url in parsedList) {
            ImageElement image = new ImageElement()
              ..src = url;
  
negative.code:   });
  }
  
  Future loadImages(List<ImageElement> imgs) {
    List<Future> imageFutures = [];
    for (var i = 0; i < imgs.length; i++) {
      var img = imgs[i];
      imageFutures.add(img.onLoad.first);
    }
  
    return Future.wait(imageFutures);
  }
  
  initCanvas(List<ImageElement> imgs, CanvasElement canvas) {
    CanvasRenderingContext2D context = canvas.getContext('2d');
    int totalHeight;
    loadImages(imgs).then((images) {
      totalHeight = imgs[0].height * imgs.length;
      canvas
        ..width = imgs[0].width
        ..height = totalHeight;
  
      for (var i = 0; i < imgs.length; i++) {
        context.drawImage(imgs[i], 0, imgs[i].height * i);
      }
      querySelector("body").append(canvas);
    });
  }
  
  