inject_route_aware.dart 561 B

123456789101112131415161718192021222324252627282930313233
  1. import 'package:flutter/material.dart';
  2. import 'package:sport/application.dart';
  3. mixin InjectRouteAware<T extends StatefulWidget> on State<T>
  4. implements RouteAware {
  5. @override
  6. void didChangeDependencies() {
  7. super.didChangeDependencies();
  8. routeObserver.subscribe(this, ModalRoute.of(context)!);
  9. }
  10. @override
  11. void dispose() {
  12. routeObserver.unsubscribe(this);
  13. super.dispose();
  14. }
  15. @override
  16. void didPop() {
  17. }
  18. @override
  19. void didPopNext() {
  20. }
  21. @override
  22. void didPush() {
  23. }
  24. @override
  25. void didPushNext() {
  26. }
  27. }