首页 > 解决方案 > Dart 中未打印的未来价值

问题描述

    try {
      final processResult = await runGit(
          ['show', 'SDK-2.12.0-28.0.dev:pubspec.yaml'],
          processWorkingDir: '/home/anirudh/projects/pub');
      print('Awaiting git..');
      print(processResult);
    } catch (err) {
      print('Caught error: $err');
    }

输出是:等待 git .. 'ProcessResult' 的实例

为什么我没有得到 processResult 的值而只得到它的一个实例?

标签: dartasync-awaitfuture

解决方案


推荐阅读