Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 936
Tushar Rai Avatar asked Sep 17 '17 18:09

Tushar Rai


1 Answers

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();
like image 186
Hadrien Lejard Avatar answered Nov 07 '22 04:11

Hadrien Lejard