【问题标题】:Changing App Layout Drawer persistent to temporary at media change in AngularDart在 AngularDart 中的媒体更改时将 App Layout Drawer 持久更改为临时
【发布时间】:2018-02-26 07:13:13
【问题描述】:

我的 AngularDart 项目中有一个角度组件的应用布局。如何在媒体画面切换时将App layout的drawerpersistent改为temporary

【问题讨论】:

    标签: dart angular-dart angular-components dart-html dart-webui


    【解决方案1】:

    您可以使用窗口上的onResize 事件来监听它的变化并将您的布局设置为temporarypersistent

    import "dart:html";
    import "dart:async";
    
    StreamSubscription<Event> subscription = window.onResize.listen((Event e) {
      final width = window.screen.width;
    });
    
    // onDestroy
    subscription.cancel();
    

    【讨论】:

    • 错误:由于使用了实例 getter 'onResize',无法推断出 'subscription' 的类型。
    • // onDestroy subscription.cancel(); “订阅”无效的构造函数名称
    猜你喜欢
    • 2012-07-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-25
    • 2018-01-01
    相关资源
    最近更新 更多