launchNewScreenWithNewTask<T> function

Future<T?> launchNewScreenWithNewTask<T>(
  1. BuildContext context,
  2. String tag
)

Removes all previous screens from the back stack and redirect to new screen with provided screen tag

launchNewScreenWithNewTask(context, '/HomePage');

this is sample code

Implementation

Future<T?> launchNewScreenWithNewTask<T>(
        BuildContext context, String tag) async =>
    Navigator.of(context).pushNamedAndRemoveUntil(tag, (r) => false);