startNextSession static method
Starts next session and ends the current session.
Method might throw Exception.
Future<void> checkout(dynamic data) async {
try {
final response = http.post("https://server.com/checkout", data);
await Instrumentation.startNextSession();
} catch (e) {
// handle exception
}
}
Implementation
static Future<void> startNextSession() async {
try {
await channel.invokeMethod<void>('startNextSession');
} on PlatformException catch (e) {
throw Exception(e.details);
}
}