navTo static method

void navTo(
  1. Widget widget
)

Implementation

static void navTo(Widget widget) {
  if (context != null) {
    Navigator.push(
        context!,
        PageRouteBuilder(
          pageBuilder: (context, a1, a2) => widget,
        ));
  } else {
    throw Exception(
        "You need do call 'Global.setContext(context);' above 'return MaterialApp(...'");
  }
}