goToHome method
Clear navigation history and go to home
Implementation
Future<void> goToHome() async {
final context = navigatorKey.currentContext;
if (context != null) {
Navigator.of(context).pushNamedAndRemoveUntil(
'/',
(route) => false,
);
}
}