push method

  1. @override
void push(
  1. Widget widget, {
  2. bool replace = false,
  3. bool renderScreen = false,
  4. AnalyticsEvent? event,
})
override

Pushes a widget to the stack.

Implementation

@override
void push(
  Widget widget, {
  bool replace = false,
  bool renderScreen = false,
  AnalyticsEvent? event,
}) {
  if (event != null) {
    GetIt.I<IAnalyticsService>().sendEvent(event);
  }
  onRenderScreen.value = renderScreen;
  if (replace) {
    _stack.removeLast();
  }
  _stack.add(widget);
  notifyListeners();
}