popToFirst function

void popToFirst(
  1. BuildContext context
)

Pop to first screen of the navigator stack

Implementation

void popToFirst(BuildContext context) {
  Navigator.of(context).popUntil((_) => _.isFirst);
}