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

162 views Asked by At

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?

1

There are 1 answers

2
Hadrien Lejard On

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();