getUserDetails function
Implementation
Future<RegisteredDriver?> getUserDetails() async {
try {
String? getUserDetails = await platform.invokeMethod('getUserDetails');
return RegisteredDriver.fromJson(jsonDecode(getUserDetails!));
} on PlatformException catch (e, stacktrace) {
if (kDebugMode) {
print(e);
print(stacktrace);
}
rethrow;
} catch (e, stacktrace) {
if (kDebugMode) {
print(e);
print(stacktrace);
}
throw PlatformException(code: "PLUGIN_ERROR", message: e.toString());
}
}