init method

void init(
  1. View homeView, {
  2. String theme = 'default',
  3. 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);
  }
}