init method
void
init(
- View homeView, {
- String theme = 'default',
- String nodeSelector = 'body',
})
Implementation
void init(View homeView,
{String theme = 'default', String nodeSelector = 'body'}) {
this.homeView = homeView;
window.onHashChange.listen((event) {
if (event is HashChangeEvent) {
if (event.newUrl != event.oldUrl) {
openPath(window.location.hash.replaceFirst('#', ''));
}
}
});
if (window.location.hash.isEmpty) {
_showView(homeView);
} else {
final openUrl = window.location.hash.replaceFirst('#', '');
openPath(openUrl);
}
if (!insertedToPage) {
insertToPage(theme: theme, nodeSelector: nodeSelector);
}
}