Changing App Layout Drawer persistent to temporary at media change in AngularDart
Asked Answered
U

1

7

I have an App Layout of angular components in my AngularDart project. How can I change the drawer of App layout from persistent to temporary at the change of media screen?

Unloosen answered 17/9, 2017 at 18:41 Comment(0)
S
3

you can use the onResize event on the window to listen change on it and set your layout to temporary or persistent

import "dart:html";
import "dart:async";

StreamSubscription<Event> subscription = window.onResize.listen((Event e) {
  final width = window.screen.width;
});

// onDestroy
subscription.cancel();
Subtile answered 18/9, 2017 at 7:12 Comment(2)
Error: The type of 'subscription' can't be inferred because of the use of the instance getter 'onResize'.Unloosen
// onDestroy subscription.cancel(); 'subscription' invalid constructor nameUnloosen

© 2022 - 2024 — McMap. All rights reserved.