push<T> method
Push the given route onto the navigator.
Implementation
Future<T?> push<T>(
Widget screen, {
bool transparent = false,
bool isCupertino = false,
}) {
final RouteSettings settings = RouteSettings(
name: screen.toString(),
);
if (transparent) {
return Navigator.of(this).push<T>(
TransparentRoute<T>(
builder: (_) => screen,
settings: settings,
),
);
} else {
if (isCupertino) {
return Navigator.of(this).push<T>(
CupertinoPageRoute<T>(
builder: (_) => screen,
settings: settings,
),
);
}
return Navigator.of(this).push<T>(
MaterialPageRoute<T>(
builder: (_) => screen,
settings: settings,
),
);
}
}