launch<T> method
Future<T?>
launch<T>(
- BuildContext context, {
- bool isNewTask = false,
- PageRouteAnimation? pageRouteAnimation,
- Duration? duration,
Launch a new screen
Implementation
Future<T?> launch<T>(BuildContext context,
{bool isNewTask = false,
PageRouteAnimation? pageRouteAnimation,
Duration? duration}) async {
if (isNewTask) {
return await Navigator.of(context).pushAndRemoveUntil(
buildPageRoute(
this!, pageRouteAnimation ?? pageRouteAnimationGlobal, duration),
(route) => false,
);
} else {
return await Navigator.of(context).push(
buildPageRoute(
this!, pageRouteAnimation ?? pageRouteAnimationGlobal, duration),
);
}
}