forked from lichess-org/mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_navigator.dart
29 lines (24 loc) · 950 Bytes
/
test_navigator.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import 'package:flutter/widgets.dart';
class TestNavigatorObserver extends NavigatorObserver {
void Function(Route<dynamic> route, Route<dynamic>? previousRoute)? onPushed;
void Function(Route<dynamic> route, Route<dynamic>? previousRoute)? onPopped;
void Function(Route<dynamic> route, Route<dynamic>? previousRoute)? onRemoved;
void Function(Route<dynamic>? route, Route<dynamic>? previousRoute)?
onReplaced;
@override
void didPush(Route<dynamic> route, Route<dynamic>? previousRoute) {
onPushed?.call(route, previousRoute);
}
@override
void didPop(Route<dynamic> route, Route<dynamic>? previousRoute) {
onPopped?.call(route, previousRoute);
}
@override
void didRemove(Route<dynamic> route, Route<dynamic>? previousRoute) {
onRemoved?.call(route, previousRoute);
}
@override
void didReplace({Route<dynamic>? oldRoute, Route<dynamic>? newRoute}) {
onReplaced?.call(newRoute, oldRoute);
}
}