resetNavTo function
Implementation
Future<void> resetNavTo(BuildContext context, Widget widget) async {
Navigator.pushAndRemoveUntil(
context,
PageRouteBuilder(
pageBuilder: (context, animation1, animation2) => widget,
transitionDuration: Duration.zero,
reverseTransitionDuration: Duration.zero,
),
(route) => false
);
}