7
我的AngularDart项目中有角度组件的应用布局。在媒体屏幕变化时,如何将persistent
的应用程序布局的drawer
更改为temporary
?在AngularDart中更改应用布局抽屉在媒体更改时持久化为临时
我的AngularDart项目中有角度组件的应用布局。在媒体屏幕变化时,如何将persistent
的应用程序布局的drawer
更改为temporary
?在AngularDart中更改应用布局抽屉在媒体更改时持久化为临时
可以使用onResize
事件的窗口上听就可以了变化,你的布局设置为temporary
或persistent
import "dart:html";
import "dart:async";
StreamSubscription<Event> subscription = window.onResize.listen((Event e) {
final width = window.screen.width;
});
// onDestroy
subscription.cancel();
错误:类型“订阅”不能因为使用的推断实例getter'onResize'。 –
// onDestroy subscription.cancel(); '订阅'无效的构造函数名称 –
我更新了代码 –