基础库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

31 regels
970 B

  1. /*
  2. * @Author: your name
  3. * @Date: 2020-05-16 17:50:31
  4. * @LastEditTime: 2020-06-17 18:27:00
  5. * @LastEditors: Please set LastEditors
  6. * @Description: In User Settings Edit
  7. * @FilePath: /hairuyi_flutter_comm/lib/router/router_util.dart
  8. */
  9. import 'package:flutter/material.dart';
  10. import 'package:zhiying_comm/zhiying_comm.dart';
  11. class RouterUtil {
  12. /**
  13. * @description: 公共方法页面跳转,如果flutter端已经注册,直接跳转,否则转交原生处理
  14. * @param {BasePageModel} 页面数据
  15. * @param {BuildContext} context
  16. * @return:
  17. */
  18. static void route(Map<String, dynamic> model, BuildContext context) {
  19. String name = model.containsKey('name') ? model['name'] : '';
  20. if (PageFactory.hasRegisted(name)) {
  21. Widget page = PageFactory.create(name, model);
  22. Navigator.push(context, MaterialPageRoute(builder: (context) {
  23. return page;
  24. }));
  25. } else {
  26. NativeUtil.openPage(context, model);
  27. }
  28. }
  29. }