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?
Changing App Layout Drawer persistent to temporary at media change in AngularDart
Asked Answered
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();
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 name –
Unloosen
© 2022 - 2024 — McMap. All rights reserved.