Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Import 如果我有一个;不知道如何加载';dart:html'&引用;何时加载库?_Import_Libraries_Dart - Fatal编程技术网

Import 如果我有一个;不知道如何加载';dart:html'&引用;何时加载库?

Import 如果我有一个;不知道如何加载';dart:html'&引用;何时加载库?,import,libraries,dart,Import,Libraries,Dart,我的dart库中的前两行是: #library('LibraryName'); #import('dart:html'); 当我尝试使用从另一个.dart文件加载库时 #import('../path/to/LibraryName.dart'); 我得到以下错误: Do not know how to load 'dart:html''file:///the/path/to/LibraryName.dart': Error: line 2 pos 1: library handler fai

我的dart库中的前两行是:

#library('LibraryName');
#import('dart:html');
当我尝试使用从另一个.dart文件加载库时

#import('../path/to/LibraryName.dart');
我得到以下错误:

Do not know how to load 'dart:html''file:///the/path/to/LibraryName.dart': Error: line 2 pos 1: library handler failed
#import('dart:html');
^
当我将库作为独立应用程序使用时,
#import('dart:html')
可以正常工作,但我希望能够从另一个dart应用程序作为库访问它

我如何使用图书馆?

你必须这样做

#import("../path/to/fileContaingLibrary.dart");
加上图书馆系统很快就要改变了

注意:Dart中的库系统将更改。本节介绍 它目前的工作原理


dart:html仅在浏览器端可用。看起来您正在尝试在服务器端使用dart.exe运行客户端脚本

dart:html在浏览器上可用(并与DOM交互)
dart:io在服务器上可用(并与操作系统交互)

Oops,这就是我在代码中得到的,我只是没有正确地将它输入问题中。我现在更新了这个问题。