Line data Source code
1 : part of '../main.dart'; 2 : 3 : /// A [VRouteElement] similar to [VWidgetBase] but which allows you to specify your own page 4 : /// thanks to [pageBuilder] 5 : class VPageBase extends VRouteElement 6 : with 7 : VRouteElementSingleSubRoute, 8 : VRouteElementWithPage, 9 : VoidVGuard, 10 : VoidVPopHandler { 11 : /// A function which allows you to use your own custom page 12 : /// 13 : /// You must use [child] as the child of your page (though you can wrap it in other widgets) 14 : /// 15 : /// [child] will basically be whatever you put in [widget] 16 : @override 17 : final Page Function(LocalKey key, Widget child) pageBuilder; 18 : 19 : /// The widget which will be displayed for the given [path] 20 : @override 21 : final Widget widget; 22 : 23 : @override 24 : final LocalKey? key; 25 : 26 : @override 27 : final List<VRouteElement> stackedRoutes; 28 : 29 14 : VPageBase({ 30 : required this.pageBuilder, 31 : required this.widget, 32 : this.key, 33 : this.stackedRoutes = const [], 34 : }); 35 : 36 10 : @override 37 10 : List<VRouteElement> buildRoutes() => stackedRoutes; 38 : 39 8 : @override 40 : bool get popWithSubRoute => false; 41 : }