transResult function

Future transResult (
  1. {String path,
  2. Map<String, dynamic> arguments,
  3. bool replace,
  4. bool clearTrace}
)

transform result

Implementation

Future<dynamic> transResult(
    {String path,
    Map<String, dynamic> arguments,
    bool replace,
    bool clearTrace}) async {
  dynamic future;
  if (clearTrace == true) {
    future = await RRouter.navigator
        .pushNamedAndRemoveUntil(path, (check) => false, arguments: arguments);
  } else {
    future = replace == true
        ? await RRouter.navigator
            .pushReplacementNamed(path, arguments: arguments)
        : await RRouter.navigator.pushNamed(path, arguments: arguments);
  }
  return future;
}