Line data Source code
1 : part of '../main.dart';
2 :
3 : abstract class VRouterData extends InheritedWidget {
4 12 : VRouterData({Key? key, required Widget child})
5 12 : : super(key: key, child: child);
6 :
7 : /// Url currently synced with the state
8 : /// This url can differ from the once of the browser if
9 : /// the state has been yet been updated
10 : String? get url;
11 :
12 : /// Previous url that was synced with the state
13 : String? get previousUrl;
14 :
15 : /// This state is saved in the browser history. This means that if the user presses
16 : /// the back or forward button on the navigator, this historyState will be the same
17 : /// as the last one you saved.
18 : ///
19 : /// It can be changed by using [context.vRouter.replaceHistoryState(newState)]
20 : Map<String, String> get historyState;
21 :
22 : /// Maps all route parameters (i.e. parameters of the path
23 : /// mentioned as ":someId")
24 : Map<String, String> get pathParameters;
25 :
26 : /// Contains all query parameters (i.e. parameters after
27 : /// the "?" in the url) of the current url
28 : Map<String, String> get queryParameters;
29 :
30 : /// See [VRouterState.push]
31 : void push(
32 : String newUrl, {
33 : Map<String, String> queryParameters = const {},
34 : Map<String, String> historyState = const {},
35 : });
36 :
37 : /// See [VRouterState.pushNamed]
38 : void pushNamed(
39 : String name, {
40 : Map<String, String> pathParameters = const {},
41 : Map<String, String> queryParameters = const {},
42 : Map<String, String> historyState = const {},
43 : });
44 :
45 : /// See [VRouterState.pushReplacement]
46 : void pushReplacement(
47 : String newUrl, {
48 : Map<String, String> queryParameters = const {},
49 : Map<String, String> historyState = const {},
50 : });
51 :
52 : /// See [VRouterState.pushReplacementNamed]
53 : void pushReplacementNamed(
54 : String name, {
55 : Map<String, String> pathParameters = const {},
56 : Map<String, String> queryParameters = const {},
57 : Map<String, String> historyState = const {},
58 : });
59 :
60 : /// See [VRouterState.pushExternal]
61 : void pushExternal(String newUrl, {bool openNewTab = false});
62 :
63 : /// See [VRouterState._pop]
64 : void pop({
65 : Map<String, String> pathParameters = const {},
66 : Map<String, String> queryParameters = const {},
67 : Map<String, String> newHistoryState = const {},
68 : });
69 :
70 : /// See [VRouterState._systemPop]
71 : Future<void> systemPop({
72 : Map<String, String> pathParameters = const {},
73 : Map<String, String> queryParameters = const {},
74 : Map<String, String> newHistoryState = const {},
75 : });
76 :
77 : /// See [VRouterState.replaceHistoryState]
78 : void replaceHistoryState(Map<String, String> historyState);
79 : }
|