基础库
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 

46 satır
1.2 KiB

  1. import 'package:flutter/material.dart';
  2. import 'package:zhiying_comm/zhiying_comm.dart';
  3. class FNNavigatorObserver extends NavigatorObserver {
  4. factory FNNavigatorObserver() => _getInstance();
  5. static FNNavigatorObserver get instance => _getInstance();
  6. static FNNavigatorObserver _instance;
  7. NavigatorObserver curContext;
  8. FNNavigatorObserver._();
  9. static FNNavigatorObserver _getInstance() {
  10. if (_instance == null) {
  11. _instance = new FNNavigatorObserver._();
  12. }
  13. return _instance;
  14. }
  15. String topRouteName = "";
  16. void didPush(Route<dynamic> route, Route<dynamic> previousRoute) {
  17. notifyHide(previousRoute);
  18. notifyShow(route);
  19. }
  20. void didPop(Route<dynamic> route, Route<dynamic> previousRoute) {
  21. notifyHide(route);
  22. notifyShow(previousRoute);
  23. }
  24. void didRemove(Route<dynamic> route, Route<dynamic> previousRoute) {
  25. notifyHide(route);
  26. notifyShow(previousRoute);
  27. }
  28. /// The [Navigator] replaced `oldRoute` with `newRoute`.
  29. void didReplace({Route<dynamic> newRoute, Route<dynamic> oldRoute}) {
  30. notifyHide(oldRoute);
  31. notifyShow(newRoute);
  32. }
  33. void notifyShow(Route<dynamic> route) {}
  34. void notifyHide(Route<dynamic> route) {}
  35. }