pushToPage function

void pushToPage({
  1. required BuildContext context,
  2. required Widget widget,
  3. bool pushReplaces = false,
})

Implementation

void pushToPage({
  required BuildContext context,
  required Widget widget,
  bool pushReplaces = false,
}) {
  if (pushReplaces) {
    Navigator.pushReplacement(
      context,
      MaterialPageRoute(
        builder: (_) => ScreenUtilInit(
          designSize: const Size(430, 932),
          minTextAdapt: true,
          splitScreenMode: true,
          child: widget,
        ),
      ),
    );
  } else {
    Navigator.push(
      context,
      MaterialPageRoute(
        builder: (_) => ScreenUtilInit(
          designSize: const Size(430, 932),
          minTextAdapt: true,
          splitScreenMode: true,
          child: widget,
        ),
      ),
    );
  }
}