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 = VPopHandler._voidOnPop, 9 : Future<void> Function(VRedirector vRedirector) onSystemPop = VPopHandler._voidOnSystemPop, 10 : required this.stackedRoutes, 11 : }) : _onPop = onPop, 12 : _onSystemPop = onSystemPop; 13 : 14 : /// See [VRouteElement.buildRoutes] 15 : final List<VRouteElement> stackedRoutes; 16 : 17 4 : List<VRouteElement> buildRoutes() => stackedRoutes; 18 : 19 1 : @override 20 2 : Future<void> onPop(VRedirector vRedirector) => _onPop(vRedirector); 21 : final Future<void> Function(VRedirector vRedirector) _onPop; 22 : 23 1 : @override 24 2 : Future<void> onSystemPop(VRedirector vRedirector) => _onSystemPop(vRedirector); 25 : final Future<void> Function(VRedirector vRedirector) _onSystemPop; 26 : 27 : /// Default function for [onPop] 28 : /// Basically does nothing 29 7 : static Future<void> _voidOnPop(VRedirector vRedirector) async {} 30 : 31 : /// Default function for [onSystemPop] 32 : /// Basically does nothing 33 6 : static Future<void> _voidOnSystemPop(VRedirector vRedirector) async {} 34 : }