import 'package:flutter/material.dart'; import 'package:zhiying_comm/zhiying_comm.dart'; class RouterUtil { /** * @description: 公共方法页面跳转,如果flutter端已经注册,直接跳转,否则转交原生处理 * @param {BasePageModel} 页面数据 * @param {BuildContext} context * @return: */ static void route(Map model, BuildContext context) { String name = model.containsKey('name') ? model['name'] : ''; if (PageFactory.hasRegisted(name)) { Widget page = PageFactory.create(name, model); Navigator.push(context, MaterialPageRoute(builder: (context) { return page; })); } else { NativeUtil.openPage(context, model); } } }