close method

Future<T?> close([
  1. T? result
])

Closes the Richbar widget above the current contents of the app, With Material entrance and exit animations

Implementation

Future<T?> close([T? result]) async {
  // If route was never initialized, do nothing
  if (richbarRoute == null) {
    return null;
  }
  if (richbarRoute!.isCurrent) {
    richbarRoute!.navigator!.pop(result);
    return richbarRoute!.completed;
  } else if (richbarRoute!.isActive) {
    // removeRoute is called every time you dismiss a Flushbar that is not the top route.
    // It will not animate back and listeners will not detect FlushbarStatus.IS_HIDING or FlushbarStatus.DISMISSED
    // To avoid this, always make sure that Flushbar is the top route when it is being dismissed
    richbarRoute!.navigator!.removeRoute(richbarRoute!);
  }
  return null;
}