pushScreen function

Future pushScreen({
  1. required BuildContext context,
  2. required Widget screen,
})

More readable than Navigator spelled out

Implementation

Future<dynamic> pushScreen({
  required BuildContext context,
  required Widget screen,
}) {
  return Navigator.of(context).push(
    platformPageRoute(
      context: context,
      builder: (context) => screen,
    ),
  );
}