Last updated:
0 purchases
flutter drivekit driver data
DriveKit DriverData plugin #
Flutter interface for the DriveKit Driver Data
To learn more about DriveKit, please visit our DriveKit documentation
Installation #
To use this plugin, run this command in your project
flutter pub add drivekit_driver_data
copied to clipboard
Now, you can import 'package:flutter_drivekit_driver_data/flutter_drivekit_driver_data.dart' and use DriveKitDriverData in your Dart code.
Usage #
To use this plugin, you need to have an ApiKey from DriveQuant. If you don't have one, please contact us.
Then, you need to install the flutter_drivekit_core plugin and follow the instructions to specify the ApiKey and the UserId.
Now, you can configure the DriveKit Core with the options you want, and start using the DriveKit Driver Data plugin.
Please refer to the DriveKit Driver Data documentation for more information about the features we provide.
You can also take a look at the flutter example for a basic usage of the DriveKit SDK, and the iOS example app or android example app for a complete demonstration.
Manual initialization #
If you have disabled the DriveKit auto-initialization:
On Android project, call initialize method of DriveKitDriverData class inside your MainApplication class.
// MainApplication.kt
// …
override fun onCreate() {
super.onCreate()
DriveKit.initialize()
DriveKitTripAnalysis.initialize(…)
DriveKitDriverData.initialize()
(…)
}
copied to clipboard
On iOS project, call initialize method inside your AppDelegate.
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
DriveKit.shared.initialize()
DriveKitTripAnalysis.shared.initialize(appLaunchOptions: launchOptions)
DriveKitDriverData.shared.initialize()
(…)
}
copied to clipboard
API #
Method
Return Type
iOS
Android
getTripsOrderByDateAsc()
Future<GetTripsResponse?>
✅
✅
getTripsOrderByDateDesc()
Future<GetTripsResponse?>
✅
✅
getTrip()
Future<GetTripResponse>
✅
✅
getRoute()
Future<GetRouteResponse>
✅
✅
deleteTrip()
Future<bool>
✅
✅
getTripsOrderByDateAsc #
getTripsOrderByDateDesc #
Future<GetTripsResponse?> getTripsOrderByDateAsc(
SynchronizationType synchronizationType = SynchronizationType.defaultSync,
List<TransportationMode> transportationModes = const [
TransportationMode.unknown,
TransportationMode.car,
TransportationMode.moto,
TransportationMode.truck,
],
);
copied to clipboard
or
Future<GetTripsResponse?> getTripsOrderByDateDesc(
SynchronizationType synchronizationType = SynchronizationType.defaultSync,
List<TransportationMode> transportationModes = const [
TransportationMode.unknown,
TransportationMode.car,
TransportationMode.moto,
TransportationMode.truck,
],
);
copied to clipboard
GetTripsResponse
Type
status
TripSyncStatus
trips
[Trip]
To get driver's trips, you have to call the following method:
final tripSyncResult = await DriveKitDriverData.instance.getTripsOrderByDateAsc();
copied to clipboard
or
final tripSyncResult = await DriveKitDriverData.instance.getTripsOrderByDateDesc();
copied to clipboard
getTrip #
The itinId parameter is the unique identifier for a trip.
Future<GetTripResponse?> getTrip(String itinId);
copied to clipboard
GetTripResponse
Type
status
TripSyncStatus
trip
Trip?
To get a specific trip, you have to call the following method:
final result = await DriveKitDriverData.instance.getTrip('TRIP_ID_HERE');
copied to clipboard
getRoute #
The itinId parameter is the unique identifier for a trip.
Future<GetRouteResponse?> getRoute(String itinId);
copied to clipboard
GetRouteResponse
Type
status
RouteSyncStatus
route
Route?
To get a specific route, you have to call the following method:
final result = await DriveKitDriverData.instance.getRoute('TRIP_ID_HERE');
copied to clipboard
deleteTrip #
The itinId parameter is the unique identifier for a trip.
Future<bool> deleteTrip(String itinId);
copied to clipboard
To delete a trip, you have to call the following method:
final result = await DriveKitDriverData.instance.deleteTrip('TRIP_ID_HERE');
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.