我的 AngularDart 项目中有一个角度组件的应用程序布局。我该如何更改 drawer
来自 persistent
的应用程序布局至 temporary
在媒体屏幕的变化?
最佳答案
您可以使用 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();
关于dart - 在 AngularDart 中的媒体更改时将应用程序布局抽屉持久更改为临时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46267605/