go static method

void go({
  1. required BuildContext context,
  2. required Widget target,
})

静态路由跳转 context 组件上下文 target 目标页面

Implementation

static void go({required BuildContext context, required Widget target}) {
  Navigator.push(context, MaterialPageRoute(builder: (BuildContext context) {
    return target;
  }));
}