anchor.diff:      final pubCacheDir = p.join(tempDirPath, 'pub-cache');
       final outputDir = p.join(tempDirPath, 'output');
   
  -    final pubEnv =
  -        new PubEnvironment(await DartSdk.create(), pubCacheDir: pubCacheDir);
  +    // pub cache dir needs to be created
  +    await new Directory(pubCacheDir).create(recursive: true);
  +    final pubEnv = new PubEnvironment(
  +      await DartSdk.create(),
  +      pubCacheDir: pubCacheDir,
  +      flutterSdk: envConfig.flutterSdkDir == null
  +          ? null
  +          : new FlutterSdk(sdkDir: envConfig.flutterSdkDir),
  +    );
   
       try {
         final pkgDir = await downloadPackage(task.package, task.version);
  
positive.code: import 'package:pana/src/download_utils.dart';
  import 'package:path/path.dart' as p;
  
  import '../shared/task_scheduler.dart' show Task, TaskRunner;
  
  final Logger _logger = new Logger('pub.dartdoc.runner');
  final String _hostedUrl = 'https://www.dartdocs.org';
  
  const metadataFilePath = 'doc/api/pub-dartlang-metadata.json';
  
  class DartdocRunner implements TaskRunner {
    String _cachedDartdocVersion;
  
negative.code:       await pkgDir.rename(pkgPath);
  
        // resolve dependencies
        await _resolveDependencies(pubEnv, task, pkgPath);
  
        await _generateDocs(task, pkgPath, outputDir);
  
        // TODO: upload doc/api to the appropriate bucket
      } finally {
        await tempDir.delete(recursive: true);
      }
      return false; // no race detection
    }
  
    Future _resolveDependencies(
        PubEnvironment pubEnv, Task task, String pkgPath) async {
      final pr = await pubEnv.runUpgrade(pkgPath, /* isFlutter */ false);
      if (pr.exitCode != 0) {
        _logger.severe('Error while running pub upgrade for $task.\n'
            'exitCode: ${pr.exitCode}\n'
            'stdout: ${pr.stdout}\n'
            'stderr: ${pr.stderr}\n');
        throw new Exception('pub upgrade failed with code ${pr.exitCode}');
      }
    }
  
    Future _generateDocs(Task task, String pkgPath, String outputDir) async {
  