goToHome method

Future<void> goToHome()

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,
    );
  }
}