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?

Tushar Rai
  • 2,371
  • 4
  • 28
  • 57

1 Answers1

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