Skip to content

Conversation

@luisfelipeas5
Copy link

Uses FlutterResult on SwiftRoamFlutterPlugin.swift (iOS) and Result on RoamFlutterPlugin.java to return for the flutter the errors of getUser method.

With this fix refactor, we can use try catch, like:

try {
  await Roam.getUser(
    userId: "",
    callBack: ({user}) => debugPrint(user),
  );
} catch (exception, stackTrace) {
  log(
    "Roam method invokation exception: "
    "methodName = getUser "
    "exception = ${exception.toString()}",
    stackTrace: stackTrace,
  );
}

Note for future improvement: could be better not have callbacks on this methods to allow this type of code:

final user = await Roam.getUser(userId: "");
debugPrint(user);

@luisfelipeas5 luisfelipeas5 marked this pull request as ready for review May 8, 2023 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant