我想对该类进行子类化
class FirebaseAuth {
FirebaseAuth._(this.app);
/// Provides an instance of this class corresponding to `app`.
factory FirebaseAuth.fromApp(FirebaseApp app) {
assert(app != null);
return FirebaseAuth._(app);
}
/// Provides an instance of this class corresponding to the default app.
static final FirebaseAuth instance = FirebaseAuth._(FirebaseApp.instance);
final FirebaseApp app;
...
如果我尝试对其进行子类化,则会出现此错误:
class FA extends FirebaseAuth {
FA.fromApp(FirebaseApp app) : super.fromApp(app);
}
预期会生成生成器'FirebaseAuth FirebaseAuth.fromApp(FirebaseApp app)',但已在工厂找到。尝试在超类中调用其他构造函数,或者使被调用的构造函数不是工厂构造函数
据我所知FirebaseAuth.fromApp()
不是生成式构造函数,而是工厂构造函数,我不明白它的意思。另外,如果所有生成器都在超类中是私有的,我也看不到如何将其生成子类。