routePage method Null safety

dynamic routePage(
  1. dynamic context,
  2. Widget route
)

Implementation

routePage(context, Widget route) {
  return getPlatformType == PlatformType.iOS
      ? Navigator.push(
          context,
          CupertinoPageRoute(
            builder: (context) {
              return route;
            },
          ),
        )
      : Navigator.push(
          context,
          MaterialPageRoute(
            builder: (context) {
              return route;
            },
          ),
        );
}