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?
Asked
Active
Viewed 157 times
7

Tushar Rai
- 2,371
- 4
- 28
- 57
1 Answers
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();

Hadrien Lejard
- 5,644
- 2
- 21
- 18
-
Error: The type of 'subscription' can't be inferred because of the use of the instance getter 'onResize'. – Tushar Rai Sep 18 '17 at 07:36
-
// onDestroy subscription.cancel(); 'subscription' invalid constructor name – Tushar Rai Sep 18 '17 at 07:37