dart_roadsdata_http 1.0.0
dart_roadsdata_http: ^1.0.0 copied to clipboard
Integrate Roadsdata seamlessly in your Dart app with our HTTP Client package, featuring advanced network handling and automatic retries.
example/dart_roadsdata_http_example.dart
import 'dart:math';
import 'dart:convert';
import 'package:dart_roadsdata_http/dart_roadsdata_http.dart';
void main() {
var random = Random.secure();
String? host; // initialize with the received value
String? clientId; // initialize with the received value
String? accessToken; // initialize with the received value
String? uuid =
base64UrlEncode(List<int>.generate(8, (i) => random.nextInt(255)));
if (host == null || clientId == null || accessToken == null) {
print('Please provide the needed parameters.');
return;
}
var httpClient = RoadsdataHttpClient.init(
host: host, clientId: clientId, accessToken: accessToken, uuid: uuid);
httpClient
.checkAdForContainer('helloworld!')
.then((value) => print(value.toString()))
.catchError((error) => print(error.toString()));
}