Line data Source code
1 : part of '../main.dart'; 2 : 3 : /// A [VRouteElement] which allows you to intercept and react to pop events 4 : /// See [onPop] and [onSystemPop] for more detailed explanations 5 : class VPopHandler extends VRouteElement 6 : with VRouteElementSingleSubRoute, VoidVGuard { 7 2 : VPopHandler({ 8 : Future<void> Function(VRedirector vRedirector) onPop = 9 : VPopHandler._voidOnPop, 10 : Future<void> Function(VRedirector vRedirector) onSystemPop = 11 : VPopHandler._voidOnSystemPop, 12 : required this.stackedRoutes, 13 : }) : _onPop = onPop, 14 : _onSystemPop = onSystemPop; 15 : 16 : /// See [VRouteElement.buildRoutes] 17 : final List<VRouteElement> stackedRoutes; 18 : 19 4 : List<VRouteElement> buildRoutes() => stackedRoutes; 20 : 21 1 : @override 22 2 : Future<void> onPop(VRedirector vRedirector) => _onPop(vRedirector); 23 : final Future<void> Function(VRedirector vRedirector) _onPop; 24 : 25 1 : @override 26 : Future<void> onSystemPop(VRedirector vRedirector) => 27 2 : _onSystemPop(vRedirector); 28 : final Future<void> Function(VRedirector vRedirector) _onSystemPop; 29 : 30 : /// Default function for [onPop] 31 : /// Basically does nothing 32 7 : static Future<void> _voidOnPop(VRedirector vRedirector) async {} 33 : 34 : /// Default function for [onSystemPop] 35 : /// Basically does nothing 36 6 : static Future<void> _voidOnSystemPop(VRedirector vRedirector) async {} 37 : }