/// Created by Haoyi on 6/4/21 /// part of "../guru_api.dart"; extension GuruApiExtension on GuruApi { // Future signInWithAnonymous({required String secret}) async { // return await methods.signInWithAnonymous(AnonymousLoginReqBody(secret: secret)); // } Future loginGuruWithCredential({required Credential credential}) async { switch (credential.authType) { case AuthType.facebook: return await methods .signInWithFacebook(FacebookLoginReqBody(accessToken: credential.token)); case AuthType.google: return await methods.signInWithGoogle(GoogleLoginReqBody(idToken: credential.token)); case AuthType.apple: return await methods.signInWithApple(AppleLoginReqBody(token: credential.token)); case AuthType.anonymous: return await methods.signInWithAnonymous(AnonymousLoginReqBody(secret: credential.token)); } } Future associateCredential({required Credential credential}) async { switch (credential.authType) { case AuthType.facebook: return await methods .associateWithFacebook(FacebookLoginReqBody(accessToken: credential.token)); case AuthType.google: return await methods.associateWithGoogle(GoogleLoginReqBody(idToken: credential.token)); case AuthType.apple: return await methods.associateWithApple(AppleLoginReqBody(token: credential.token)); case AuthType.anonymous: return await methods.signInWithAnonymous(AnonymousLoginReqBody(secret: credential.token)); } } Future reportDevice(DeviceInfo deviceInfo) async { return await methods.reportDevice(deviceInfo); } Future renewFirebaseToken() async { return await methods.renewFirebaseToken(); } Future reportOrders(OrdersReport body) async { if (Platform.isAndroid) { return await methods.androidOrdersReport(body); } else { return await methods.iOSOrdersReport(body); } } }