@@ -11,53 +11,80 @@ class NextBillion {
11
11
_nextBillionChannel = channel;
12
12
}
13
13
14
+ /// Initializes the NextBillion SDK with the provided [accessKey] .
14
15
static Future <void > initNextBillion (String accessKey) async {
15
16
Map <String , dynamic > config = {"accessKey" : accessKey};
16
17
return await _nextBillionChannel.invokeMethod (
17
18
"nextbillion/init_nextbillion" , config);
18
19
}
19
20
21
+ /// Retrieves the access key.
22
+ /// To get the current access key used for initNextBillion.
23
+ /// Returns a [Future] that completes with the access key as a [String] .
20
24
static Future <String > getAccessKey () async {
21
25
return await _nextBillionChannel.invokeMethod ("nextbillion/get_access_key" );
22
26
}
23
27
28
+ /// Sets the access key.
29
+ /// [accessKey] The access key to be set.
24
30
static Future <void > setAccessKey (String accessKey) async {
25
31
Map <String , dynamic > config = {"accessKey" : accessKey};
26
32
return await _nextBillionChannel.invokeMethod (
27
33
"nextbillion/set_access_key" , config);
28
34
}
29
35
36
+ /// Retrieves the base URI.
37
+ /// To get the current base URI used for Map Style API requests.
38
+ ///
39
+ /// Returns a [Future] that completes with the base URI as a [String] .
30
40
static Future <String > getBaseUri () async {
31
41
return await _nextBillionChannel.invokeMethod ("nextbillion/get_base_uri" );
32
42
}
33
43
44
+ /// Sets the base URI.
45
+ ///
46
+ /// To set a new base URI used for Map Style API requests.
47
+ ///
48
+ /// [baseUri] The base URI to be set.
34
49
static Future <void > setBaseUri (String baseUri) async {
35
50
Map <String , dynamic > config = {"baseUri" : baseUri};
36
51
return await _nextBillionChannel.invokeMethod (
37
52
"nextbillion/set_base_uri" , config);
38
53
}
39
54
55
+ /// Sets the API key header name.
56
+ ///
57
+ /// To set a new header name used for the API key in HTTP requests.
58
+ ///
59
+ /// [apiKeyHeaderName] The name of the API key header to be set.
60
+ ///
40
61
static Future <void > setApiKeyHeaderName (String apiKeyHeaderName) async {
41
62
Map <String , dynamic > config = {"apiKeyHeaderName" : apiKeyHeaderName};
42
63
return await _nextBillionChannel.invokeMethod (
43
64
"nextbillion/set_key_header_name" , config);
44
65
}
45
66
67
+ /// Retrieves the API key header name.
68
+ ///
69
+ /// To get the current header name used for the API key in HTTP requests.
46
70
static Future <String > getApiKeyHeaderName () async {
47
71
return await _nextBillionChannel
48
72
.invokeMethod ("nextbillion/get_key_header_name" );
49
73
}
50
74
75
+ /// Get the NextBillion ID for the current user.
51
76
static Future <String > getNbId () async {
52
77
return await _nextBillionChannel.invokeMethod ("nextbillion/get_nb_id" );
53
78
}
54
79
80
+ /// Set the user ID for the current user if you need to add a user ID to the navigation request user-agent.
55
81
static Future <void > setUserId (String id) async {
56
82
Map <String , dynamic > config = {"userId" : id};
57
83
return await _nextBillionChannel.invokeMethod (
58
84
"nextbillion/set_user_id" , config);
59
85
}
60
86
87
+ /// Get the user ID for the current user if you need to add a user ID to the navigation request user-agent.
61
88
static Future <String ?> getUserId () async {
62
89
return await _nextBillionChannel.invokeMethod ("nextbillion/get_user_id" );
63
90
}
0 commit comments