|
- /*
- * @Author: your name
- * @Date: 2020-05-16 17:50:31
- * @LastEditTime: 2020-06-17 18:27:00
- * @LastEditors: Please set LastEditors
- * @Description: In User Settings Edit
- * @FilePath: /hairuyi_flutter_comm/lib/router/router_util.dart
- */
- 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<String, dynamic> 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);
- }
- }
- }
|