refreshView method

void refreshView({
  1. bool? force,
  2. void fn()?,
})

refresh the page view only if widget is mounted use force to force refresh even if widget is alreay mounted

Implementation

void refreshView({bool? force, void Function()? fn}) {
  if (!mounted || (force != null && !force)) {
    return;
  }

  setState(fn ?? () {});
}