pushTo method

dynamic pushTo(
  1. Widget page, {
  2. dynamic data,
})

Push to a new page

Implementation

pushTo(Widget page, {dynamic data}) {
  Navigator.of(context).push(
    MaterialPageRoute(
      builder: (BuildContext context) {
        if (page is NyStatefulWidget) {
          page.controller.request = NyRequest(args: NyArgument(data));
        }
        return page;
      },
    ),
  );
}