【发布时间】:2019-12-13 05:23:43
【问题描述】:
我有一个 mixin 和抽象类扩展 StatefulWidget。我想将我的 mixin 添加到抽象类中。
混音:
mixin MyMixin<T extends StatefulWidget> on State<T> {
String translate(context,childKey)
{
var parentKey = getParentLocalisationKey();
return childKey+parentKey;
}
String getParentLocalisationKey();
}
还有抽象类:
abstract class BaseState<Page extends BasePage> extends State<Page>
with WidgetsBindingObserver {
}
如何将 mixin 添加到抽象类?有什么办法吗?
【问题讨论】:
标签: flutter dart mobile-development