Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.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
Dart 如何创建返回常量值的工厂构造函数_Dart - Fatal编程技术网

Dart 如何创建返回常量值的工厂构造函数

Dart 如何创建返回常量值的工厂构造函数,dart,Dart,是否可能返回as const的不同实现 抽象类Foo{ factory Foo(T thing)=>const FooImpl(thing);//Dart有一个委托工厂构造函数来允许此操作 抽象类Foo{ const factory Foo(T thing)=FooImpl; 得不到东西; } 类FooImpl实现Foo{ 最后一件事; const FooImpl(这个东西); } 另见 及

是否可能返回as const的不同实现

抽象类Foo{

factory Foo(T thing)=>const FooImpl(thing);//Dart有一个委托工厂构造函数来允许此操作

抽象类Foo{
const factory Foo(T thing)=FooImpl;
得不到东西;
}
类FooImpl实现Foo{
最后一件事;
const FooImpl(这个东西);
}
另见