pushReplacement method

dynamic pushReplacement(
  1. BuildContext context,
  2. Widget page
)

Implementation

pushReplacement(BuildContext context, Widget page) {
  try {
    Navigator.of(context)
        .pushReplacement(MaterialPageRoute(builder: (context) => page));
  } catch (e) {}
}