import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';

class CustomNavigationObserver extends NavigatorObserver {

  @override
  void didPush(Route route, Route? previousRoute) async {
    final routeName = route.settings.name;

    super.didPush(route, previousRoute);
     tLog('CustomNavigationObserver: didPush - $routeName');
  }

  @override
  void didReplace({Route? newRoute, Route? oldRoute}) {
    super.didReplace(newRoute: newRoute, oldRoute: oldRoute);
    tLog('CustomNavigationObserver: didReplace - ${newRoute?.settings.name}');
  }

  @override
  void didPop(Route route, Route? previousRoute) {
    super.didPop(route, previousRoute);
     tLog('CustomNavigationObserver: didPop - ${route.settings.name}');
  }

  @override
  void didRemove(Route route, Route? previousRoute) {
    super.didRemove(route, previousRoute);
     tLog('CustomNavigationObserver: didRemove - ${route.settings.name}');
  }
}
