anchor.diff:  
   import 'dart:async';
   import 'dart:io';
  +import 'dart:typed_data';
  +import 'dart:ui' as ui
  +    show Image, Codec, FrameInfo, instantiateImageCodec, ImageByteFormat;
   
   import 'package:flutter_test/flutter_test.dart';
   import 'package:flutter/material.dart';
  +import 'package:flutter/foundation.dart';
   import 'package:path/path.dart' as path;
   import 'package:palette_generator/palette_generator.dart';
  +
  +/// An image provider implementation for testing that takes a pre-loaded image.
  +/// This avoids handling asynchronous I/O in the test zone, which is
  +/// problematic.
  +class FakeImageProvider extends ImageProvider<FakeImageProvider> {
  +  const FakeImageProvider(this._image, {this.scale = 1.0});
  +
  +  final ui.Image _image;
  +
  +  /// The scale to place in the [ImageInfo] object of the image.
  +  final double scale;
  +
  +  @override
  +  Future<FakeImageProvider> obtainKey(ImageConfiguration configuration) {
  +    return new SynchronousFuture<FakeImageProvider>(this);
  +  }
  +
  +  @override
  +  ImageStreamCompleter load(FakeImageProvider key) {
  +    assert(key == this);
  +    return new OneFrameImageStreamCompleter(
  +      new SynchronousFuture<ImageInfo>(
  +        new ImageInfo(image: _image, scale: scale),
  +      ),
  +    );
  +  }
  +}
   
   Future<ImageProvider> loadImage(String name) async {
     File imagePath = new File(path.joinAll(<String>['assets', name]));
     if (path.split(Directory.current.absolute.path).last != 'test') {
       imagePath = new File(path.join('test', imagePath.path));
     }
  -  return new FileImage(imagePath);
  -}
  -
  -void main() {
  -  test('PaletteGenerator works on 1-pixel wide blue image', () async {
  -    final ImageProvider image = await loadImage('tall_blue.png');
  +  final Uint8List data = new Uint8List.fromList(imagePath.readAsBytesSync());
  +  final ui.Codec codec = await ui.instantiateImageCodec(data);
  +  final ui.FrameInfo frameInfo = await codec.getNextFrame();
  +  return new FakeImageProvider(frameInfo.image);
  +}
  +
  +void main() async {
  +  // Load the images outside of the test zone so that IO doesn't get
  +  // complicated.
  +  final List<String> imageNames = <String>[
  +    'tall_blue',
  +    'wide_red',
  +    'dominant',
  +    'landscape'
  +  ];
  +  final Map<String, ImageProvider> testImages = <String, ImageProvider>{};
  +  for (String name in imageNames) {
  +    testImages[name] = await loadImage('$name.png');
  +  }
  +
  +  testWidgets('PaletteGenerator works on 1-pixel wide blue image',
  +      (WidgetTester tester) async {
  +    tester.pump();
  +    final ImageProvider image = testImages['tall_blue'];
       final PaletteGenerator palette =
           await PaletteGenerator.fromImageProvider(image);
       expect(palette.paletteColors.length, equals(1));
  
positive.code:     expect(palette.colors.length, equals(palette.paletteColors.length));
    });
  
    test('PaletteGenerator limits max colors', () async {
      final ImageProvider image = await loadImage('landscape.png');
      PaletteGenerator palette =
          await PaletteGenerator.fromImageProvider(image, maximumColorCount: 32);
      expect(palette.paletteColors.length, equals(31));
  
negative.code:         within<Color>(distance: 8, from: const Color(0xff0000ff)));
    });
  
    testWidgets('PaletteGenerator works on 1-pixel high red image',
        (WidgetTester tester) async {
      final ImageProvider image = testImages['wide_red'];
      final PaletteGenerator palette =
          await PaletteGenerator.fromImageProvider(image);
      expect(palette.paletteColors.length, equals(1));
  